VirtualBox

儲存庫 vbox 的更動 18540


忽略:
時間撮記:
2009-3-30 下午12:53:54 (16 年 以前)
作者:
vboxsync
訊息:

crOpenGL: another fix for intel drivers

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu_wgl.c

    r18519 r18540  
    313313bSetupPixelFormat( HDC hdc, GLbitfield visAttribs )
    314314{
    315     if (render_spu.ws.wglChoosePixelFormatEXT)
    316         return bSetupPixelFormatEXT( hdc, visAttribs );
    317     else
    318         return bSetupPixelFormatNormal( hdc, visAttribs );
     315    /* According to http://www.opengl.org/resources/faq/technical/mswindows.htm
     316       we shouldn't be using wgl functions to setup pixel formats unless we're loading ICD driver.
     317       In particular, bSetupPixelFormatEXT bugs with Intel drivers.
     318     */
     319    bSetupPixelFormatNormal(hdc, visAttribs);
    319320}
    320321
     
    851852
    852853            if (!context->hRC) {
    853                 context->hRC = render_spu.ws.wglCreateContext(window->device_context);
     854                context->hRC = render_spu.ws.wglCreateContext(context->visual->device_context);
    854855                if (!context->hRC)
    855856                {
     
    861862            {
    862863                DWORD err = GetLastError();
    863                 crWarning("Render SPU: (MakeCurrent) failed to make 0x%x, 0x%x current with 0x%x error.", window->device_context, context->hRC, err);
    864 
    865                 /* Workaround for Intel drivers, which report support for wglChoosePixelFormatEXT, but it doesn't work. */
    866                 if ((err==ERROR_INVALID_PIXEL_FORMAT) && (!context->everCurrent))
    867                 {
    868                     crDebug("Trying to resetup pixel format");
    869 
    870                     render_spu.ws.wglDeleteContext(context->hRC);
    871                     DeleteDC(window->device_context);
    872                     window->device_context = GetDC(window->hWnd);
    873                     crDebug("Render SPU: MakeCurrent made new window DC: 0x%x", window->device_context);
    874                    
    875                     if (!bSetupPixelFormatNormal(window->device_context, context->visual->visAttribs))
    876                     {
    877                         crWarning("Failed to resetup pixel format");
    878                     }
    879 
    880                     context->hRC = render_spu.ws.wglCreateContext(window->device_context);
    881                     if (!context->hRC)
    882                     {
    883                         crError("Render SPU: (MakeCurrent) Couldn't create the context for the window (error 0x%x)", GetLastError());
    884                     }
    885 
    886                     if (!render_spu.ws.wglMakeCurrent(window->device_context, context->hRC))
    887                     {
    888                         crError("Can't make context current");
    889                     }
    890                     else
    891                     {
    892                         crInfo("Render SPU: (MakeCurrent) passed after pixel format reset");
    893                     }
    894                 }
     864                crError("Render SPU: (MakeCurrent) failed to make 0x%x, 0x%x current with 0x%x error.", window->device_context, context->hRC, err);
    895865            }
    896866        }
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette