Changeset 39900 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/disp
- Timestamp:
- Jan 27, 2012 3:47:30 PM (13 years ago)
- 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 3580 3580 Assert(0); 3581 3581 } 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 3582 3607 } 3583 3608 else 3609 { 3584 3610 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 } 3585 3631 3586 3632 HRESULT hr = pDevice9If->SetTexture(Stage, pD3DIfTex); … … 3703 3749 HRESULT hr = S_OK; 3704 3750 3751 VBOXVDBG_BREAK_SHARED_DEV(pDevice); 3752 3705 3753 VBOXVDBG_DUMP_DRAWPRIM_ENTER(pDevice); 3706 3754 … … 3776 3824 3777 3825 IDirect3DDevice9 * pDevice9If = VBOXDISP_D3DEV(pDevice); 3826 3827 VBOXVDBG_BREAK_SHARED_DEV(pDevice); 3828 3778 3829 VBOXVDBG_DUMP_DRAWPRIM_ENTER(pDevice); 3779 3830 … … 3884 3935 hr = pDevice9If->DrawPrimitive(pData->PrimitiveType, pData->FirstVertexOffset, pData->PrimitiveCount); 3885 3936 #else 3937 VBOXVDBG_BREAK_SHARED_DEV(pDevice); 3938 3886 3939 VBOXVDBG_DUMP_DRAWPRIM_ENTER(pDevice); 3887 3940 … … 6085 6138 IDirect3DSurface9 *pDstSurfIf = NULL; 6086 6139 Assert(!pDstSwapchain || vboxWddmSwapchainGetFb(pDstSwapchain)->pAlloc != pDstAlloc || vboxWddmSwapchainNumRTs(pDstSwapchain) == 1); 6140 6141 VBOXVDBG_BREAK_SHARED(pSrcRc); 6142 VBOXVDBG_BREAK_SHARED(pDstRc); 6143 6087 6144 hr = vboxWddmSurfGet(pDstRc, pData->DstSubResourceIndex, &pDstSurfIf); 6088 6145 Assert(hr == S_OK); … … 7356 7413 vboxVDbgPrint(("==> "__FUNCTION__"\n")); 7357 7414 7358 #if def DEBUG_misha7415 #if 0 //def DEBUG_misha 7359 7416 DWORD dwVersion = 0; 7360 7417 DWORD dwMajorVersion = 0; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispD3D.h
r39819 r39900 31 31 #define VBOXWDDMDISP_MAX_VERTEX_STREAMS 16 32 32 #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 33 40 /* maximum number of direct render targets to be used before 34 41 * switching to offscreen rendering */ … … 195 202 /* no lock is needed for this since we're guaranteed the per-device calls are not reentrant */ 196 203 RTLISTANCHOR DirtyAllocList; 204 205 #ifdef VBOXWDDMDISP_DEBUG 206 UINT cSamplerTextures; 207 struct VBOXWDDMDISP_RESOURCE *aSamplerTextures[VBOXWDDMDISP_TOTAL_SAMPLERS]; 208 #endif 197 209 198 210 UINT cRTs; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/VBoxDispDbg.h
r39819 r39900 314 314 if (pRtVar->pRc->RcDesc.fFlags.SharedResource) { *(_pIsShared) = TRUE; break; } \ 315 315 } \ 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 } \ 316 324 } while (0) 317 325 … … 321 329 { \ 322 330 *(_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); \ 323 339 } \ 324 340 } while (0) … … 342 358 vboxVDbgDoDumpRt("<=="__FUNCTION__": RenderTarget Dump\n", (_pDevice), "\n"); \ 343 359 }\ 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 } \ 344 369 } while (0) 345 370 … … 567 592 #define VBOXVDBG_DUMP_PRESENT_LEAVE(_pDevice, _pSwapchain) do { } while (0) 568 593 #define VBOXVDBG_BREAK_SHARED(_pRc) do { } while (0) 594 #define VBOXVDBG_BREAK_SHARED_DEV(_pDevice) do { } while (0) 569 595 #define VBOXVDBG_BREAK_DDI() do { } while (0) 570 596 #define VBOXVDBG_CHECK_SMSYNC(_pRc) do { } while (0)
Note:
See TracChangeset
for help on using the changeset viewer.