Changeset 64483 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Oct 29, 2016 11:28:48 AM (8 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h
r62937 r64483 556 556 AVLU32TREE pSharedObjectTree; 557 557 bool fStencilAsTexture; 558 uint32_t fu32ActualUsageFlags; 558 559 #endif 559 560 } VMSVGA3DSURFACE; -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r63562 r64483 1848 1848 break; 1849 1849 1850 case SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER: 1850 1851 case SVGA3D_SURFACE_HINT_INDEXBUFFER: 1851 1852 case SVGA3D_SURFACE_HINT_VERTEXBUFFER: … … 2456 2457 break; 2457 2458 2459 case SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_INDEXBUFFER: 2458 2460 case SVGA3D_SURFACE_HINT_VERTEXBUFFER: 2459 2461 case SVGA3D_SURFACE_HINT_INDEXBUFFER: … … 2481 2483 <= pMipLevel->cbSurface)) 2482 2484 { 2483 Log(("Lock %s memory for rectangle (%d,%d)(%d,%d)\n", (pSurface->flags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK) == SVGA3D_SURFACE_HINT_VERTEXBUFFER ? "vertex" : "index", 2485 Log(("Lock %s memory for rectangle (%d,%d)(%d,%d)\n", 2486 (pSurface->flags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK) == SVGA3D_SURFACE_HINT_VERTEXBUFFER ? "vertex" : 2487 (pSurface->flags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK) == SVGA3D_SURFACE_HINT_INDEXBUFFER ? "index" : "buffer", 2484 2488 pBox->x, pBox->y, pBox->x + pBox->w, pBox->y + pBox->h)); 2485 2489 -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
r63562 r64483 1103 1103 break; 1104 1104 1105 case SVGA3D_SURFACE_HINT_INDEXBUFFER | SVGA3D_SURFACE_HINT_VERTEXBUFFER: 1105 1106 case SVGA3D_SURFACE_HINT_INDEXBUFFER: 1106 if (pSurface->u.pIndexBuffer)1107 pSurface->u.pIndexBuffer->Release();1108 break;1109 1110 1107 case SVGA3D_SURFACE_HINT_VERTEXBUFFER: 1111 if (pSurface->u.pVertexBuffer) 1112 pSurface->u.pVertexBuffer->Release(); 1108 if (pSurface->fu32ActualUsageFlags == SVGA3D_SURFACE_HINT_VERTEXBUFFER) 1109 { 1110 if (pSurface->u.pVertexBuffer) 1111 pSurface->u.pVertexBuffer->Release(); 1112 } 1113 else if (pSurface->fu32ActualUsageFlags == SVGA3D_SURFACE_HINT_INDEXBUFFER) 1114 { 1115 if (pSurface->u.pIndexBuffer) 1116 pSurface->u.pIndexBuffer->Release(); 1117 } 1118 else 1119 AssertMsg(pSurface->u.pVertexBuffer == NULL, ("fu32ActualUsageFlags %x\n", pSurface->fu32ActualUsageFlags)); 1113 1120 break; 1114 1121 … … 1930 1937 } 1931 1938 1939 case SVGA3D_SURFACE_HINT_VERTEXBUFFER | SVGA3D_SURFACE_HINT_INDEXBUFFER: 1932 1940 case SVGA3D_SURFACE_HINT_VERTEXBUFFER: 1933 fVertex = true;1941 fVertex = RT_BOOL(pSurface->fu32ActualUsageFlags & SVGA3D_SURFACE_HINT_VERTEXBUFFER); 1934 1942 /* no break */ 1935 1943 … … 1973 1981 1974 1982 default: 1975 Assert Failed();1983 AssertMsgFailed(("Unsupported surface hint 0x%08X\n", pSurface->flags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK)); 1976 1984 break; 1977 1985 } … … 4833 4841 } 4834 4842 pVertexSurface->flags |= SVGA3D_SURFACE_HINT_VERTEXBUFFER; 4843 pVertexSurface->fu32ActualUsageFlags |= SVGA3D_SURFACE_HINT_VERTEXBUFFER; 4835 4844 } 4836 4845 else … … 5038 5047 } 5039 5048 pIndexSurface->flags |= SVGA3D_SURFACE_HINT_INDEXBUFFER; 5049 pIndexSurface->fu32ActualUsageFlags |= SVGA3D_SURFACE_HINT_INDEXBUFFER; 5040 5050 } 5041 5051 else -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.cpp
r62514 r64483 217 217 if (surfaceFlags & SVGA3D_SURFACE_AUTOGENMIPMAPS) 218 218 pSurface->fUsageD3D |= D3DUSAGE_AUTOGENMIPMAP; 219 pSurface->fu32ActualUsageFlags = 0; 219 220 #else 220 221 vmsvga3dSurfaceFormat2OGL(pSurface, format); … … 443 444 AssertReturn(pSurface && pSurface->id == sid, VERR_INVALID_PARAMETER); 444 445 445 AssertMsg(host.face == 0, ("host.face=%#x\n", host.face));446 AssertReturn(pSurface->faces[0].numMipLevels > host.mipmap, VERR_INVALID_PARAMETER);447 PVMSVGA3DMIPMAPLEVEL pMipLevel = &pSurface->pMipmapLevels[host.mipmap];448 449 446 if (pSurface->flags & SVGA3D_SURFACE_HINT_TEXTURE) 450 447 Log(("vmsvga3dSurfaceDMA TEXTURE guestptr gmr=%x offset=%x pitch=%x host sid=%x face=%d mipmap=%d transfer=%s cCopyBoxes=%d\n", guest.ptr.gmrId, guest.ptr.offset, guest.pitch, host.sid, host.face, host.mipmap, (transfer == SVGA3D_WRITE_HOST_VRAM) ? "READ" : "WRITE", cCopyBoxes)); 451 448 else 452 449 Log(("vmsvga3dSurfaceDMA guestptr gmr=%x offset=%x pitch=%x host sid=%x face=%d mipmap=%d transfer=%s cCopyBoxes=%d\n", guest.ptr.gmrId, guest.ptr.offset, guest.pitch, host.sid, host.face, host.mipmap, (transfer == SVGA3D_WRITE_HOST_VRAM) ? "READ" : "WRITE", cCopyBoxes)); 450 451 AssertMsg(host.face == 0, ("host.face=%#x\n", host.face)); 452 AssertMsgReturn(pSurface->faces[0].numMipLevels > host.mipmap, ("numMipLevels %d, host.mipmap %d", pSurface->faces[0].numMipLevels, host.mipmap), VERR_INVALID_PARAMETER); 453 PVMSVGA3DMIPMAPLEVEL pMipLevel = &pSurface->pMipmapLevels[host.mipmap]; 453 454 454 455 if (!VMSVGA3DSURFACE_HAS_HW_SURFACE(pSurface))
Note:
See TracChangeset
for help on using the changeset viewer.