Changeset 86009 in vbox for trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
- Timestamp:
- Sep 2, 2020 11:01:09 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r85370 r86009 1097 1097 SVGA3D_DEVCAP_SURFACEFMT_Z_DF24 = 80, 1098 1098 SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT = 81, 1099 SVGA3D_DEVCAP_SURFACEFMT_ BC4_UNORM= 82,1100 SVGA3D_DEVCAP_SURFACEFMT_ BC5_UNORM= 83,1099 SVGA3D_DEVCAP_SURFACEFMT_ATI1 = 82, 1100 SVGA3D_DEVCAP_SURFACEFMT_ATI2 = 83, 1101 1101 #endif 1102 1102 … … 1624 1624 1625 1625 /* Linux: Not referenced in current sources. */ 1626 case SVGA3D_DEVCAP_SURFACEFMT_ BC4_UNORM:1627 case SVGA3D_DEVCAP_SURFACEFMT_ BC5_UNORM:1626 case SVGA3D_DEVCAP_SURFACEFMT_ATI1: 1627 case SVGA3D_DEVCAP_SURFACEFMT_ATI2: 1628 1628 Log(("CAPS: Unknown CAP %s\n", vmsvga3dGetCapString(idx3dCaps))); 1629 1629 rc = VERR_INVALID_PARAMETER; … … 1812 1812 case SVGA3D_BUMPX8L8V8U8: 1813 1813 return D3DFMT_X8L8V8U8; 1814 case SVGA3D_ BUMPL8V8U8:1814 case SVGA3D_FORMAT_DEAD1: 1815 1815 /* No corresponding D3D9 equivalent. */ 1816 1816 AssertFailedReturn(D3DFMT_UNKNOWN); … … 1963 1963 return (D3DFORMAT)MAKEFOURCC('A', 'Y', 'U', 'V'); 1964 1964 1965 case SVGA3D_ BC4_UNORM:1966 case SVGA3D_ BC5_UNORM:1965 case SVGA3D_ATI1: 1966 case SVGA3D_ATI2: 1967 1967 /* Unknown; only in DX10 & 11 */ 1968 1968 break; … … 4479 4479 case SVGA3D_RS_CLIPPLANEENABLE: /* SVGA3dClipPlanes */ 4480 4480 { 4481 AssertCompile(SVGA3D_CLIPPLANE_MAX == (1 << 5)); 4482 for (uint32_t j = 0; j <= 5; j++) 4481 for (uint32_t j = 0; j < SVGA3D_NUM_CLIPPLANES; j++) 4483 4482 { 4484 4483 if (pRenderState[i].uintValue & RT_BIT(j)) … … 4528 4527 4529 4528 enableCap = GL_FOG_MODE; 4530 switch (mode. s.function)4529 switch (mode.function) 4531 4530 { 4532 4531 case SVGA3D_FOGFUNC_EXP: … … 4540 4539 break; 4541 4540 default: 4542 AssertMsgFailedReturn(("Unexpected fog function %d\n", mode. s.function), VERR_INTERNAL_ERROR);4541 AssertMsgFailedReturn(("Unexpected fog function %d\n", mode.function), VERR_INTERNAL_ERROR); 4543 4542 break; 4544 4543 } 4545 4544 4546 4545 /** @todo how to switch between vertex and pixel fog modes??? */ 4547 Assert(mode. s.type == SVGA3D_FOGTYPE_PIXEL);4546 Assert(mode.type == SVGA3D_FOGTYPE_PIXEL); 4548 4547 #if 0 4549 4548 /* The fog type determines the render state. */ 4550 switch (mode. s.type)4549 switch (mode.type) 4551 4550 { 4552 4551 case SVGA3D_FOGTYPE_VERTEX: … … 4557 4556 break; 4558 4557 default: 4559 AssertMsgFailedReturn(("Unexpected fog type %d\n", mode. s.type), VERR_INTERNAL_ERROR);4558 AssertMsgFailedReturn(("Unexpected fog type %d\n", mode.type), VERR_INTERNAL_ERROR); 4560 4559 break; 4561 4560 } … … 4563 4562 4564 4563 /* Set the fog base to depth or range. */ 4565 switch (mode. s.base)4564 switch (mode.base) 4566 4565 { 4567 4566 case SVGA3D_FOGBASE_DEPTHBASED: … … 4575 4574 default: 4576 4575 /* ignore */ 4577 AssertMsgFailed(("Unexpected fog base %d\n", mode. s.base));4576 AssertMsgFailed(("Unexpected fog base %d\n", mode.base)); 4578 4577 break; 4579 4578 } … … 4587 4586 mode.uintValue = pRenderState[i].uintValue; 4588 4587 4589 switch (mode. s.mode)4588 switch (mode.mode) 4590 4589 { 4591 4590 case SVGA3D_FILLMODE_POINT: … … 4599 4598 break; 4600 4599 default: 4601 AssertMsgFailedReturn(("Unexpected fill mode %d\n", mode. s.mode), VERR_INTERNAL_ERROR);4600 AssertMsgFailedReturn(("Unexpected fill mode %d\n", mode.mode), VERR_INTERNAL_ERROR); 4602 4601 break; 4603 4602 } 4604 4603 /* Only front and back faces. Also recent Mesa guest drivers initialize the 'face' to zero. */ 4605 ASSERT_GUEST(mode. s.face == SVGA3D_FACE_FRONT_BACK || mode.s.face == SVGA3D_FACE_INVALID);4604 ASSERT_GUEST(mode.face == SVGA3D_FACE_FRONT_BACK || mode.face == SVGA3D_FACE_INVALID); 4606 4605 glPolygonMode(GL_FRONT_AND_BACK, val); 4607 4606 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); … … 4639 4638 break; 4640 4639 4641 case SVGA3D_RS_ LINEAA:/* SVGA3dBool */4640 case SVGA3D_RS_ANTIALIASEDLINEENABLE: /* SVGA3dBool */ 4642 4641 enableCap = GL_LINE_SMOOTH; 4643 4642 val = pRenderState[i].uintValue; … … 5042 5041 mask.uintValue = pRenderState[i].uintValue; 5043 5042 5044 red = mask. s.red;5045 green = mask. s.green;5046 blue = mask. s.blue;5047 alpha = mask. s.alpha;5043 red = mask.red; 5044 green = mask.green; 5045 blue = mask.blue; 5046 alpha = mask.alpha; 5048 5047 5049 5048 glColorMask(red, green, blue, alpha); … … 5115 5114 5116 5115 case SVGA3D_RS_MULTISAMPLEMASK: /* uint32_t */ 5117 case SVGA3D_RS_ANTIALIASEDLINEENABLE: /* SVGA3dBool */5118 5116 Log(("vmsvga3dSetRenderState: WARNING not applicable??!!\n")); 5119 5117 break; … … 6204 6202 6205 6203 Log(("vmsvga3dSetClipPlane cid=%u %d (%d,%d)(%d,%d)\n", cid, index, (unsigned)(plane[0] * 100.0), (unsigned)(plane[1] * 100.0), (unsigned)(plane[2] * 100.0), (unsigned)(plane[3] * 100.0))); 6206 AssertReturn(index < SVGA3D_ CLIPPLANE_MAX, VERR_INVALID_PARAMETER);6204 AssertReturn(index < SVGA3D_NUM_CLIPPLANES, VERR_INVALID_PARAMETER); 6207 6205 6208 6206 PVMSVGA3DCONTEXT pContext; … … 6806 6804 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); 6807 6805 6808 GLuint divisor = paVertexDivisors && paVertexDivisors[index]. s.instanceData ? 1 : 0;6806 GLuint divisor = paVertexDivisors && paVertexDivisors[index].instanceData ? 1 : 0; 6809 6807 pState->ext.glVertexAttribDivisor(index, divisor); 6810 6808 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); … … 7070 7068 for (uint32_t iVertexDivisor = 0; iVertexDivisor < cVertexDivisor; ++iVertexDivisor) 7071 7069 { 7072 if (pVertexDivisor[iVertexDivisor]. s.indexedData)7070 if (pVertexDivisor[iVertexDivisor].indexedData) 7073 7071 { 7074 7072 if (cInstances == 0) 7075 cInstances = pVertexDivisor[iVertexDivisor]. s.count;7073 cInstances = pVertexDivisor[iVertexDivisor].count; 7076 7074 else 7077 Assert(cInstances == pVertexDivisor[iVertexDivisor]. s.count);7078 } 7079 else if (pVertexDivisor[iVertexDivisor]. s.instanceData)7080 { 7081 Assert(pVertexDivisor[iVertexDivisor]. s.count == 1);7075 Assert(cInstances == pVertexDivisor[iVertexDivisor].count); 7076 } 7077 else if (pVertexDivisor[iVertexDivisor].instanceData) 7078 { 7079 Assert(pVertexDivisor[iVertexDivisor].count == 1); 7082 7080 } 7083 7081 } … … 7583 7581 Log(("ConstantB %d: value=%d, %d, %d, %d\n", reg + i, pValues[i*4 + 0], pValues[i*4 + 1], pValues[i*4 + 2], pValues[i*4 + 3])); 7584 7582 break; 7583 7584 default: 7585 AssertFailedReturn(VERR_INVALID_PARAMETER); 7585 7586 } 7586 7587 #endif
Note:
See TracChangeset
for help on using the changeset viewer.