Merge "opengles emulator: libEGL fixes for ATI driver on windows."
This commit is contained in:
@@ -49,7 +49,16 @@ GLEScontext* getGLESContext();
|
||||
|
||||
#define tls_thread EglThreadInfo::get()
|
||||
|
||||
EglGlobalInfo* g_eglInfo = EglGlobalInfo::getInstance();
|
||||
EglGlobalInfo* g_eglInfo = NULL;
|
||||
android::Mutex s_eglLock;
|
||||
|
||||
void initGlobalInfo()
|
||||
{
|
||||
android::Mutex::Autolock mutex(s_eglLock);
|
||||
if (!g_eglInfo) {
|
||||
g_eglInfo = EglGlobalInfo::getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
static EGLiface s_eglIface = {
|
||||
getGLESContext : getGLESContext,
|
||||
@@ -144,6 +153,7 @@ EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id) {
|
||||
EglDisplay* dpy = NULL;
|
||||
EGLNativeInternalDisplayType internalDisplay = NULL;
|
||||
|
||||
initGlobalInfo();
|
||||
|
||||
if ((dpy = g_eglInfo->getDisplay(display_id))) {
|
||||
return dpy;
|
||||
@@ -185,6 +195,9 @@ static __translator_getGLESIfaceFunc loadIfaces(const char* libName){
|
||||
#endif
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay display, EGLint *major, EGLint *minor) {
|
||||
|
||||
initGlobalInfo();
|
||||
|
||||
EglDisplay* dpy = g_eglInfo->getDisplay(display);
|
||||
if(!dpy) {
|
||||
RETURN_ERROR(EGL_FALSE,EGL_BAD_DISPLAY);
|
||||
@@ -928,6 +941,9 @@ EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void) {
|
||||
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY
|
||||
eglGetProcAddress(const char *procname){
|
||||
__eglMustCastToProperFunctionPointerType retVal = NULL;
|
||||
|
||||
initGlobalInfo();
|
||||
|
||||
if(!strncmp(procname,"egl",3)) { //EGL proc
|
||||
for(int i=0;i < s_eglExtentionsSize;i++){
|
||||
if(strcmp(procname,s_eglExtentions[i].name) == 0){
|
||||
|
||||
@@ -220,7 +220,6 @@ static HDC getDummyDC(EGLNativeInternalDisplayType display,int cfgId){
|
||||
return dpy;
|
||||
}
|
||||
void initPtrToWglFunctions(){
|
||||
|
||||
HWND hwnd = createDummyWindow();
|
||||
HDC dpy = GetDC(hwnd);
|
||||
if(!hwnd || !dpy){
|
||||
@@ -308,7 +307,9 @@ static bool initPixelFormat(HDC dc){
|
||||
int iPixelFormat;
|
||||
|
||||
if(s_wglExtProcs->wglChoosePixelFormatARB) {
|
||||
return s_wglExtProcs->wglChoosePixelFormatARB(dc,NULL, NULL, 1, &iPixelFormat, &numpf);
|
||||
int i0 = 0;
|
||||
float f0 = 0.0f;
|
||||
return s_wglExtProcs->wglChoosePixelFormatARB(dc,&i0, &f0, 1, &iPixelFormat, &numpf);
|
||||
} else {
|
||||
return ChoosePixelFormat(dc,&pfd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user