VirtualBox

Ignore:
Timestamp:
Jan 20, 2012 1:12:27 PM (13 years ago)
Author:
vboxsync
Message:

wddm/3d: fix ie rendering with mesa nvidia drivers

Location:
trunk/src/VBox/Additions/WINNT/Graphics
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.cpp

    r39587 r39819  
    108108#define VBOXDISP_DDI_PROLOGUE() \
    109109    VBOXVDBG_BREAK_DDI(); \
    110     VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE();
     110    VBOXDISPPROFILE_FUNCTION_DDI_PROLOGUE(); \
     111    VBOXVDBG_CREATE_CHECK_SWAPCHAIN();
    111112
    112113#ifdef VBOXDISPMP_TEST
     
    21972198                    Assert(iBb != (~0));
    21982199#endif
    2199                     hr = pDevice->pDevice9If->StretchRect(pD3D9OldSurf, NULL, pD3D9Surf, NULL, D3DTEXF_NONE);
    2200                     Assert(hr == S_OK);
     2200                    VBOXVDBG_CHECK_SWAPCHAIN_SYNC(hr = pDevice->pDevice9If->StretchRect(pD3D9OldSurf, NULL, pD3D9Surf, NULL, D3DTEXF_NONE); Assert(hr == S_OK),
     2201                            pAlloc, pD3D9OldSurf, NULL, pAlloc, pD3D9Surf, NULL);
    22012202                }
    22022203            }
     
    22562257            pSwapchain->bRTFbCopyUpToDate = TRUE;
    22572258# ifndef VBOX_WINE_WITH_FAST_INTERSWAPCHAIN_BLT
    2258             tmpHr = pDevice->pDevice9If->StretchRect(pD3D9Bb, NULL, (IDirect3DSurface9*)vboxWddmSwapchainGetBb(pSwapchain)->pAlloc->pD3DIf, NULL, D3DTEXF_NONE);
     2259            VBOXVDBG_CHECK_SWAPCHAIN_SYNC(tmpHr = pDevice->pDevice9If->StretchRect(pD3D9Bb, NULL, (IDirect3DSurface9*)vboxWddmSwapchainGetBb(pSwapchain)->pAlloc->pD3DIf, NULL, D3DTEXF_NONE); Assert(tmpHr == S_OK),
     2260                    pAlloc, pD3D9Bb, NULL, pAlloc, (IDirect3DSurface9*)vboxWddmSwapchainGetBb(pSwapchain)->pAlloc->pD3DIf, NULL);
     2261
    22592262            if (FAILED(tmpHr))
    22602263            {
     
    23412344        if (pRT->pAlloc->enmD3DIfType != VBOXDISP_D3DIFTYPE_SURFACE)
    23422345            continue;
    2343         BOOL fHasSurf = !!pRT->pAlloc->pRc->aAllocations[0].pD3DIf;
     2346        BOOL fHasSurf = pRT->pAlloc->enmD3DIfType == VBOXDISP_D3DIFTYPE_SURFACE ?
     2347                !!pRT->pAlloc->pRc->aAllocations[i].pD3DIf
     2348                :
     2349                !!pRT->pAlloc->pRc->aAllocations[0].pD3DIf;
    23442350        if (!fForceCreate && !fHasSurf)
    23452351            continue;
     
    23952401            if (pD3D9OldSurf != pD3D9OldFb)
    23962402            {
    2397                 hr = pDevice9If->StretchRect(pD3D9OldSurf, NULL, pD3D9NewSurf, NULL, D3DTEXF_NONE);
    2398                 Assert(hr == S_OK);
     2403                VBOXVDBG_CHECK_SWAPCHAIN_SYNC(hr = pDevice9If->StretchRect(pD3D9OldSurf, NULL, pD3D9NewSurf, NULL, D3DTEXF_NONE); Assert(hr == S_OK),
     2404                        pRT->pAlloc, pD3D9OldSurf, NULL, pRT->pAlloc, pD3D9NewSurf, NULL);
    23992405            }
    24002406            else
     
    24102416            break;
    24112417        }
     2418
     2419        Assert(pRT->pAlloc->enmD3DIfType == VBOXDISP_D3DIFTYPE_SURFACE);
    24122420
    24132421        if (pRT->pAlloc->pD3DIf)
     
    28872895{
    28882896    HRESULT hr;
     2897
     2898    VBOXVDBG_DUMP_PRESENT_ENTER(pDevice, pSwapchain);
     2899
    28892900    if (!pSwapchain->fFlags.bRtReportingPresent)
    28902901    {
     
    29092920    }
    29102921
     2922    VBOXVDBG_DUMP_PRESENT_LEAVE(pDevice, pSwapchain);
     2923
    29112924    pSwapchain->bRTFbCopyUpToDate = FALSE;
    29122925    vboxWddmSwapchainFlip(pSwapchain);
     
    30443057    if (pDevice->pDevice9If)
    30453058        return pDevice->pDevice9If;
     3059
     3060#ifdef VBOXWDDMDISP_DEBUG
     3061    g_VBoxVDbgInternalDevice = pDevice;
     3062#endif
     3063
    30463064    HRESULT hr = vboxWddmD3DDeviceCreateDummy(pDevice);
    30473065    Assert(hr == S_OK);
     
    31743192        return hr;
    31753193    }
     3194
     3195#if 0
     3196    pCaps->RasterCaps |= D3DPRASTERCAPS_FOGRANGE;
     3197    pCaps->MaxTextureWidth = 8192; // 4096
     3198    pCaps->MaxTextureHeight = 8192; // 4096
     3199    pCaps->MaxVolumeExtent = 2048; // 512
     3200    pCaps->MaxTextureAspectRatio = 8192; // 4096
     3201    pCaps->MaxUserClipPlanes = 8; // 6
     3202    pCaps->MaxPointSize = 63.000000; // 64.000000
     3203#endif
    31763204
    31773205    vboxDispDumpD3DCAPS9(pCaps);
     
    53385366            bIssueCreateResource = true;
    53395367            Assert(pResource->SurfCount);
     5368
     5369#ifdef VBOXWDDMDISP_DEBUG
     5370            if (g_VBoxVDbgCfgForceDummyDevCreate)
     5371            {
     5372                VBOXDISP_D3DEV(pDevice);
     5373                Assert(!RTListIsEmpty(&pDevice->SwapchainList));
     5374                g_VBoxVDbgInternalRc = pRc;
     5375            }
     5376#endif
     5377
    53405378            if (RTListIsEmpty(&pDevice->SwapchainList))
    53415379            {
     
    55465584                    hr = vboxWddmSwapchainCreateIfForRc(pDevice, pRc, &pSwapchain);
    55475585                    Assert(hr == S_OK);
     5586                }
     5587                else
     5588                {
     5589                    VBOXVDBG_CREATE_CHECK_SWAPCHAIN();
    55485590                }
    55495591            }
     
    73247366    vboxVDbgPrint(("==> "__FUNCTION__"\n"));
    73257367
     7368#ifdef DEBUG_misha
     7369    DWORD dwVersion = 0;
     7370    DWORD dwMajorVersion = 0;
     7371    DWORD dwMinorVersion = 0;
     7372    dwVersion = GetVersion();
     7373    dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
     7374    dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
     7375
     7376    if (dwMajorVersion == 6 && dwMinorVersion <= 1 && VBOXVDBG_IS_DWM())
     7377    {
     7378        exit(0);
     7379        return E_FAIL;
     7380    }
     7381#endif
     7382
    73267383//    vboxDispLock();
    73277384
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.h

    r39515 r39819  
    3333/* maximum number of direct render targets to be used before
    3434 * switching to offscreen rendering */
    35 #ifdef DEBUG_misha
    36 #define VBOXWDDMDISP_MAX_DIRECT_RTS      0
     35#ifdef VBOXWDDMDISP_DEBUG
     36# define VBOXWDDMDISP_MAX_DIRECT_RTS      g_VBoxVDbgCfgMaxDirectRts
    3737#else
    38 #define VBOXWDDMDISP_MAX_DIRECT_RTS      3
     38# define VBOXWDDMDISP_MAX_DIRECT_RTS      3
    3939#endif
    4040
     
    139139            UINT bRtReportingPresent     : 1; /* use VBox extension method for performing present */
    140140            UINT bSwitchReportingPresent : 1; /* switch to use VBox extension method for performing present on next present */
    141             UINT Reserved                : 30;
     141            UINT Reserved                : 29;
    142142        };
    143143        uint32_t Value;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.cpp

    r39160 r39819  
    6060DWORD g_VBoxVDbgFDumpLock = VBOXWDDMDISP_DEBUG_DUMP_DEFAULT;
    6161DWORD g_VBoxVDbgFDumpUnlock = VBOXWDDMDISP_DEBUG_DUMP_DEFAULT;
     62DWORD g_VBoxVDbgFDumpPresentEnter = VBOXWDDMDISP_DEBUG_DUMP_DEFAULT;
     63DWORD g_VBoxVDbgFDumpPresentLeave = VBOXWDDMDISP_DEBUG_DUMP_DEFAULT;
     64DWORD g_VBoxVDbgFDumpScSync = VBOXWDDMDISP_DEBUG_DUMP_DEFAULT;
    6265
    6366DWORD g_VBoxVDbgFBreakShared = VBOXWDDMDISP_DEBUG_DUMP_DEFAULT;
     
    6770DWORD g_VBoxVDbgFCheckBlt = 0;
    6871DWORD g_VBoxVDbgFCheckTexBlt = 0;
     72DWORD g_VBoxVDbgFCheckScSync = 0;
    6973
    7074DWORD g_VBoxVDbgFSkipCheckTexBltDwmWndUpdate = 1;
     
    8084
    8185DWORD g_VBoxVDbgPid = 0;
     86
     87DWORD g_VBoxVDbgCfgMaxDirectRts = 0;
     88DWORD g_VBoxVDbgCfgForceDummyDevCreate = 0;
     89
     90PVBOXWDDMDISP_DEVICE g_VBoxVDbgInternalDevice = NULL;
     91PVBOXWDDMDISP_RESOURCE g_VBoxVDbgInternalRc = NULL;
     92
     93DWORD g_VBoxVDbgCfgCreateSwapchainOnDdiOnce = 0;
    8294
    8395void vboxDispLogDbgPrintF(char * szString, ...)
     
    232244    vboxVDbgDoDumpSurfRect(pPrefix, pSurf, NULL, pSuffix, true);
    233245}
     246
     247VOID vboxVDbgDoDumpBb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix)
     248{
     249    IDirect3DSurface9 *pBb = NULL;
     250    HRESULT hr = pSwapchainIf->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &pBb);
     251    Assert(hr == S_OK);
     252    if (FAILED(hr))
     253    {
     254        return;
     255    }
     256
     257    Assert(pBb);
     258    vboxVDbgDoDumpSurf(pPrefix, pBb, pSuffix);
     259    pBb->Release();
     260}
     261
     262VOID vboxVDbgDoDumpFb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix)
     263{
     264    IDirect3DSurface9 *pBb = NULL;
     265    HRESULT hr = pSwapchainIf->GetBackBuffer(-1, D3DBACKBUFFER_TYPE_MONO, &pBb);
     266    Assert(hr == S_OK);
     267    if (FAILED(hr))
     268    {
     269        return;
     270    }
     271
     272    Assert(pBb);
     273    vboxVDbgDoDumpSurf(pPrefix, pBb, pSuffix);
     274    pBb->Release();
     275}
     276
    234277
    235278#define VBOXVDBG_STRCASE(_t) \
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.h

    r39606 r39819  
    5656extern DWORD g_VBoxVDbgFDumpLock;
    5757extern DWORD g_VBoxVDbgFDumpUnlock;
     58extern DWORD g_VBoxVDbgFDumpPresentEnter;
     59extern DWORD g_VBoxVDbgFDumpPresentLeave;
     60extern DWORD g_VBoxVDbgFDumpScSync;
    5861
    5962extern DWORD g_VBoxVDbgFBreakShared;
     
    6366extern DWORD g_VBoxVDbgFCheckBlt;
    6467extern DWORD g_VBoxVDbgFCheckTexBlt;
     68extern DWORD g_VBoxVDbgFCheckScSync;
    6569
    6670extern DWORD g_VBoxVDbgFSkipCheckTexBltDwmWndUpdate;
     
    7579
    7680extern LONG g_VBoxVDbgFIsDwm;
     81
     82extern DWORD g_VBoxVDbgCfgMaxDirectRts;
     83extern DWORD g_VBoxVDbgCfgForceDummyDevCreate;
     84
     85extern struct VBOXWDDMDISP_DEVICE *g_VBoxVDbgInternalDevice;
     86extern struct VBOXWDDMDISP_RESOURCE *g_VBoxVDbgInternalRc;
     87
     88extern DWORD g_VBoxVDbgCfgCreateSwapchainOnDdiOnce;
    7789
    7890#endif
     
    185197VOID vboxVDbgDoDumpTex(const char * pPrefix, IDirect3DBaseTexture9 *pTexBase, const char * pSuffix);
    186198VOID vboxVDbgDoDumpRt(const char * pPrefix, struct VBOXWDDMDISP_DEVICE *pDevice, const char * pSuffix);
     199VOID vboxVDbgDoDumpBb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix);
     200VOID vboxVDbgDoDumpFb(const char * pPrefix, IDirect3DSwapChain9 *pSwapchainIf, const char * pSuffix);
    187201
    188202void vboxVDbgDoPrintRect(const char * pPrefix, const RECT *pRect, const char * pSuffix);
     
    366380    } while (0)
    367381
    368 #define VBOXVDBG_DUMP_BLT_ENTER(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) do { \
    369         if (VBOXVDBG_IS_DUMP_ALLOWED(Blt) \
     382#define VBOXVDBG_DUMP_STRETCH_RECT(_type, _str, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) do { \
     383        if (VBOXVDBG_IS_DUMP_ALLOWED(_type) \
    370384                || VBOXVDBG_IS_DUMP_SHARED_ALLOWED((_pSrcAlloc)->pRc) \
    371385                || VBOXVDBG_IS_DUMP_SHARED_ALLOWED((_pDstAlloc)->pRc) \
    372386                ) \
    373387        { \
    374             if ((_pSrcAlloc) == (_pDstAlloc) && !memcmp((_pSrcRect), (_pDstRect), sizeof (_pDstRect))) \
     388            if ((_pSrcSurf) == (_pDstSurf) \
     389                    && ( ((_pSrcRect) && (_pDstRect) && !memcmp((_pSrcRect), (_pDstRect), sizeof (_pDstRect))) \
     390                            || ((_pSrcRect) == (_pDstRect)) \
     391                            ) ) \
    375392            { \
    376                 vboxVDbgPrint(("BLT_ENTER: skipping dump of the same rect for one surfcace\n")); \
     393                vboxVDbgPrint((_str #_type ": skipping dump of the same rect for one surfcace\n")); \
    377394            } \
    378395            else \
    379396            { \
    380                 vboxVDbgDoDumpRcRectByAlloc("==>"__FUNCTION__" Src: ", (_pSrcAlloc), (_pSrcSurf), (_pSrcRect), "\n"); \
    381                 vboxVDbgDoDumpRcRectByAlloc("==>"__FUNCTION__" Dst: ", (_pDstAlloc), (_pDstSurf), (_pDstRect), "\n"); \
    382             } \
    383         } \
    384     } while (0)
    385 
    386 #define VBOXVDBG_DUMP_BLT_LEAVE(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) do { \
    387         if (VBOXVDBG_DUMP_RECTS_FORCED() \
    388                 || VBOXVDBG_IS_DUMP_ALLOWED(Blt) \
    389                 || VBOXVDBG_IS_DUMP_SHARED_ALLOWED((_pSrcAlloc)->pRc) \
    390                 || VBOXVDBG_IS_DUMP_SHARED_ALLOWED((_pDstAlloc)->pRc) \
    391                 ) \
    392         { \
    393             if ((_pSrcAlloc) == (_pDstAlloc) && !memcmp((_pSrcRect), (_pDstRect), sizeof (_pDstRect))) \
    394             { \
    395                 vboxVDbgPrint(("BLT_LEAVE: skipping dump of the same rect for one surfcace\n")); \
    396             } \
    397             else \
    398             { \
    399                 vboxVDbgDoDumpRcRectByAlloc("<=="__FUNCTION__" Src: ", (_pSrcAlloc), (_pSrcSurf), (_pSrcRect), "\n"); \
    400                 vboxVDbgDoDumpRcRectByAlloc("<=="__FUNCTION__" Dst: ", (_pDstAlloc), (_pDstSurf), (_pDstRect), "\n"); \
    401             } \
    402         } \
    403     } while (0)
     397                vboxVDbgDoDumpRcRectByAlloc(_str __FUNCTION__" Src: ", (_pSrcAlloc), (_pSrcSurf), (_pSrcRect), "\n"); \
     398                vboxVDbgDoDumpRcRectByAlloc(_str __FUNCTION__" Dst: ", (_pDstAlloc), (_pDstSurf), (_pDstRect), "\n"); \
     399            } \
     400        } \
     401    } while (0)
     402
     403#define VBOXVDBG_DUMP_BLT_ENTER(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) \
     404    VBOXVDBG_DUMP_STRETCH_RECT(Blt, "==>", _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect)
     405
     406#define VBOXVDBG_DUMP_BLT_LEAVE(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) \
     407        VBOXVDBG_DUMP_STRETCH_RECT(Blt, "<==", _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect)
     408
     409#define VBOXVDBG_DUMP_SWAPCHAIN_SYNC_ENTER(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) \
     410        VBOXVDBG_DUMP_STRETCH_RECT(ScSync, "==>", _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect)
     411
     412#define VBOXVDBG_DUMP_SWAPCHAIN_SYNC_LEAVE(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) \
     413        VBOXVDBG_DUMP_STRETCH_RECT(ScSync, "<==", _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect)
    404414
    405415#define VBOXVDBG_IS_SKIP_DWM_WND_UPDATE(_pSrcRc, _pSrcRect, _pDstRc, _pDstPoint) ( \
     
    448458    } while (0)
    449459
    450 #define VBOXVDBG_CHECK_BLT(_opBlt, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) do { \
    451         if (VBOXVDBG_IS_CHECK_ALLOWED(Blt)) { \
     460#define VBOXVDBG_CHECK_STRETCH_RECT(_type, _op, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) do { \
     461        if (VBOXVDBG_IS_CHECK_ALLOWED(_type)) { \
    452462            VBOXVDBG_CHECK_RECTS(\
    453                     VBOXVDBG_DUMP_BLT_ENTER(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect); \
    454                     _opBlt ,\
    455                     VBOXVDBG_DUMP_BLT_LEAVE(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect), \
    456                     "Blt", \
     463                    VBOXVDBG_DUMP_STRETCH_RECT(_type, "==>", _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect); \
     464                    _op ,\
     465                    VBOXVDBG_DUMP_STRETCH_RECT(_type, "<==", _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect), \
     466                    #_type , \
    457467                    _pDstAlloc->pRc, _pDstAlloc->iAlloc, _pSrcAlloc->pRc, _pSrcAlloc->iAlloc, _pDstRect, _pSrcRect); \
    458468        } \
     
    460470        { \
    461471            VBOXVDBG_DUMP_RECTS_INIT(0); \
    462             VBOXVDBG_DUMP_BLT_ENTER(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect); \
    463             _opBlt;\
    464             VBOXVDBG_DUMP_BLT_LEAVE(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect); \
    465         } \
    466     } while (0)
     472            VBOXVDBG_DUMP_STRETCH_RECT(_type, "==>", _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect); \
     473            _op;\
     474            VBOXVDBG_DUMP_STRETCH_RECT(_type, "<==", _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect); \
     475        } \
     476    } while (0)
     477
     478#define VBOXVDBG_CHECK_BLT(_opBlt, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) \
     479        VBOXVDBG_CHECK_STRETCH_RECT(Blt, _opBlt, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect)
     480
     481#define VBOXVDBG_CHECK_SWAPCHAIN_SYNC(_op, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) \
     482        VBOXVDBG_CHECK_STRETCH_RECT(ScSync, _op, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect)
    467483
    468484#define VBOXVDBG_DUMP_SYNC_RT(_pBbSurf) do { \
     
    472488        } \
    473489    } while (0)
     490
     491#define VBOXVDBG_DUMP_PRESENT_ENTER(_pDevice, _pSwapchain) do { \
     492        if (VBOXVDBG_IS_DUMP_ALLOWED(PresentEnter)) { \
     493            if (!(_pSwapchain)->fFlags.bRtReportingPresent) { \
     494                vboxVDbgDoDumpBb("==>"__FUNCTION__" Bb:\n", (_pSwapchain)->pSwapChainIf, "\n"); \
     495            } \
     496            else  { \
     497                PVBOXWDDMDISP_ALLOCATION pCurBb = vboxWddmSwapchainGetBb((_pSwapchain))->pAlloc; \
     498                IDirect3DSurface9 *pSurf; \
     499                HRESULT hr = vboxWddmSwapchainSurfGet(_pDevice, _pSwapchain, pCurBb, &pSurf); \
     500                Assert(hr == S_OK); \
     501                vboxVDbgDoDumpSurf("== "__FUNCTION__" Bb:\n", pSurf, "\n"); \
     502                pSurf->Release(); \
     503            } \
     504        } \
     505    } while (0)
     506
     507#define VBOXVDBG_DUMP_PRESENT_LEAVE(_pDevice, _pSwapchain) do { \
     508        if (VBOXVDBG_IS_DUMP_ALLOWED(PresentLeave)) { \
     509            if (!(_pSwapchain)->fFlags.bRtReportingPresent) { \
     510                vboxVDbgDoDumpFb("<=="__FUNCTION__" Fb:\n", (_pSwapchain)->pSwapChainIf, "\n"); \
     511            } \
     512            else  { \
     513                vboxVDbgPrint(("PRESENT_LEAVE: unsupported for Rt Reporting mode\n")); \
     514            } \
     515        } \
     516    } while (0)
     517
    474518
    475519#define VBOXVDBG_DUMP_FLUSH(_pDevice) do { \
     
    496540        } \
    497541    } while (0)
     542
     543
     544#define VBOXVDBG_CREATE_CHECK_SWAPCHAIN() do { \
     545            if (g_VBoxVDbgCfgCreateSwapchainOnDdiOnce && g_VBoxVDbgInternalRc) { \
     546                PVBOXWDDMDISP_SWAPCHAIN pSwapchain; \
     547                HRESULT hr = vboxWddmSwapchainCreateIfForRc(g_VBoxVDbgInternalDevice, g_VBoxVDbgInternalRc, &pSwapchain); \
     548                Assert(hr == S_OK); \
     549                g_VBoxVDbgInternalRc = NULL; \
     550                g_VBoxVDbgCfgCreateSwapchainOnDdiOnce = 0; \
     551            } \
     552        } while (0)
    498553
    499554#else
     
    509564#define VBOXVDBG_DUMP_LOCK_ST(_pData) do { } while (0)
    510565#define VBOXVDBG_DUMP_UNLOCK_ST(_pData) do { } while (0)
     566#define VBOXVDBG_DUMP_PRESENT_ENTER(_pDevice, _pSwapchain) do { } while (0)
     567#define VBOXVDBG_DUMP_PRESENT_LEAVE(_pDevice, _pSwapchain) do { } while (0)
    511568#define VBOXVDBG_BREAK_SHARED(_pRc) do { } while (0)
    512569#define VBOXVDBG_BREAK_DDI() do { } while (0)
     
    515572#define VBOXVDBG_CHECK_TEXBLT(_opTexBlt, _pSrcRc, _pSrcRect, _pDstRc, _pDstPoint) do { _opTexBlt; } while (0)
    516573#define VBOXVDBG_ASSERT_IS_DWM(_bDwm) do { } while (0)
     574#define VBOXVDBG_CHECK_SWAPCHAIN_SYNC(_op, _pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) do { _op; } while (0)
     575#define VBOXVDBG_CREATE_CHECK_SWAPCHAIN() do { } while (0)
    517576#endif
    518577
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/directx.c

    r39602 r39819  
    885885}
    886886
     887#ifdef VBOX_WITH_WDDM
     888static BOOL match_mesa_nvidia(const struct wined3d_gl_info *gl_info, const char *gl_renderer,
     889        enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
     890{
     891    if (card_vendor != HW_VENDOR_NVIDIA) return FALSE;
     892    if (gl_vendor != GL_VENDOR_MESA) return FALSE;
     893    return TRUE;
     894}
     895
     896static void quirk_no_shader_3(struct wined3d_gl_info *gl_info)
     897{
     898    int vs_selected_mode, ps_selected_mode;
     899    select_shader_mode(gl_info, &ps_selected_mode, &vs_selected_mode);
     900    if (vs_selected_mode != SHADER_GLSL && ps_selected_mode != SHADER_GLSL)
     901        return;
     902
     903    gl_info->limits.arb_ps_instructions = 512;
     904}
     905#endif
     906
    887907struct driver_quirk
    888908{
     
    974994        "Fullsize blit"
    975995    },
     996#ifdef VBOX_WITH_WDDM
     997    {
     998            match_mesa_nvidia,
     999            quirk_no_shader_3,
     1000            "disable shader 3 support"
     1001    },
     1002#endif
    9761003};
    9771004
     
    19431970{
    19441971    FIXME_(d3d_caps)("Card selection not handled for Mesa Nouveau driver\n");
     1972#ifndef VBOX_WITH_WDDM
    19451973    if (WINE_D3D9_CAPABLE(gl_info)) return CARD_NVIDIA_GEFORCEFX_5600;
     1974#else
     1975    /* tmp work around to disable quirk_no_np2 quirk for mesa drivers */
     1976    if (WINE_D3D9_CAPABLE(gl_info)) return CARD_NVIDIA_GEFORCE_6200;
     1977#endif
    19461978    if (WINE_D3D8_CAPABLE(gl_info)) return CARD_NVIDIA_GEFORCE3;
    19471979    if (WINE_D3D7_CAPABLE(gl_info)) return CARD_NVIDIA_GEFORCE;
     
    20562088     * them a good generic choice. */
    20572089    *card_vendor = HW_VENDOR_NVIDIA;
     2090#ifndef VBOX_WITH_WDDM
    20582091    if (WINE_D3D9_CAPABLE(gl_info)) return CARD_NVIDIA_GEFORCEFX_5600;
     2092#else
     2093    /* tmp work around to disable quirk_no_np2 quirk for not-recognized drivers */
     2094    if (WINE_D3D9_CAPABLE(gl_info)) return CARD_NVIDIA_GEFORCE_6200;
     2095#endif
     2096
    20592097    if (WINE_D3D8_CAPABLE(gl_info)) return CARD_NVIDIA_GEFORCE3;
    20602098    if (WINE_D3D7_CAPABLE(gl_info)) return CARD_NVIDIA_GEFORCE;
Note: See TracChangeset for help on using the changeset viewer.

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