VirtualBox

Ignore:
Timestamp:
Jan 27, 2012 3:47:30 PM (13 years ago)
Author:
vboxsync
Message:

wddm/3d: debugging stuff

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm
Files:
3 edited

Legend:

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

    r39870 r39900  
    35803580            Assert(0);
    35813581        }
     3582
     3583#ifdef VBOXWDDMDISP_DEBUG
     3584        Assert(pDevice->cSamplerTextures < RT_ELEMENTS(pDevice->aSamplerTextures));
     3585        int idx = VBOXWDDMDISP_SAMPLER_IDX(Stage);
     3586        if (idx >= 0)
     3587        {
     3588            Assert(idx < RT_ELEMENTS(pDevice->aSamplerTextures));
     3589#ifdef DEBUG_misha
     3590            if (VBOXWDDMDISP_SAMPLER_IDX_IS_SPECIAL(Stage))
     3591            {
     3592                WARN(("non-zero special sampler index not tested!\n"));
     3593            }
     3594#endif
     3595            if (!pDevice->aSamplerTextures[idx])
     3596            {
     3597                ++pDevice->cSamplerTextures;
     3598            }
     3599            Assert(pDevice->cSamplerTextures < RT_ELEMENTS(pDevice->aSamplerTextures));
     3600            pDevice->aSamplerTextures[idx] = pRc;
     3601        }
     3602        else
     3603        {
     3604            WARN(("incorrect dampler index1! (%d)\n", Stage));
     3605        }
     3606#endif
    35823607    }
    35833608    else
     3609    {
    35843610        pD3DIfTex = NULL;
     3611#ifdef VBOXWDDMDISP_DEBUG
     3612        Assert(pDevice->cSamplerTextures < RT_ELEMENTS(pDevice->aSamplerTextures));
     3613        int idx = VBOXWDDMDISP_SAMPLER_IDX(Stage);
     3614        if (idx >= 0)
     3615        {
     3616            Assert(idx < RT_ELEMENTS(pDevice->aSamplerTextures));
     3617            if (pDevice->aSamplerTextures[idx])
     3618            {
     3619                Assert(pDevice->cSamplerTextures);
     3620                --pDevice->cSamplerTextures;
     3621            }
     3622            Assert(pDevice->cSamplerTextures < RT_ELEMENTS(pDevice->aSamplerTextures));
     3623            pDevice->aSamplerTextures[idx] = NULL;
     3624        }
     3625        else
     3626        {
     3627            WARN(("incorrect dampler index2! (%d)\n", Stage));
     3628        }
     3629#endif
     3630    }
    35853631
    35863632    HRESULT hr = pDevice9If->SetTexture(Stage, pD3DIfTex);
     
    37033749    HRESULT hr = S_OK;
    37043750
     3751    VBOXVDBG_BREAK_SHARED_DEV(pDevice);
     3752
    37053753    VBOXVDBG_DUMP_DRAWPRIM_ENTER(pDevice);
    37063754
     
    37763824
    37773825    IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice);
     3826
     3827    VBOXVDBG_BREAK_SHARED_DEV(pDevice);
     3828
    37783829    VBOXVDBG_DUMP_DRAWPRIM_ENTER(pDevice);
    37793830
     
    38843935    hr = pDevice9If->DrawPrimitive(pData->PrimitiveType, pData->FirstVertexOffset, pData->PrimitiveCount);
    38853936#else
     3937    VBOXVDBG_BREAK_SHARED_DEV(pDevice);
     3938
    38863939    VBOXVDBG_DUMP_DRAWPRIM_ENTER(pDevice);
    38873940
     
    60856138    IDirect3DSurface9 *pDstSurfIf = NULL;
    60866139    Assert(!pDstSwapchain || vboxWddmSwapchainGetFb(pDstSwapchain)->pAlloc != pDstAlloc || vboxWddmSwapchainNumRTs(pDstSwapchain) == 1);
     6140
     6141    VBOXVDBG_BREAK_SHARED(pSrcRc);
     6142    VBOXVDBG_BREAK_SHARED(pDstRc);
     6143
    60876144    hr = vboxWddmSurfGet(pDstRc, pData->DstSubResourceIndex, &pDstSurfIf);
    60886145    Assert(hr == S_OK);
     
    73567413    vboxVDbgPrint(("==> "__FUNCTION__"\n"));
    73577414
    7358 #ifdef DEBUG_misha
     7415#if 0 //def DEBUG_misha
    73597416    DWORD dwVersion = 0;
    73607417    DWORD dwMajorVersion = 0;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.h

    r39819 r39900  
    3131#define VBOXWDDMDISP_MAX_VERTEX_STREAMS 16
    3232#define VBOXWDDMDISP_MAX_SWAPCHAIN_SIZE 16
     33#ifdef VBOXWDDMDISP_DEBUG
     34# define VBOXWDDMDISP_MAX_TEX_SAMPLERS 16
     35# define VBOXWDDMDISP_TOTAL_SAMPLERS VBOXWDDMDISP_MAX_TEX_SAMPLERS + 5
     36# define VBOXWDDMDISP_SAMPLER_IDX_IS_SPECIAL(_i) ((_i) >= D3DDMAPSAMPLER && (_i) <= D3DVERTEXTEXTURESAMPLER3)
     37# define VBOXWDDMDISP_SAMPLER_IDX_SPECIAL(_i) (VBOXWDDMDISP_SAMPLER_IDX_IS_SPECIAL(_i) ? (int)((_i) - D3DDMAPSAMPLER + VBOXWDDMDISP_MAX_TEX_SAMPLERS) : (int)-1)
     38# define VBOXWDDMDISP_SAMPLER_IDX(_i) (((_i) < VBOXWDDMDISP_MAX_TEX_SAMPLERS) ? (int)(_i) : VBOXWDDMDISP_SAMPLER_IDX_SPECIAL(_i))
     39#endif
    3340/* maximum number of direct render targets to be used before
    3441 * switching to offscreen rendering */
     
    195202    /* no lock is needed for this since we're guaranteed the per-device calls are not reentrant */
    196203    RTLISTANCHOR DirtyAllocList;
     204
     205#ifdef VBOXWDDMDISP_DEBUG
     206    UINT cSamplerTextures;
     207    struct VBOXWDDMDISP_RESOURCE *aSamplerTextures[VBOXWDDMDISP_TOTAL_SAMPLERS];
     208#endif
    197209
    198210    UINT cRTs;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.h

    r39819 r39900  
    314314            if (pRtVar->pRc->RcDesc.fFlags.SharedResource) { *(_pIsShared) = TRUE; break; } \
    315315        } \
     316        if (!*(_pIsShared)) { \
     317            for (UINT i = 0, iSampler = 0; iSampler < (_pDevice)->cSamplerTextures; ++i) { \
     318                Assert(i < RT_ELEMENTS((_pDevice)->aSamplerTextures)); \
     319                if (!(_pDevice)->aSamplerTextures[i]) continue; \
     320                *(_pIsShared) = TRUE; break; \
     321                ++iSampler; \
     322            } \
     323        } \
    316324    } while (0)
    317325
     
    321329        { \
    322330            *(_pIsAllowed) = VBOXVDBG_IS_DUMP_ALLOWED(Shared); \
     331        } \
     332    } while (0)
     333
     334#define VBOXVDBG_IS_BREAK_SHARED_ALLOWED_DEV(_pDevice, _pIsAllowed) do { \
     335        VBOXVDBG_DEV_CHECK_SHARED(_pDevice, _pIsAllowed); \
     336        if (*(_pIsAllowed)) \
     337        { \
     338            *(_pIsAllowed) = VBOXVDBG_IS_BREAK_ALLOWED(Shared); \
    323339        } \
    324340    } while (0)
     
    342358            vboxVDbgDoDumpRt("<=="__FUNCTION__": RenderTarget Dump\n", (_pDevice), "\n"); \
    343359        }\
     360    } while (0)
     361
     362#define VBOXVDBG_BREAK_SHARED_DEV(_pDevice)  do { \
     363        BOOL fBreakShaded = FALSE; \
     364        VBOXVDBG_IS_BREAK_SHARED_ALLOWED_DEV(_pDevice, &fBreakShaded); \
     365        if (fBreakShaded) { \
     366            vboxVDbgPrint((__FUNCTION__"== Break on shared access\n")); \
     367            AssertFailed(); \
     368        } \
    344369    } while (0)
    345370
     
    567592#define VBOXVDBG_DUMP_PRESENT_LEAVE(_pDevice, _pSwapchain) do { } while (0)
    568593#define VBOXVDBG_BREAK_SHARED(_pRc) do { } while (0)
     594#define VBOXVDBG_BREAK_SHARED_DEV(_pDevice) do { } while (0)
    569595#define VBOXVDBG_BREAK_DDI() do { } while (0)
    570596#define VBOXVDBG_CHECK_SMSYNC(_pRc) do { } while (0)
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