Lines Matching defs:pState
472 PVMSVGA3DSTATE pState;
477 pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
480 rc = RTSemEventCreate(&pState->WndRequestSem);
488 rc = RTThreadCreate(&pState->pWindowThread, vmsvga3dWindowThread, pState->WndRequestSem, 0, RTTHREADTYPE_GUI, 0, "VMSVGA3DWND");
500 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
504 if (pState->pD3D9)
508 pState->pD3D9 = Direct3DCreate9(D3D_SDK_VERSION);
509 AssertReturn(pState->pD3D9, VERR_INTERNAL_ERROR);
517 hr = pfnDirect3dCreate9Ex(D3D_SDK_VERSION, &pState->pD3D9);
520 hr = pState->pD3D9->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &pState->caps);
523 vmsvgaDumpD3DCaps(&pState->caps);
526 hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT,
538 pState->fSupportedSurfaceINTZ = true;
541 hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT,
553 pState->fSupportedSurfaceNULL = true;
557 hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT,
568 hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT,
578 hr = pState->pD3D9->CheckDeviceFormat(D3DADAPTER_DEFAULT,
593 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
597 for (uint32_t i = 0; i < pState->cSurfaces; i++)
599 if (pState->papSurfaces[i]->id != SVGA3D_INVALID_ID)
600 vmsvga3dSurfaceDestroy(pThis, pState->papSurfaces[i]->id);
604 for (uint32_t i = 0; i < pState->cContexts; i++)
606 if (pState->papContexts[i]->id != SVGA3D_INVALID_ID)
607 vmsvga3dContextDestroy(pThis, pState->papContexts[i]->id);
614 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
621 rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_EXIT, 0, 0);
624 RTSemEventDestroy(pState->WndRequestSem);
626 if (pState->pD3D9)
627 pState->pD3D9->Release();
733 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
734 AssertReturn(pState, VERR_NO_MEMORY);
735 D3DCAPS9 *pCaps = &pState->caps;
949 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_X8R8G8B8);
953 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A8R8G8B8);
957 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A2R10G10B10);
961 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_X1R5G5B5);
965 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A1R5G5B5);
969 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A4R4G4B4);
973 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A4R4G4B4);
977 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_L16);
981 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A8L8);
985 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A8);
989 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_L8);
993 *pu32Val = vmsvga3dGetDepthFormatSupport(pState, idx3dCaps, D3DFMT_D16);
998 *pu32Val = vmsvga3dGetDepthFormatSupport(pState, idx3dCaps, D3DFMT_D24S8);
1002 *pu32Val = vmsvga3dGetDepthFormatSupport(pState, idx3dCaps, D3DFMT_D24X8);
1011 *pu32Val = vmsvga3dGetDepthFormatSupport(pState, idx3dCaps, D3DFMT_D24FS8);
1015 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_DXT1);
1019 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_DXT2);
1023 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_DXT3);
1027 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_DXT4);
1031 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_DXT5);
1035 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_X8L8V8U8);
1039 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A2W10V10U10);
1043 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_V8U8);
1047 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_Q8W8V8U8);
1051 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_CxV8U8);
1055 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_R16F);
1059 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_R32F);
1063 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_G16R16F);
1067 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_G32R32F);
1071 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A16B16G16R16F);
1075 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A32B32G32R32F);
1079 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_V16U16);
1083 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_G16R16);
1087 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_A16B16G16R16);
1091 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_UYVY);
1095 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, D3DFMT_YUY2);
1099 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, (D3DFORMAT)MAKEFOURCC('N', 'V', '1', '2'));
1103 *pu32Val = vmsvga3dGetSurfaceFormatSupport(pState, idx3dCaps, (D3DFORMAT)MAKEFOURCC('A', 'Y', 'U', 'V'));
1390 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
1391 AssertReturn(pState, VERR_NO_MEMORY);
1402 if (sid >= pState->cSurfaces)
1406 void *pvNew = RTMemRealloc(pState->papSurfaces, sizeof(pState->papSurfaces[0]) * cNew);
1408 pState->papSurfaces = (PVMSVGA3DSURFACE *)pvNew;
1409 while (pState->cSurfaces < cNew)
1414 pState->papSurfaces[pState->cSurfaces++] = pSurface;
1417 pSurface = pState->papSurfaces[sid];
1616 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
1617 AssertReturn(pState, VERR_NO_MEMORY);
1619 if ( sid < pState->cSurfaces
1620 && pState->papSurfaces[sid]->id == sid)
1622 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid];
1627 for (uint32_t cid = 0; cid < pState->cContexts; cid++)
1629 PVMSVGA3DCONTEXT pContext = pState->papContexts[cid];
1759 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
1760 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid];
1764 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER);
1820 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
1827 AssertReturn(pState, VERR_NO_MEMORY);
1829 AssertReturn(sidSrc < pState->cSurfaces && pState->papSurfaces[sidSrc]->id == sidSrc, VERR_INVALID_PARAMETER);
1831 AssertReturn(sidDest < pState->cSurfaces && pState->papSurfaces[sidDest]->id == sidDest, VERR_INVALID_PARAMETER);
1833 pSurfaceSrc = pState->papSurfaces[sidSrc];
1834 pSurfaceDest = pState->papSurfaces[sidDest];
1853 if ( cid >= pState->cContexts
1854 || pState->papContexts[cid]->id != cid)
1859 pContext = pState->papContexts[cid];
1875 if ( cid >= pState->cContexts
1876 || pState->papContexts[cid]->id != cid)
1881 pContext = pState->papContexts[cid];
2194 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
2203 AssertReturn(pState, VERR_NO_MEMORY);
2205 AssertReturn(sidSrc < pState->cSurfaces && pState->papSurfaces[sidSrc]->id == sidSrc, VERR_INVALID_PARAMETER);
2207 AssertReturn(sidDest < pState->cSurfaces && pState->papSurfaces[sidDest]->id == sidDest, VERR_INVALID_PARAMETER);
2209 pSurfaceSrc = pState->papSurfaces[sidSrc];
2210 pSurfaceDest = pState->papSurfaces[sidDest];
2221 if ( cid >= pState->cContexts
2222 || pState->papContexts[cid]->id != cid)
2227 pContext = pState->papContexts[cid];
2324 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
2330 AssertReturn(pState, VERR_NO_MEMORY);
2332 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER);
2334 pSurface = pState->papSurfaces[sid];
2468 if ( cid >= pState->cContexts
2469 || pState->papContexts[cid]->id != cid)
2471 Log(("vmsvga3dSurfaceDMA invalid context id (%x - %x)!\n", cid, (cid >= pState->cContexts) ? -1 : pState->papContexts[cid]->id));
2474 PVMSVGA3DCONTEXT pContext = pState->papContexts[cid];
2537 if ( cid >= pState->cContexts
2538 || pState->papContexts[cid]->id != cid)
2543 PVMSVGA3DCONTEXT pContext = pState->papContexts[cid];
2690 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
2696 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER);
2698 pSurface = pState->papSurfaces[sid];
2704 if ( cid >= pState->cContexts
2705 || pState->papContexts[cid]->id != cid)
2710 pContext = pState->papContexts[cid];
2732 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
2737 AssertReturn(pState, VERR_NO_MEMORY);
2739 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER);
2741 pSurface = pState->papSurfaces[sid];
2758 if ( cid >= pState->cContexts
2759 || pState->papContexts[cid]->id != cid)
2764 pContext = pState->papContexts[cid];
2785 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
2801 AssertReturn(pState, VERR_NO_MEMORY);
2803 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER);
2805 pSurface = pState->papSurfaces[sid];
2816 if ( cid >= pState->cContexts
2817 || pState->papContexts[cid]->id != cid)
2822 pContext = pState->papContexts[cid];
2926 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
2928 AssertReturn(pState, VERR_NO_MEMORY);
2933 if (cid >= pState->cContexts)
2937 void *pvNew = RTMemRealloc(pState->papContexts, sizeof(pState->papContexts[0]) * cNew);
2939 pState->papContexts = (PVMSVGA3DCONTEXT *)pvNew;
2940 while (pState->cContexts < cNew)
2945 pState->papContexts[pState->cContexts++] = pContext;
2949 if (pState->papContexts[cid]->id != SVGA3D_INVALID_ID)
2952 pContext = pState->papContexts[cid];
2989 cs.hInstance = pState->hInstance;
2991 rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_CREATEWINDOW, (WPARAM)&pContext->hwnd, (LPARAM)&cs);
3013 hr = pState->pD3D9->CreateDevice(D3DADAPTER_DEFAULT,
3020 hr = pState->pD3D9->CreateDeviceEx(D3DADAPTER_DEFAULT,
3043 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
3044 AssertReturn(pState, VERR_NO_MEMORY);
3048 if ( cid < pState->cContexts
3049 && pState->papContexts[cid]->id == cid)
3051 PVMSVGA3DCONTEXT pContext = pState->papContexts[cid];
3056 for (uint32_t sid = 0; sid < pState->cSurfaces; sid++)
3058 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid];
3153 int rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_DESTROYWINDOW, (WPARAM)pContext->hwnd, 0);
3185 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
3186 AssertReturn(pState, VERR_NO_MEMORY);
3189 for (uint32_t i = 0; i < pState->cContexts; i++)
3191 PVMSVGA3DCONTEXT pContext = pState->papContexts[i];
3203 for (uint32_t sid = 0; sid < pState->cSurfaces; sid++)
3205 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid];
3327 int rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_RESIZEWINDOW, (WPARAM)pContext->hwnd, (LPARAM)&cs);
3437 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
3438 AssertReturn(pState, VERR_NO_MEMORY);
3442 if ( cid >= pState->cContexts
3443 || pState->papContexts[cid]->id != cid)
3448 pContext = pState->papContexts[cid];
3519 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
3520 AssertReturn(pState, VERR_NO_MEMORY);
3524 if ( cid >= pState->cContexts
3525 || pState->papContexts[cid]->id != cid)
3530 pContext = pState->papContexts[cid];
3595 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
3596 AssertReturn(pState, VERR_NO_MEMORY);
3600 if ( cid >= pState->cContexts
3601 || pState->papContexts[cid]->id != cid)
3606 pContext = pState->papContexts[cid];
4266 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
4269 AssertReturn(pState, VERR_NO_MEMORY);
4276 if ( cid >= pState->cContexts
4277 || pState->papContexts[cid]->id != cid)
4282 pContext = pState->papContexts[cid];
4311 if (pState->fSupportedSurfaceNULL)
4344 AssertReturn(target.sid < pState->cSurfaces && pState->papSurfaces[target.sid]->id == target.sid, VERR_INVALID_PARAMETER);
4345 pRenderTarget = pState->papSurfaces[target.sid];
4358 hr = pState->pD3D9->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT,
4367 if ( pState->fSupportedSurfaceINTZ
4517 hr = pState->pD3D9->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT,
4697 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
4698 AssertReturn(pState, VERR_NO_MEMORY);
4702 if ( cid >= pState->cContexts
4703 || pState->papContexts[cid]->id != cid)
4708 pContext = pState->papContexts[cid];
4831 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER);
4833 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid];
4966 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
4967 AssertReturn(pState, VERR_NO_MEMORY);
4971 if ( cid >= pState->cContexts
4972 || pState->papContexts[cid]->id != cid)
4977 pContext = pState->papContexts[cid];
5021 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
5022 AssertReturn(pState, VERR_NO_MEMORY);
5026 if ( cid >= pState->cContexts
5027 || pState->papContexts[cid]->id != cid)
5032 pContext = pState->papContexts[cid];
5099 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
5100 AssertReturn(pState, VERR_NO_MEMORY);
5104 if ( cid >= pState->cContexts
5105 || pState->papContexts[cid]->id != cid)
5110 pContext = pState->papContexts[cid];
5129 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
5130 AssertReturn(pState, VERR_NO_MEMORY);
5134 if ( cid >= pState->cContexts
5135 || pState->papContexts[cid]->id != cid)
5141 pContext = pState->papContexts[cid];
5164 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
5165 AssertReturn(pState, VERR_NO_MEMORY);
5170 if ( cid >= pState->cContexts
5171 || pState->papContexts[cid]->id != cid)
5176 pContext = pState->papContexts[cid];
5193 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
5194 AssertReturn(pState, VERR_NO_MEMORY);
5198 if ( cid >= pState->cContexts
5199 || pState->papContexts[cid]->id != cid)
5204 pContext = pState->papContexts[cid];
5290 int vmsvga3dDrawPrimitivesProcessVertexDecls(PVMSVGA3DSTATE pState, PVMSVGA3DCONTEXT pContext, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl, uint32_t idStream, D3DVERTEXELEMENT9 *pVertexElement)
5304 AssertReturn(sidVertex < pState->cSurfaces && pState->papSurfaces[sidVertex]->id == sidVertex, VERR_INVALID_PARAMETER);
5306 pVertexSurface = pState->papSurfaces[sidVertex];
5376 pVertexSurface = pState->papSurfaces[sidVertex];
5393 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
5394 AssertReturn(pState, VERR_INTERNAL_ERROR);
5410 if ( cid >= pState->cContexts
5411 || pState->papContexts[cid]->id != cid)
5417 pContext = pState->papContexts[cid];
5457 rc = vmsvga3dDrawPrimitivesProcessVertexDecls(pState, pContext, iVertex - iCurrentVertex, &pVertexDecl[iCurrentVertex], iCurrentStreamId, &pVertexElement[iCurrentVertex]);
5513 || sidIndex >= pState->cSurfaces
5514 || pState->papSurfaces[sidIndex]->id != sidIndex)
5517 Assert(sidIndex < pState->cSurfaces && pState->papSurfaces[sidIndex]->id == sidIndex);
5521 pIndexSurface = pState->papSurfaces[sidIndex];
5576 pVertexSurface = pState->papSurfaces[sidVertex];
5693 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
5694 AssertReturn(pState, VERR_NO_MEMORY);
5698 if ( cid >= pState->cContexts
5699 || pState->papContexts[cid]->id != cid)
5704 pContext = pState->papContexts[cid];
5727 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
5728 AssertReturn(pState, VERR_NO_MEMORY);
5733 if ( cid >= pState->cContexts
5734 || pState->papContexts[cid]->id != cid)
5739 pContext = pState->papContexts[cid];
5826 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
5827 AssertReturn(pState, VERR_NO_MEMORY);
5832 if ( cid >= pState->cContexts
5833 || pState->papContexts[cid]->id != cid)
5838 pContext = pState->papContexts[cid];
5877 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
5878 AssertReturn(pState, VERR_NO_MEMORY);
5883 if ( cid >= pState->cContexts
5884 || pState->papContexts[cid]->id != cid)
5889 pContext = pState->papContexts[cid];
5950 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState;
5951 AssertReturn(pState, VERR_NO_MEMORY);
5955 if ( cid >= pState->cContexts
5956 || pState->papContexts[cid]->id != cid)
5961 pContext = pState->papContexts[cid];