Lines Matching defs:pRc

188 static HRESULT vboxDispD3DIfSurfSynchMem(PVBOXWDDMDISP_RESOURCE pRc)
190 if (pRc->RcDesc.enmPool != D3DDDIPOOL_SYSTEMMEM)
195 for (UINT i = 0; i < pRc->cAllocations; ++i)
198 HRESULT hr = VBoxD3DIfLockRect(pRc, i, &Rect, NULL, D3DLOCK_DISCARD);
205 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[i];
210 hr = VBoxD3DIfUnlockRect(pRc, i);
305 HRESULT VBoxD3DIfLockRect(PVBOXWDDMDISP_RESOURCE pRc, UINT iAlloc,
311 Assert(!pRc->aAllocations[iAlloc].LockInfo.cLocks);
312 Assert(pRc->cAllocations > iAlloc);
313 switch (pRc->aAllocations[0].enmD3DIfType)
317 IDirect3DSurface9 *pD3DIfSurf = (IDirect3DSurface9*)pRc->aAllocations[iAlloc].pD3DIf;
325 IDirect3DTexture9 *pD3DIfTex = (IDirect3DTexture9*)pRc->aAllocations[0].pD3DIf;
333 IDirect3DCubeTexture9 *pD3DIfCubeTex = (IDirect3DCubeTexture9*)pRc->aAllocations[0].pD3DIf;
335 hr = pD3DIfCubeTex->LockRect(VBOXDISP_CUBEMAP_INDEX_TO_FACE(pRc, iAlloc),
336 VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, iAlloc), pLockedRect, pRect, fLockFlags);
342 IDirect3DVertexBuffer9 *pD3D9VBuf = (IDirect3DVertexBuffer9*)pRc->aAllocations[iAlloc].pD3DIf;
348 pLockedRect->Pitch = pRc->aAllocations[iAlloc].SurfDesc.pitch;
353 IDirect3DIndexBuffer9 *pD3D9IBuf = (IDirect3DIndexBuffer9*)pRc->aAllocations[iAlloc].pD3DIf;
359 pLockedRect->Pitch = pRc->aAllocations[iAlloc].SurfDesc.pitch;
363 WARN(("uknown if type %d", pRc->aAllocations[0].enmD3DIfType));
369 HRESULT VBoxD3DIfUnlockRect(PVBOXWDDMDISP_RESOURCE pRc, UINT iAlloc)
372 Assert(pRc->cAllocations > iAlloc);
373 switch (pRc->aAllocations[0].enmD3DIfType)
377 IDirect3DSurface9 *pD3DIfSurf = (IDirect3DSurface9*)pRc->aAllocations[iAlloc].pD3DIf;
385 IDirect3DTexture9 *pD3DIfTex = (IDirect3DTexture9*)pRc->aAllocations[0].pD3DIf;
393 IDirect3DCubeTexture9 *pD3DIfCubeTex = (IDirect3DCubeTexture9*)pRc->aAllocations[0].pD3DIf;
395 hr = pD3DIfCubeTex->UnlockRect(VBOXDISP_CUBEMAP_INDEX_TO_FACE(pRc, iAlloc),
396 VBOXDISP_CUBEMAP_INDEX_TO_LEVEL(pRc, iAlloc));
402 IDirect3DVertexBuffer9 *pD3D9VBuf = (IDirect3DVertexBuffer9*)pRc->aAllocations[iAlloc].pD3DIf;
410 IDirect3DIndexBuffer9 *pD3D9IBuf = (IDirect3DIndexBuffer9*)pRc->aAllocations[iAlloc].pD3DIf;
417 WARN(("uknown if type %d", pRc->aAllocations[0].enmD3DIfType));
424 HRESULT VBoxD3DIfCreateForRc(struct VBOXWDDMDISP_RESOURCE *pRc)
426 PVBOXWDDMDISP_DEVICE pDevice = pRc->pDevice;
430 if (VBOXWDDMDISP_IS_TEXTURE(pRc->RcDesc.fFlags))
432 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[0];
438 if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM)
440 pavClientMem = (void**)RTMemAlloc(sizeof (pavClientMem[0]) * pRc->cAllocations);
444 for (UINT i = 0; i < pRc->cAllocations; ++i)
446 Assert(pRc->aAllocations[i].pvMem);
447 pavClientMem[i] = pRc->aAllocations[i].pvMem;
455 if (!pRc->RcDesc.fFlags.CubeMap)
457 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[0];
460 for (UINT i = 1; i < pRc->cAllocations; ++i)
464 pAlloc = &pRc->aAllocations[i];
473 if (pRc->RcDesc.fFlags.CubeMap)
476 || (pRc->cAllocations%6!=0))
479 pAllocation->SurfDesc.width, pAllocation->SurfDesc.height, pRc->cAllocations));
486 VBOXDISP_CUBEMAP_LEVELS_COUNT(pRc),
487 vboxDDI2D3DUsage(pRc->RcDesc.fFlags),
488 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
489 vboxDDI2D3DPool(pRc->RcDesc.enmPool),
494 pRc->RcDesc.fFlags.SharedResource ? &hSharedHandle : NULL,
502 else if (pRc->RcDesc.fFlags.Volume)
508 pRc->cAllocations,
509 vboxDDI2D3DUsage(pRc->RcDesc.fFlags),
510 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
511 vboxDDI2D3DPool(pRc->RcDesc.enmPool),
516 pRc->RcDesc.fFlags.SharedResource ? &hSharedHandle : NULL,
528 pRc->cAllocations,
529 vboxDDI2D3DUsage(pRc->RcDesc.fFlags),
530 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
531 vboxDDI2D3DPool(pRc->RcDesc.enmPool),
536 pRc->RcDesc.fFlags.SharedResource ? &hSharedHandle : NULL,
549 Assert(!!(pRc->RcDesc.fFlags.SharedResource) == !!(hSharedHandle));
551 for (UINT i = 0; i < pRc->cAllocations; ++i)
553 PVBOXWDDMDISP_ALLOCATION pAlloc = &pRc->aAllocations[i];
566 else if (pRc->RcDesc.fFlags.RenderTarget || pRc->RcDesc.fFlags.Primary)
568 for (UINT i = 0; i < pRc->cAllocations; ++i)
570 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
581 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
582 vboxDDI2D3DMultiSampleType(pRc->RcDesc.enmMultisampleType),
583 pRc->RcDesc.MultisampleQuality,
584 !pRc->RcDesc.fFlags.NotLockable /* BOOL Lockable */,
589 pRc->RcDesc.fFlags.SharedResource ? &hSharedHandle : NULL
598 if (pRc->cAllocations != 1)
600 WARN(("unexpected config: more than one (%d) shared primary for rc", pRc->cAllocations));
641 Assert(!!(pRc->RcDesc.fFlags.SharedResource) == !!(hSharedHandle));
653 pRc->aAllocations[j].pD3DIf->Release();
660 if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM)
663 vboxDispD3DIfSurfSynchMem(pRc);
667 else if (pRc->RcDesc.fFlags.ZBuffer)
669 for (UINT i = 0; i < pRc->cAllocations; ++i)
671 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
675 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
676 vboxDDI2D3DMultiSampleType(pRc->RcDesc.enmMultisampleType),
677 pRc->RcDesc.MultisampleQuality,
692 pRc->aAllocations[j].pD3DIf->Release();
700 if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM)
702 vboxDispD3DIfSurfSynchMem(pRc);
706 else if (pRc->RcDesc.fFlags.VertexBuffer)
708 for (UINT i = 0; i < pRc->cAllocations; ++i)
710 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
713 vboxDDI2D3DUsage(pRc->RcDesc.fFlags)
718 pRc->RcDesc.Fvf,
719 vboxDDI2D3DPool(pRc->RcDesc.enmPool),
733 pRc->aAllocations[j].pD3DIf->Release();
741 if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM)
743 vboxDispD3DIfSurfSynchMem(pRc);
747 else if (pRc->RcDesc.fFlags.IndexBuffer)
749 for (UINT i = 0; i < pRc->cAllocations; ++i)
751 PVBOXWDDMDISP_ALLOCATION pAllocation = &pRc->aAllocations[i];
754 vboxDDI2D3DUsage(pRc->RcDesc.fFlags),
755 vboxDDI2D3DFormat(pRc->RcDesc.enmFormat),
756 vboxDDI2D3DPool(pRc->RcDesc.enmPool),
771 pRc->aAllocations[j].pD3DIf->Release();
779 if (pRc->RcDesc.enmPool == D3DDDIPOOL_SYSTEMMEM)
781 vboxDispD3DIfSurfSynchMem(pRc);
788 WARN(("unsupported rc flags, %d", pRc->RcDesc.fFlags.Value));
794 VOID VBoxD3DIfFillPresentParams(D3DPRESENT_PARAMETERS *pParams, PVBOXWDDMDISP_RESOURCE pRc, UINT cRTs)
798 pParams->BackBufferWidth = pRc->aAllocations[0].SurfDesc.width;
799 pParams->BackBufferHeight = pRc->aAllocations[0].SurfDesc.height;
800 pParams->BackBufferFormat = vboxDDI2D3DFormat(pRc->aAllocations[0].SurfDesc.format);
802 pParams->MultiSampleType = vboxDDI2D3DMultiSampleType(pRc->RcDesc.enmMultisampleType);
803 pParams->MultiSampleQuality = pRc->RcDesc.MultisampleQuality;
809 if (pRc->RcDesc.fFlags.DiscardRenderTarget)
880 struct VBOXWDDMDISP_RESOURCE *pRc = pAlloc->pRc;
881 PVBOXWDDMDISP_DEVICE pDevice = pRc->pDevice;
912 struct VBOXWDDMDISP_RESOURCE *pRc = pAlloc->pRc;
913 PVBOXWDDMDISP_DEVICE pDevice = pRc->pDevice;
915 HRESULT hr = VBoxD3DIfCreateForRc(pRc);
924 Assert(pAlloc->pRc->RcDesc.fFlags.SharedResource);
926 hr = VBoxD3DIfSurfGet(pRc, pAlloc->iAlloc, &pSurfIf);
948 for (UINT i = 0; i < pRc->cAllocations; ++i)
950 PVBOXWDDMDISP_ALLOCATION pCurAlloc = &pRc->aAllocations[i];
960 hr = VBoxD3DIfCreateForRc(pRc);
967 hr = VBoxD3DIfSurfGet(pRc, pAlloc->iAlloc, &pSurfIf);