- Timestamp:
- Mar 16, 2015 3:32:09 PM (10 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r54786 r54789 847 847 PVMSVGA3DCONTEXT *papContexts; 848 848 uint32_t cSurfaces; 849 PVMSVGA3DSURFACE paSurface;849 PVMSVGA3DSURFACE *papSurfaces; 850 850 #ifdef DEBUG_GFX_WINDOW_TEST_CONTEXT 851 851 uint32_t idTestContext; … … 900 900 SSMFIELD_ENTRY_IGN_HCPTR( VMSVGA3DSTATE, papContexts), 901 901 SSMFIELD_ENTRY( VMSVGA3DSTATE, cSurfaces), 902 SSMFIELD_ENTRY_IGN_HCPTR( VMSVGA3DSTATE, pa Surface),902 SSMFIELD_ENTRY_IGN_HCPTR( VMSVGA3DSTATE, papSurfaces), 903 903 SSMFIELD_ENTRY_TERM() 904 904 }; … … 1825 1825 for (uint32_t i = 0; i < pState->cSurfaces; i++) 1826 1826 { 1827 if (pState->pa Surface[i].id != SVGA3D_INVALID_ID)1828 vmsvga3dSurfaceDestroy(pThis, pState->pa Surface[i].id);1827 if (pState->papSurfaces[i]->id != SVGA3D_INVALID_ID) 1828 vmsvga3dSurfaceDestroy(pThis, pState->papSurfaces[i]->id); 1829 1829 } 1830 1830 … … 2627 2627 if (sid >= pState->cSurfaces) 2628 2628 { 2629 void *pvNew = RTMemRealloc(pState->paSurface, sizeof(VMSVGA3DSURFACE) * (sid + 1)); 2629 /* Grow the array. */ 2630 uint32_t cNew = RT_ALIGN(sid + 15, 16); 2631 void *pvNew = RTMemRealloc(pState->papSurfaces, sizeof(pState->papSurfaces[0]) * cNew); 2630 2632 AssertReturn(pvNew, VERR_NO_MEMORY); 2631 pState->paSurface = (PVMSVGA3DSURFACE)pvNew; 2632 memset(&pState->paSurface[pState->cSurfaces], 0, sizeof(VMSVGA3DSURFACE) * (sid + 1 - pState->cSurfaces)); 2633 for (uint32_t i = pState->cSurfaces; i < sid + 1; i++) 2634 pState->paSurface[i].id = SVGA3D_INVALID_ID; 2635 2636 pState->cSurfaces = sid + 1; 2637 } 2633 pState->papSurfaces = (PVMSVGA3DSURFACE *)pvNew; 2634 while (pState->cSurfaces < cNew) 2635 { 2636 pSurface = (PVMSVGA3DSURFACE)RTMemAllocZ(sizeof(*pSurface)); 2637 AssertReturn(pSurface, VERR_NO_MEMORY); 2638 pSurface->id = SVGA3D_INVALID_ID; 2639 pState->papSurfaces[pState->cSurfaces++] = pSurface; 2640 } 2641 } 2642 pSurface = pState->papSurfaces[sid]; 2643 2638 2644 /* If one already exists with this id, then destroy it now. */ 2639 if (pS tate->paSurface[sid].id != SVGA3D_INVALID_ID)2645 if (pSurface->id != SVGA3D_INVALID_ID) 2640 2646 vmsvga3dSurfaceDestroy(pThis, sid); 2641 2647 2642 pSurface = &pState->paSurface[sid];2643 2648 memset(pSurface, 0, sizeof(*pSurface)); 2644 2649 pSurface->id = sid; … … 2804 2809 2805 2810 if ( sid < pState->cSurfaces 2806 && pState->pa Surface[sid].id == sid)2807 { 2808 PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];2811 && pState->papSurfaces[sid]->id == sid) 2812 { 2813 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid]; 2809 2814 PVMSVGA3DCONTEXT pContext; 2810 2815 … … 2926 2931 AssertReturn(pState, VERR_NO_MEMORY); 2927 2932 AssertReturn(sidSrc < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 2928 AssertReturn(sidSrc < pState->cSurfaces && pState->pa Surface[sidSrc].id == sidSrc, VERR_INVALID_PARAMETER);2933 AssertReturn(sidSrc < pState->cSurfaces && pState->papSurfaces[sidSrc]->id == sidSrc, VERR_INVALID_PARAMETER); 2929 2934 AssertReturn(sidDest < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 2930 AssertReturn(sidDest < pState->cSurfaces && pState->pa Surface[sidDest].id == sidDest, VERR_INVALID_PARAMETER);2935 AssertReturn(sidDest < pState->cSurfaces && pState->papSurfaces[sidDest]->id == sidDest, VERR_INVALID_PARAMETER); 2931 2936 2932 2937 for (uint32_t i = 0; i < cCopyBoxes; i++) … … 3170 3175 AssertReturn(pState, VERR_NO_MEMORY); 3171 3176 AssertReturn(sidSrc < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 3172 AssertReturn(sidSrc < pState->cSurfaces && pState->pa Surface[sidSrc].id == sidSrc, VERR_INVALID_PARAMETER);3177 AssertReturn(sidSrc < pState->cSurfaces && pState->papSurfaces[sidSrc]->id == sidSrc, VERR_INVALID_PARAMETER); 3173 3178 AssertReturn(sidDest < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 3174 AssertReturn(sidDest < pState->cSurfaces && pState->pa Surface[sidDest].id == sidDest, VERR_INVALID_PARAMETER);3175 3176 pSurfaceSrc = &pState->paSurface[sidSrc];3177 pSurfaceDest = &pState->paSurface[sidDest];3179 AssertReturn(sidDest < pState->cSurfaces && pState->papSurfaces[sidDest]->id == sidDest, VERR_INVALID_PARAMETER); 3180 3181 pSurfaceSrc = pState->papSurfaces[sidSrc]; 3182 pSurfaceDest = pState->papSurfaces[sidDest]; 3178 3183 AssertReturn(pSurfaceSrc->faces[0].numMipLevels > src.mipmap, VERR_INVALID_PARAMETER); 3179 3184 AssertReturn(pSurfaceDest->faces[0].numMipLevels > dest.mipmap, VERR_INVALID_PARAMETER); … … 3395 3400 AssertReturn(pState, VERR_NO_MEMORY); 3396 3401 AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 3397 AssertReturn(sid < pState->cSurfaces && pState->pa Surface[sid].id == sid, VERR_INVALID_PARAMETER);3398 3399 pSurface = &pState->paSurface[sid];3402 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER); 3403 3404 pSurface = pState->papSurfaces[sid]; 3400 3405 AssertReturn(pSurface->faces[0].numMipLevels > host.mipmap, VERR_INVALID_PARAMETER); 3401 3406 pMipLevel = &pSurface->pMipmapLevels[host.mipmap]; … … 3808 3813 AssertReturn(pState, VERR_NO_MEMORY); 3809 3814 AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 3810 AssertReturn(sid < pState->cSurfaces && pState->pa Surface[sid].id == sid, VERR_INVALID_PARAMETER);3811 3812 pSurface = &pState->paSurface[sid];3815 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER); 3816 3817 pSurface = pState->papSurfaces[sid]; 3813 3818 #ifndef VMSVGA3D_OGL_WITH_SHARED_CTX 3814 3819 AssertReturn(pSurface->idAssociatedContext != SVGA3D_INVALID_ID, VERR_INTERNAL_ERROR); … … 3887 3892 AssertReturn(pState, VERR_NO_MEMORY); 3888 3893 AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 3889 AssertReturn(sid < pState->cSurfaces && pState->pa Surface[sid].id == sid, VERR_INVALID_PARAMETER);3890 3891 pSurface = &pState->paSurface[sid];3894 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER); 3895 3896 pSurface = pState->papSurfaces[sid]; 3892 3897 #ifndef VMSVGA3D_OGL_WITH_SHARED_CTX 3893 3898 AssertReturn(pSurface->idAssociatedContext != SVGA3D_INVALID_ID, VERR_INTERNAL_ERROR); … … 4553 4558 for (uint32_t sid = 0; sid < pState->cSurfaces; sid++) 4554 4559 { 4555 PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];4560 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid]; 4556 4561 if ( pSurface->idAssociatedContext == cid 4557 4562 && pSurface->id == sid) … … 5813 5818 5814 5819 AssertReturn(target.sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 5815 AssertReturn(target.sid < pState->cSurfaces && pState->pa Surface[target.sid].id == target.sid, VERR_INVALID_PARAMETER);5816 pRenderTarget = &pState->paSurface[target.sid];5820 AssertReturn(target.sid < pState->cSurfaces && pState->papSurfaces[target.sid]->id == target.sid, VERR_INVALID_PARAMETER); 5821 pRenderTarget = pState->papSurfaces[target.sid]; 5817 5822 5818 5823 switch (type) … … 6187 6192 6188 6193 AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 6189 AssertReturn(sid < pState->cSurfaces && pState->pa Surface[sid].id == sid, VERR_INVALID_PARAMETER);6190 6191 PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];6194 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER); 6195 6196 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid]; 6192 6197 6193 6198 Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x (%d,%d) replacing=%x\n", … … 6940 6945 6941 6946 AssertReturn(sidVertex < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 6942 AssertReturn(sidVertex < pState->cSurfaces && pState->pa Surface[sidVertex].id == sidVertex, VERR_INVALID_PARAMETER);6943 6944 pVertexSurface = &pState->paSurface[sidVertex];6947 AssertReturn(sidVertex < pState->cSurfaces && pState->papSurfaces[sidVertex]->id == sidVertex, VERR_INVALID_PARAMETER); 6948 6949 pVertexSurface = pState->papSurfaces[sidVertex]; 6945 6950 Log(("vmsvga3dDrawPrimitives: vertex surface %x\n", sidVertex)); 6946 6951 … … 7203 7208 if (pContext->sidRenderTarget != SVGA_ID_INVALID) 7204 7209 { 7205 PVMSVGA3DSURFACE pRenderTarget = &pState->paSurface[pContext->sidRenderTarget];7210 PVMSVGA3DSURFACE pRenderTarget = pState->papSurfaces[pContext->sidRenderTarget]; 7206 7211 rtHeight = pRenderTarget->pMipmapLevels[0].size.height; 7207 7212 } … … 7254 7259 if ( sidIndex >= SVGA3D_MAX_SURFACE_IDS 7255 7260 || sidIndex >= pState->cSurfaces 7256 || pState->pa Surface[sidIndex].id != sidIndex)7261 || pState->papSurfaces[sidIndex]->id != sidIndex) 7257 7262 { 7258 7263 Assert(sidIndex < SVGA3D_MAX_SURFACE_IDS); 7259 Assert(sidIndex < pState->cSurfaces && pState->pa Surface[sidIndex].id == sidIndex);7264 Assert(sidIndex < pState->cSurfaces && pState->papSurfaces[sidIndex]->id == sidIndex); 7260 7265 rc = VERR_INVALID_PARAMETER; 7261 7266 goto internal_error; 7262 7267 } 7263 pIndexSurface = &pState->paSurface[sidIndex];7268 pIndexSurface = pState->papSurfaces[sidIndex]; 7264 7269 Log(("vmsvga3dDrawPrimitives: index surface %x\n", sidIndex)); 7265 7270 … … 7389 7394 { 7390 7395 PVMSVGA3DSURFACE pTexture; 7391 pTexture = &pState->paSurface[pContext->aSidActiveTexture[activeTextureUnit - GL_TEXTURE0]];7396 pTexture = pState->papSurfaces[pContext->aSidActiveTexture[activeTextureUnit - GL_TEXTURE0]]; 7392 7397 7393 7398 AssertMsg(pTexture->oglId.texture == (GLuint)activeTexture, ("%x vs %x unit %d - %d\n", pTexture->oglId.texture, activeTexture, i, activeTextureUnit - GL_TEXTURE0)); 7394 7399 } 7395 7400 # else 7396 PVMSVGA3DSURFACE pTexture = &pState->paSurface[pContext->aSidActiveTexture[i]];7401 PVMSVGA3DSURFACE pTexture = pState->papSurfaces[pContext->aSidActiveTexture[i]]; 7397 7402 AssertMsg(pTexture->id == pContext->aSidActiveTexture[i], ("%x vs %x\n", pTexture->id == pContext->aSidActiveTexture[i])); 7398 7403 AssertMsg(pTexture->oglId.texture == (GLuint)activeTexture, -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.h
r54785 r54789 207 207 } 208 208 209 PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];209 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid]; 210 210 Assert(pSurface->id == sid); 211 211 … … 436 436 for (uint32_t sid = 0; sid < pState->cSurfaces; sid++) 437 437 { 438 PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];438 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid]; 439 439 440 440 /* Save the id first. */ -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
r54786 r54789 343 343 RTSEMEVENT WndRequestSem; 344 344 345 /** The size of papContexts 345 /** The size of papContexts. */ 346 346 uint32_t cContexts; 347 /** The size of papSurfaces. */ 347 348 uint32_t cSurfaces; 348 349 /** Contexts indexed by ID. Grown as needed. */ 349 350 PVMSVGA3DCONTEXT *papContexts; 350 PVMSVGA3DSURFACE paSurface; 351 /** Surfaces indexed by ID. Grown as needed. */ 352 PVMSVGA3DSURFACE *papSurfaces; 351 353 352 354 bool fSupportedSurfaceINTZ; … … 369 371 SSMFIELD_ENTRY( VMSVGA3DSTATE, cSurfaces), 370 372 SSMFIELD_ENTRY_IGN_HCPTR( VMSVGA3DSTATE, papContexts), 371 SSMFIELD_ENTRY_IGN_HCPTR( VMSVGA3DSTATE, pa Surface),373 SSMFIELD_ENTRY_IGN_HCPTR( VMSVGA3DSTATE, papSurfaces), 372 374 SSMFIELD_ENTRY_IGNORE( VMSVGA3DSTATE, fSupportedSurfaceINTZ), 373 375 SSMFIELD_ENTRY_IGNORE( VMSVGA3DSTATE, fSupportedSurfaceNULL), … … 595 597 for (uint32_t i = 0; i < pState->cSurfaces; i++) 596 598 { 597 if (pState->pa Surface[i].id != SVGA3D_INVALID_ID)598 vmsvga3dSurfaceDestroy(pThis, pState->pa Surface[i].id);599 if (pState->papSurfaces[i]->id != SVGA3D_INVALID_ID) 600 vmsvga3dSurfaceDestroy(pThis, pState->papSurfaces[i]->id); 599 601 } 600 602 … … 1400 1402 if (sid >= pState->cSurfaces) 1401 1403 { 1402 void *pvNew = RTMemRealloc(pState->paSurface, sizeof(VMSVGA3DSURFACE) * (sid + 1)); 1404 /* Grow the array. */ 1405 uint32_t cNew = RT_ALIGN(sid + 15, 16); 1406 void *pvNew = RTMemRealloc(pState->papSurfaces, sizeof(pState->papSurfaces[0]) * cNew); 1403 1407 AssertReturn(pvNew, VERR_NO_MEMORY); 1404 pState->paSurface = (PVMSVGA3DSURFACE)pvNew; 1405 memset(&pState->paSurface[pState->cSurfaces], 0, sizeof(VMSVGA3DSURFACE) * (sid + 1 - pState->cSurfaces)); 1406 for (uint32_t i = pState->cSurfaces; i < sid + 1; i++) 1407 pState->paSurface[i].id = SVGA3D_INVALID_ID; 1408 1409 pState->cSurfaces = sid + 1; 1410 } 1408 pState->papSurfaces = (PVMSVGA3DSURFACE *)pvNew; 1409 while (pState->cSurfaces < cNew) 1410 { 1411 pSurface = (PVMSVGA3DSURFACE)RTMemAllocZ(sizeof(*pSurface)); 1412 AssertReturn(pSurface, VERR_NO_MEMORY); 1413 pSurface->id = SVGA3D_INVALID_ID; 1414 pState->papSurfaces[pState->cSurfaces++] = pSurface; 1415 } 1416 } 1417 pSurface = pState->papSurfaces[sid]; 1418 1411 1419 /* If one already exists with this id, then destroy it now. */ 1412 if (pS tate->paSurface[sid].id != SVGA3D_INVALID_ID)1420 if (pSurface->id != SVGA3D_INVALID_ID) 1413 1421 vmsvga3dSurfaceDestroy(pThis, sid); 1414 1422 1415 pSurface = &pState->paSurface[sid];1416 1423 memset(pSurface, 0, sizeof(*pSurface)); 1417 1424 pSurface->id = sid; … … 1611 1618 1612 1619 if ( sid < pState->cSurfaces 1613 && pState->pa Surface[sid].id == sid)1614 { 1615 PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];1620 && pState->papSurfaces[sid]->id == sid) 1621 { 1622 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid]; 1616 1623 1617 1624 Log(("vmsvga3dSurfaceDestroy id %x\n", sid)); … … 1751 1758 { 1752 1759 PVMSVGA3DSTATE pState = (PVMSVGA3DSTATE)pThis->svga.p3dState; 1753 PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];1760 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid]; 1754 1761 HRESULT hr; 1755 1762 1756 1763 AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 1757 AssertReturn(sid < pState->cSurfaces && pState->pa Surface[sid].id == sid, VERR_INVALID_PARAMETER);1764 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER); 1758 1765 1759 1766 /* Nothing to do if this surface hasn't been shared. */ … … 1820 1827 AssertReturn(pState, VERR_NO_MEMORY); 1821 1828 AssertReturn(sidSrc < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 1822 AssertReturn(sidSrc < pState->cSurfaces && pState->pa Surface[sidSrc].id == sidSrc, VERR_INVALID_PARAMETER);1829 AssertReturn(sidSrc < pState->cSurfaces && pState->papSurfaces[sidSrc]->id == sidSrc, VERR_INVALID_PARAMETER); 1823 1830 AssertReturn(sidDest < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 1824 AssertReturn(sidDest < pState->cSurfaces && pState->pa Surface[sidDest].id == sidDest, VERR_INVALID_PARAMETER);1825 1826 pSurfaceSrc = &pState->paSurface[sidSrc];1827 pSurfaceDest = &pState->paSurface[sidDest];1831 AssertReturn(sidDest < pState->cSurfaces && pState->papSurfaces[sidDest]->id == sidDest, VERR_INVALID_PARAMETER); 1832 1833 pSurfaceSrc = pState->papSurfaces[sidSrc]; 1834 pSurfaceDest = pState->papSurfaces[sidDest]; 1828 1835 1829 1836 AssertReturn(pSurfaceSrc->faces[0].numMipLevels > src.mipmap, VERR_INVALID_PARAMETER); … … 2196 2203 AssertReturn(pState, VERR_NO_MEMORY); 2197 2204 AssertReturn(sidSrc < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 2198 AssertReturn(sidSrc < pState->cSurfaces && pState->pa Surface[sidSrc].id == sidSrc, VERR_INVALID_PARAMETER);2205 AssertReturn(sidSrc < pState->cSurfaces && pState->papSurfaces[sidSrc]->id == sidSrc, VERR_INVALID_PARAMETER); 2199 2206 AssertReturn(sidDest < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 2200 AssertReturn(sidDest < pState->cSurfaces && pState->pa Surface[sidDest].id == sidDest, VERR_INVALID_PARAMETER);2201 2202 pSurfaceSrc = &pState->paSurface[sidSrc];2203 pSurfaceDest = &pState->paSurface[sidDest];2207 AssertReturn(sidDest < pState->cSurfaces && pState->papSurfaces[sidDest]->id == sidDest, VERR_INVALID_PARAMETER); 2208 2209 pSurfaceSrc = pState->papSurfaces[sidSrc]; 2210 pSurfaceDest = pState->papSurfaces[sidDest]; 2204 2211 AssertReturn(pSurfaceSrc->faces[0].numMipLevels > src.mipmap, VERR_INVALID_PARAMETER); 2205 2212 AssertReturn(pSurfaceDest->faces[0].numMipLevels > dest.mipmap, VERR_INVALID_PARAMETER); … … 2323 2330 AssertReturn(pState, VERR_NO_MEMORY); 2324 2331 AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 2325 AssertReturn(sid < pState->cSurfaces && pState->pa Surface[sid].id == sid, VERR_INVALID_PARAMETER);2326 2327 pSurface = &pState->paSurface[sid];2332 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER); 2333 2334 pSurface = pState->papSurfaces[sid]; 2328 2335 AssertReturn(pSurface->faces[0].numMipLevels > host.mipmap, VERR_INVALID_PARAMETER); 2329 2336 pMipLevel = &pSurface->pMipmapLevels[host.mipmap]; … … 2687 2694 uint32_t sid = src.sid; 2688 2695 AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 2689 AssertReturn(sid < pState->cSurfaces && pState->pa Surface[sid].id == sid, VERR_INVALID_PARAMETER);2690 2691 pSurface = &pState->paSurface[sid];2696 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER); 2697 2698 pSurface = pState->papSurfaces[sid]; 2692 2699 uint32_t cid; 2693 2700 … … 2730 2737 AssertReturn(pState, VERR_NO_MEMORY); 2731 2738 AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 2732 AssertReturn(sid < pState->cSurfaces && pState->pa Surface[sid].id == sid, VERR_INVALID_PARAMETER);2733 2734 pSurface = &pState->paSurface[sid];2739 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER); 2740 2741 pSurface = pState->papSurfaces[sid]; 2735 2742 AssertReturn(pSurface->idAssociatedContext != SVGA3D_INVALID_ID, VERR_INTERNAL_ERROR); 2736 2743 … … 2794 2801 AssertReturn(pState, VERR_NO_MEMORY); 2795 2802 AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 2796 AssertReturn(sid < pState->cSurfaces && pState->pa Surface[sid].id == sid, VERR_INVALID_PARAMETER);2797 2798 pSurface = &pState->paSurface[sid];2803 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER); 2804 2805 pSurface = pState->papSurfaces[sid]; 2799 2806 AssertReturn(pSurface->idAssociatedContext != SVGA3D_INVALID_ID, VERR_INTERNAL_ERROR); 2800 2807 … … 3049 3056 for (uint32_t sid = 0; sid < pState->cSurfaces; sid++) 3050 3057 { 3051 PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];3058 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid]; 3052 3059 if ( pSurface->id == sid 3053 3060 && pSurface->idAssociatedContext == cid) … … 3196 3203 for (uint32_t sid = 0; sid < pState->cSurfaces; sid++) 3197 3204 { 3198 PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];3205 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid]; 3199 3206 if ( pSurface->id == sid 3200 3207 && pSurface->idAssociatedContext == cid … … 4335 4342 4336 4343 AssertReturn(target.sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 4337 AssertReturn(target.sid < pState->cSurfaces && pState->pa Surface[target.sid].id == target.sid, VERR_INVALID_PARAMETER);4338 pRenderTarget = &pState->paSurface[target.sid];4344 AssertReturn(target.sid < pState->cSurfaces && pState->papSurfaces[target.sid]->id == target.sid, VERR_INVALID_PARAMETER); 4345 pRenderTarget = pState->papSurfaces[target.sid]; 4339 4346 4340 4347 switch (type) … … 4822 4829 4823 4830 AssertReturn(sid < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 4824 AssertReturn(sid < pState->cSurfaces && pState->pa Surface[sid].id == sid, VERR_INVALID_PARAMETER);4825 4826 PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid];4831 AssertReturn(sid < pState->cSurfaces && pState->papSurfaces[sid]->id == sid, VERR_INVALID_PARAMETER); 4832 4833 PVMSVGA3DSURFACE pSurface = pState->papSurfaces[sid]; 4827 4834 4828 4835 Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x (%d,%d)\n", currentStage, pTextureState[i].value, pSurface->pMipmapLevels[0].size.width, pSurface->pMipmapLevels[0].size.height)); … … 5295 5302 5296 5303 AssertReturn(sidVertex < SVGA3D_MAX_SURFACE_IDS, VERR_INVALID_PARAMETER); 5297 AssertReturn(sidVertex < pState->cSurfaces && pState->pa Surface[sidVertex].id == sidVertex, VERR_INVALID_PARAMETER);5298 5299 pVertexSurface = &pState->paSurface[sidVertex];5304 AssertReturn(sidVertex < pState->cSurfaces && pState->papSurfaces[sidVertex]->id == sidVertex, VERR_INVALID_PARAMETER); 5305 5306 pVertexSurface = pState->papSurfaces[sidVertex]; 5300 5307 Log(("vmsvga3dDrawPrimitives: vertex surface %x stream %d\n", sidVertex, idStream)); 5301 5308 Log(("vmsvga3dDrawPrimitives: type=%s (%d) method=%s (%d) usage=%s (%d) usageIndex=%d stride=%d offset=%d\n", vmsvgaDeclType2String(pVertexDecl[iVertex].identity.type), pVertexDecl[iVertex].identity.type, vmsvgaDeclMethod2String(pVertexDecl[iVertex].identity.method), pVertexDecl[iVertex].identity.method, vmsvgaDeclUsage2String(pVertexDecl[iVertex].identity.usage), pVertexDecl[iVertex].identity.usage, pVertexDecl[iVertex].identity.usageIndex, pVertexDecl[iVertex].array.stride, pVertexDecl[iVertex].array.offset)); … … 5367 5374 unsigned strideVertex = pVertexDecl[0].array.stride; 5368 5375 5369 pVertexSurface = &pState->paSurface[sidVertex];5376 pVertexSurface = pState->papSurfaces[sidVertex]; 5370 5377 5371 5378 Log(("vmsvga3dDrawPrimitives: SetStreamSource %d min offset=%d stride=%d\n", idStream, uVertexMinOffset, strideVertex)); … … 5505 5512 if ( sidIndex >= SVGA3D_MAX_SURFACE_IDS 5506 5513 || sidIndex >= pState->cSurfaces 5507 || pState->pa Surface[sidIndex].id != sidIndex)5514 || pState->papSurfaces[sidIndex]->id != sidIndex) 5508 5515 { 5509 5516 Assert(sidIndex < SVGA3D_MAX_SURFACE_IDS); 5510 Assert(sidIndex < pState->cSurfaces && pState->pa Surface[sidIndex].id == sidIndex);5517 Assert(sidIndex < pState->cSurfaces && pState->papSurfaces[sidIndex]->id == sidIndex); 5511 5518 rc = VERR_INVALID_PARAMETER; 5512 5519 goto internal_error; 5513 5520 } 5514 pIndexSurface = &pState->paSurface[sidIndex];5521 pIndexSurface = pState->papSurfaces[sidIndex]; 5515 5522 Log(("vmsvga3dDrawPrimitives: index surface %x\n", sidIndex)); 5516 5523 … … 5567 5574 unsigned strideVertex = pVertexDecl[0].array.stride; 5568 5575 5569 pVertexSurface = &pState->paSurface[sidVertex];5576 pVertexSurface = pState->papSurfaces[sidVertex]; 5570 5577 5571 5578 if (!pIndexSurface)
Note:
See TracChangeset
for help on using the changeset viewer.