Merge change 534 into donut
* changes: Make sure to map undefined OES functions to their non-OES counterpart if it exists.
This commit is contained in:
@@ -273,6 +273,8 @@ int gpu_release(void*, request_gpu_t* gpu);
|
|||||||
static __attribute__((noinline))
|
static __attribute__((noinline))
|
||||||
void *load_driver(const char* driver, gl_hooks_t* hooks)
|
void *load_driver(const char* driver, gl_hooks_t* hooks)
|
||||||
{
|
{
|
||||||
|
//LOGD("%s", driver);
|
||||||
|
char scrap[256];
|
||||||
void* dso = dlopen(driver, RTLD_NOW | RTLD_LOCAL);
|
void* dso = dlopen(driver, RTLD_NOW | RTLD_LOCAL);
|
||||||
LOGE_IF(!dso,
|
LOGE_IF(!dso,
|
||||||
"couldn't load <%s> library (%s)",
|
"couldn't load <%s> library (%s)",
|
||||||
@@ -321,9 +323,31 @@ void *load_driver(const char* driver, gl_hooks_t* hooks)
|
|||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
// couldn't find the entry-point, use eglGetProcAddress()
|
// couldn't find the entry-point, use eglGetProcAddress()
|
||||||
f = getProcAddress(name);
|
f = getProcAddress(name);
|
||||||
if (f == NULL) {
|
|
||||||
f = (__eglMustCastToProperFunctionPointerType)gl_unimplemented;
|
|
||||||
}
|
}
|
||||||
|
if (f == NULL) {
|
||||||
|
// Try without the OES postfix
|
||||||
|
ssize_t index = ssize_t(strlen(name)) - 3;
|
||||||
|
if ((index>0 && (index<255)) && (!strcmp(name+index, "OES"))) {
|
||||||
|
strncpy(scrap, name, index);
|
||||||
|
scrap[index] = 0;
|
||||||
|
f = (__eglMustCastToProperFunctionPointerType)dlsym(dso, scrap);
|
||||||
|
//LOGD_IF(f, "found <%s> instead", scrap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (f == NULL) {
|
||||||
|
// Try with the OES postfix
|
||||||
|
ssize_t index = ssize_t(strlen(name)) - 3;
|
||||||
|
if ((index>0 && (index<252)) && (strcmp(name+index, "OES"))) {
|
||||||
|
strncpy(scrap, name, index);
|
||||||
|
scrap[index] = 0;
|
||||||
|
strcat(scrap, "OES");
|
||||||
|
f = (__eglMustCastToProperFunctionPointerType)dlsym(dso, scrap);
|
||||||
|
//LOGD_IF(f, "found <%s> instead", scrap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (f == NULL) {
|
||||||
|
LOGD("%s", name);
|
||||||
|
f = (__eglMustCastToProperFunctionPointerType)gl_unimplemented;
|
||||||
}
|
}
|
||||||
*curr++ = f;
|
*curr++ = f;
|
||||||
api++;
|
api++;
|
||||||
|
|||||||
Reference in New Issue
Block a user