Changeset 54783 in vbox
- Timestamp:
- Mar 16, 2015 1:18:12 PM (10 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r54772 r54783 2627 2627 if (sid >= pState->cSurfaces) 2628 2628 { 2629 pState->paSurface = (PVMSVGA3DSURFACE )RTMemRealloc(pState->paSurface, sizeof(VMSVGA3DSURFACE) * (sid + 1)); 2630 AssertReturn(pState->paSurface, VERR_NO_MEMORY); 2629 void *pvNew = RTMemRealloc(pState->paSurface, sizeof(VMSVGA3DSURFACE) * (sid + 1)); 2630 AssertReturn(pvNew, VERR_NO_MEMORY); 2631 pState->paSurface = (PVMSVGA3DSURFACE)pvNew; 2631 2632 memset(&pState->paSurface[pState->cSurfaces], 0, sizeof(VMSVGA3DSURFACE) * (sid + 1 - pState->cSurfaces)); 2632 2633 for (uint32_t i = pState->cSurfaces; i < sid + 1; i++) … … 4238 4239 if (cid >= pState->cContexts) 4239 4240 { 4240 pState->paContext = (PVMSVGA3DCONTEXT)RTMemRealloc(pState->paContext, sizeof(VMSVGA3DCONTEXT) * (cid + 1)); 4241 AssertReturn(pState->paContext, VERR_NO_MEMORY); 4241 void *pvNew = RTMemRealloc(pState->paContext, sizeof(VMSVGA3DCONTEXT) * (cid + 1)); 4242 AssertReturn(pvNew, VERR_NO_MEMORY); 4243 pState->paContext = (PVMSVGA3DCONTEXT)pvNew; 4242 4244 memset(&pState->paContext[pState->cContexts], 0, sizeof(VMSVGA3DCONTEXT) * (cid + 1 - pState->cContexts)); 4243 4245 for (uint32_t i = pState->cContexts; i < cid + 1; i++) … … 7429 7431 if (shid >= pContext->cVertexShaders) 7430 7432 { 7431 pContext->paVertexShader = (PVMSVGA3DSHADER)RTMemRealloc(pContext->paVertexShader, sizeof(VMSVGA3DSHADER) * (shid + 1)); 7432 AssertReturn(pContext->paVertexShader, VERR_NO_MEMORY); 7433 void *pvNew = RTMemRealloc(pContext->paVertexShader, sizeof(VMSVGA3DSHADER) * (shid + 1)) 7434 AssertReturn(pvNew, VERR_NO_MEMORY); 7435 pContext->paVertexShader = (PVMSVGA3DSHADER)pvNew; 7433 7436 memset(&pContext->paVertexShader[pContext->cVertexShaders], 0, sizeof(VMSVGA3DSHADER) * (shid + 1 - pContext->cVertexShaders)); 7434 7437 for (uint32_t i = pContext->cVertexShaders; i < shid + 1; i++) … … 7447 7450 if (shid >= pContext->cPixelShaders) 7448 7451 { 7449 pContext->paPixelShader = (PVMSVGA3DSHADER)RTMemRealloc(pContext->paPixelShader, sizeof(VMSVGA3DSHADER) * (shid + 1)); 7450 AssertReturn(pContext->paPixelShader, VERR_NO_MEMORY); 7452 void *pvNew = RTMemRealloc(pContext->paPixelShader, sizeof(VMSVGA3DSHADER) * (shid + 1)); 7453 AssertReturn(pvNew, VERR_NO_MEMORY); 7454 pContext->paPixelShader = (PVMSVGA3DSHADER)pvNew; 7451 7455 memset(&pContext->paPixelShader[pContext->cPixelShaders], 0, sizeof(VMSVGA3DSHADER) * (shid + 1 - pContext->cPixelShaders)); 7452 7456 for (uint32_t i = pContext->cPixelShaders; i < shid + 1; i++) -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
r54766 r54783 1398 1398 if (sid >= pState->cSurfaces) 1399 1399 { 1400 pState->paSurface = (PVMSVGA3DSURFACE )RTMemRealloc(pState->paSurface, sizeof(VMSVGA3DSURFACE) * (sid + 1)); 1401 AssertReturn(pState->paSurface, VERR_NO_MEMORY); 1400 void *pvNew = RTMemRealloc(pState->paSurface, sizeof(VMSVGA3DSURFACE) * (sid + 1)); 1401 AssertReturn(pvNew, VERR_NO_MEMORY); 1402 pState->paSurface = (PVMSVGA3DSURFACE)pvNew; 1402 1403 memset(&pState->paSurface[pState->cSurfaces], 0, sizeof(VMSVGA3DSURFACE) * (sid + 1 - pState->cSurfaces)); 1403 1404 for (uint32_t i = pState->cSurfaces; i < sid + 1; i++) … … 1633 1634 Assert(pSurface->pSharedObjectTree == NULL); 1634 1635 1635 switch (pSurface->flags & (SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP)) 1636 switch (pSurface->flags & ( SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER 1637 | SVGA3D_SURFACE_HINT_TEXTURE | SVGA3D_SURFACE_HINT_RENDERTARGET 1638 | SVGA3D_SURFACE_HINT_DEPTHSTENCIL | SVGA3D_SURFACE_CUBEMAP)) 1636 1639 { 1637 1640 case SVGA3D_SURFACE_CUBEMAP: … … 2921 2924 if (cid >= pState->cContexts) 2922 2925 { 2923 pState->paContext = (PVMSVGA3DCONTEXT)RTMemRealloc(pState->paContext, sizeof(VMSVGA3DCONTEXT) * (cid + 1)); 2924 AssertReturn(pState->paContext, VERR_NO_MEMORY); 2926 void *pvNew = RTMemRealloc(pState->paContext, sizeof(VMSVGA3DCONTEXT) * (cid + 1)); 2927 AssertReturn(pvNew, VERR_NO_MEMORY); 2928 pState->paContext = (PVMSVGA3DCONTEXT)pvNew; 2925 2929 memset(&pState->paContext[pState->cContexts], 0, sizeof(VMSVGA3DCONTEXT) * (cid + 1 - pState->cContexts)); 2926 2930 for (uint32_t i = pState->cContexts; i < cid + 1; i++) … … 5720 5724 if (shid >= pContext->cVertexShaders) 5721 5725 { 5722 pContext->paVertexShader = (PVMSVGA3DSHADER)RTMemRealloc(pContext->paVertexShader, sizeof(VMSVGA3DSHADER) * (shid + 1)); 5723 AssertReturn(pContext->paVertexShader, VERR_NO_MEMORY); 5726 void *pvNew = RTMemRealloc(pContext->paVertexShader, sizeof(VMSVGA3DSHADER) * (shid + 1)); 5727 AssertReturn(pvNew, VERR_NO_MEMORY); 5728 pContext->paVertexShader = (PVMSVGA3DSHADER)pvNew; 5724 5729 memset(&pContext->paVertexShader[pContext->cVertexShaders], 0, sizeof(VMSVGA3DSHADER) * (shid + 1 - pContext->cVertexShaders)); 5725 5730 for (uint32_t i = pContext->cVertexShaders; i < shid + 1; i++) … … 5738 5743 if (shid >= pContext->cPixelShaders) 5739 5744 { 5740 pContext->paPixelShader = (PVMSVGA3DSHADER)RTMemRealloc(pContext->paPixelShader, sizeof(VMSVGA3DSHADER) * (shid + 1)); 5741 AssertReturn(pContext->paPixelShader, VERR_NO_MEMORY); 5745 void *pvNew = RTMemRealloc(pContext->paPixelShader, sizeof(VMSVGA3DSHADER) * (shid + 1)); 5746 AssertReturn(pvNew, VERR_NO_MEMORY); 5747 pContext->paPixelShader = (PVMSVGA3DSHADER)pvNew; 5742 5748 memset(&pContext->paPixelShader[pContext->cPixelShaders], 0, sizeof(VMSVGA3DSHADER) * (shid + 1 - pContext->cPixelShaders)); 5743 5749 for (uint32_t i = pContext->cPixelShaders; i < shid + 1; i++)
Note:
See TracChangeset
for help on using the changeset viewer.