Changeset 62933 in vbox for trunk/src/VBox/Devices/Graphics
- Timestamp:
- Aug 3, 2016 5:01:03 PM (8 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h
r62932 r62933 864 864 865 865 #ifdef VMSVGA3D_OPENGL 866 float fGLVersion;866 float rsGLVersion; 867 867 /* Current active context. */ 868 868 uint32_t idActiveContext; … … 951 951 R3PTRTYPE(char *) pszOtherExtensions; 952 952 /** The version of the other GL profile. */ 953 float fOtherGLVersion;953 float rsOtherGLVersion; 954 954 955 955 /** Shader talk back interface. */ -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r62514 r62933 174 174 * @param pState The VMSVGA3d state. 175 175 * @param fActualGLVersion The actual OpenGL version we're working against. 176 * @param fMinGLVersionThe OpenGL version that introduced this feature176 * @param rsMinGLVersion The OpenGL version that introduced this feature 177 177 * into the core. 178 178 * @param pszWantedExtension The name of the OpenGL extension we want padded … … 180 180 * @remarks Init time only. 181 181 */ 182 static bool vmsvga3dCheckGLExtension(PVMSVGA3DSTATE pState, float fMinGLVersion, const char *pszWantedExtension) 183 { 182 static bool vmsvga3dCheckGLExtension(PVMSVGA3DSTATE pState, float rsMinGLVersion, const char *pszWantedExtension) 183 { 184 RT_NOREF(rsMinGLVersion); 184 185 /* check padding. */ 185 186 Assert(pszWantedExtension[0] == ' '); … … 192 193 fRet = true; 193 194 194 /* Temporarily. Later start if ( fMinGLVersion != 0.0 && fActualGLVersion >= fMinGLVersion) return true; */195 /* Temporarily. Later start if (rsMinGLVersion != 0.0 && fActualGLVersion >= rsMinGLVersion) return true; */ 195 196 #ifdef RT_OS_DARWIN 196 AssertMsg( fMinGLVersion == 0.0197 || fRet == (pState-> fGLVersion >= fMinGLVersion)197 AssertMsg( rsMinGLVersion == 0.0 198 || fRet == (pState->rsGLVersion >= rsMinGLVersion) 198 199 || VBOX_VMSVGA3D_DEFAULT_OGL_PROFILE == 2.1, 199 200 ("%s actual:%d min:%d fRet=%d\n", 200 pszWantedExtension, (int)(pState-> fGLVersion * 10), (int)(fMinGLVersion * 10), fRet));201 pszWantedExtension, (int)(pState->rsGLVersion * 10), (int)(rsMinGLVersion * 10), fRet)); 201 202 #else 202 AssertMsg( fMinGLVersion == 0.0 || fRet == (pState->fGLVersion >= fMinGLVersion),203 AssertMsg(rsMinGLVersion == 0.0 || fRet == (pState->rsGLVersion >= rsMinGLVersion), 203 204 ("%s actual:%d min:%d fRet=%d\n", 204 pszWantedExtension, (int)(pState-> fGLVersion * 10), (int)(fMinGLVersion * 10), fRet));205 pszWantedExtension, (int)(pState->rsGLVersion * 10), (int)(rsMinGLVersion * 10), fRet)); 205 206 #endif 206 207 return fRet; … … 484 485 while (*pszExt) 485 486 { 487 # ifdef VBOX_STRICT 486 488 size_t cchExt = strlen(pszExt); 487 489 Assert(cchExt > 3); … … 490 492 Assert(pszExt[cchExt - 2] != ' '); 491 493 Assert(pszExt[cchExt - 1] == ' '); 494 # endif 492 495 493 496 if (strstr(*ppszExtensions, pszExt) == NULL) … … 633 636 int rc; 634 637 635 if (pState-> fGLVersion != 0.0)638 if (pState->rsGLVersion != 0.0) 636 639 return VINF_SUCCESS; /* already initialized (load state) */ 637 640 … … 656 659 vmsvga3dLogRelExtensions("", pState->pszExtensions); 657 660 658 pState-> fGLVersion = atof((const char *)glGetString(GL_VERSION));661 pState->rsGLVersion = atof((const char *)glGetString(GL_VERSION)); 659 662 660 663 … … 682 685 vmsvga3dLogRelExtensions("Alternative ", pState->pszOtherExtensions); 683 686 684 pState-> fOtherGLVersion = atof((const char *)glGetString(GL_VERSION));687 pState->rsOtherGLVersion = atof((const char *)glGetString(GL_VERSION)); 685 688 686 689 VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext); 687 690 #else 688 691 pState->pszOtherExtensions = (char *)""; 689 pState-> fOtherGLVersion = pState->fGLVersion;692 pState->rsOtherGLVersion = pState->rsGLVersion; 690 693 #endif 691 694 … … 978 981 #endif 979 982 980 if ( pState-> fGLVersion < 3.0981 && pState-> fOtherGLVersion < 3.0 /* darwin: legacy profile hack */)983 if ( pState->rsGLVersion < 3.0 984 && pState->rsOtherGLVersion < 3.0 /* darwin: legacy profile hack */) 982 985 { 983 986 LogRel(("VMSVGA3d: unsupported OpenGL version; minimum is 3.0\n")); … … 1095 1098 } 1096 1099 #else 1097 NOREF(pThis); NOREF(idScreen);1100 RT_NOREF(pThis, idScreen, pOldViewport); 1098 1101 #endif 1099 1102 } … … 1105 1108 * 1106 1109 * @returns Supported/indented operations (SVGA3DFORMAT_OP_XXX). 1107 * @param pState3D The 3D state.1108 1110 * @param idx3dCaps The SVGA3D_CAPS_XXX value of the surface format. 1109 1111 * … … 1112 1114 * http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/svga/svga_format.c 1113 1115 */ 1114 static uint32_t vmsvga3dGetSurfaceFormatSupport( PVMSVGA3DSTATE pState3D,uint32_t idx3dCaps)1116 static uint32_t vmsvga3dGetSurfaceFormatSupport(uint32_t idx3dCaps) 1115 1117 { 1116 1118 uint32_t result = 0; … … 1218 1220 static uint32_t vmsvga3dGetDepthFormatSupport(PVMSVGA3DSTATE pState3D, uint32_t idx3dCaps) 1219 1221 { 1220 uint32_t result = 0;1222 RT_NOREF(pState3D, idx3dCaps); 1221 1223 1222 1224 /** @todo test this somehow */ 1223 result = SVGA3DFORMAT_OP_ZSTENCIL | SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH;1225 uint32_t result = SVGA3DFORMAT_OP_ZSTENCIL | SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH; 1224 1226 1225 1227 Log(("CAPS: %s =\n%s\n", vmsvga3dGetCapString(idx3dCaps), vmsvga3dGet3dFormatString(result))); … … 1447 1449 case SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8_INT: 1448 1450 case SVGA3D_DEVCAP_SURFACEFMT_DXT1: 1449 *pu32Val = vmsvga3dGetSurfaceFormatSupport( pState,idx3dCaps);1451 *pu32Val = vmsvga3dGetSurfaceFormatSupport(idx3dCaps); 1450 1452 break; 1451 1453 … … 1475 1477 case SVGA3D_DEVCAP_SURFACEFMT_NV12: 1476 1478 case SVGA3D_DEVCAP_SURFACEFMT_AYUV: 1477 *pu32Val = vmsvga3dGetSurfaceFormatSupport( pState,idx3dCaps);1479 *pu32Val = vmsvga3dGetSurfaceFormatSupport(idx3dCaps); 1478 1480 break; 1479 1481 … … 1928 1930 PVMSVGAPACKPARAMS pSave) 1929 1931 { 1932 RT_NOREF(pState); 1933 1930 1934 /* 1931 1935 * Save (ignore errors, setting the defaults we want and avoids restore). … … 2003 2007 PCVMSVGAPACKPARAMS pSave) 2004 2008 { 2005 NOREF(pSurface); 2009 RT_NOREF(pState, pSurface); 2010 2006 2011 if (pSave->iAlignment != 1) 2007 2012 VMSVGA3D_ASSERT_GL_CALL(glPixelStorei(GL_UNPACK_ALIGNMENT, pSave->iAlignment), pState, pContext); … … 2038 2043 PVMSVGA3DSURFACE pSurface) 2039 2044 { 2045 RT_NOREF(idAssociatedContext); 2040 2046 GLint activeTexture = 0; 2041 2047 uint32_t idPrevCtx = pState->idActiveContext; … … 2127 2133 SVGA3dStretchBltMode enmMode, PVMSVGA3DCONTEXT pContext) 2128 2134 { 2135 RT_NOREF(pThis); 2136 2129 2137 /* Activate the read and draw framebuffer objects. */ 2130 2138 pState->ext.glBindFramebuffer(GL_READ_FRAMEBUFFER, pContext->idReadFramebuffer); … … 2192 2200 PVMSVGAPACKPARAMS pSave) 2193 2201 { 2202 RT_NOREF(pState); 2194 2203 /* 2195 2204 * Save (ignore errors, setting the defaults we want and avoids restore). … … 2267 2276 PCVMSVGAPACKPARAMS pSave) 2268 2277 { 2269 NOREF(pSurface);2278 RT_NOREF(pState, pSurface); 2270 2279 if (pSave->iAlignment != 1) 2271 2280 VMSVGA3D_ASSERT_GL_CALL(glPixelStorei(GL_PACK_ALIGNMENT, pSave->iAlignment), pState, pContext); … … 2309 2318 SVGA3dCopyBox const *pBox, PVMSVGA3DCONTEXT pContext, int rc, int iBox) 2310 2319 { 2320 RT_NOREF(iBox); 2311 2321 PVMSVGA3DMIPMAPLEVEL pMipLevel = &pSurface->pMipmapLevels[uHostMipmap]; 2312 2322 … … 2649 2659 PVMSVGA3DSTATE pState = pThis->svga.p3dState; 2650 2660 PVMSVGA3DSURFACE pSurface; 2651 int rc = VINF_SUCCESS;2652 2661 PVMSVGA3DCONTEXT pContext; 2653 2662 uint32_t cid; … … 3125 3134 */ 3126 3135 #ifdef RT_OS_WINDOWS 3127 BOOL ret= SwapBuffers(pContext->hdc);3128 AssertMsg( ret, ("SwapBuffers failed with %d\n", GetLastError()));3136 BOOL fRef = SwapBuffers(pContext->hdc); 3137 AssertMsg(fRef, ("SwapBuffers failed with %d\n", GetLastError())); NOREF(fRef); 3129 3138 #elif defined(RT_OS_DARWIN) 3130 3139 vmsvga3dCocoaSwapBuffers(pContext->cocoaView, pContext->cocoaContext); … … 3871 3880 int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates, SVGA3dRenderState *pRenderState) 3872 3881 { 3873 uint32_t val ;3882 uint32_t val = UINT32_MAX; /* Shut up MSC. */ 3874 3883 PVMSVGA3DCONTEXT pContext; 3875 3884 PVMSVGA3DSTATE pState = pThis->svga.p3dState; … … 3889 3898 for (unsigned i = 0; i < cRenderStates; i++) 3890 3899 { 3891 GLenum enableCap = ~ 0U;3900 GLenum enableCap = ~(GLenum)0; 3892 3901 Log(("vmsvga3dSetRenderState: cid=%x state=%s (%d) val=%x\n", cid, vmsvga3dGetRenderStateName(pRenderState[i].state), pRenderState[i].state, pRenderState[i].uintValue)); 3893 3902 /* Save the render state for vm state saving. */ … … 4688 4697 } 4689 4698 4690 if (enableCap != ~ 0U)4699 if (enableCap != ~(GLenum)0) 4691 4700 { 4692 4701 if (val) … … 5016 5025 int vmsvga3dSetTextureState(PVGASTATE pThis, uint32_t cid, uint32_t cTextureStates, SVGA3dTextureState *pTextureState) 5017 5026 { 5018 GLenum val ;5019 GLenum currentStage = ~ 0L;5027 GLenum val = ~(GLenum)0; /* Shut up MSC. */ 5028 GLenum currentStage = ~(GLenum)0; 5020 5029 PVMSVGA3DCONTEXT pContext; 5021 5030 PVMSVGA3DSTATE pState = pThis->svga.p3dState; … … 5035 5044 for (unsigned i = 0; i < cTextureStates; i++) 5036 5045 { 5037 GLenum textureType = ~0U; 5038 GLenum samplerType = ~0U; 5046 GLenum textureType = ~(GLenum)0; 5047 #if 0 5048 GLenum samplerType = ~(GLenum)0; 5049 #endif 5039 5050 5040 5051 Log(("vmsvga3dSetTextureState: cid=%x stage=%d type=%s (%x) val=%x\n", cid, pTextureState[i].stage, vmsvga3dTextureStateToString(pTextureState[i].name), pTextureState[i].name, pTextureState[i].value)); … … 5257 5268 } 5258 5269 5259 if (textureType != ~ 0U)5270 if (textureType != ~(GLenum)0) 5260 5271 { 5261 5272 glTexParameteri(GL_TEXTURE_2D /** @todo flexible type */, textureType, val); … … 6139 6150 } 6140 6151 6141 int vmsvga3dDrawPrimitives(PVGASTATE pThis, uint32_t cid, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl, uint32_t numRanges, SVGA3dPrimitiveRange *pRange, uint32_t cVertexDivisor, SVGA3dVertexDivisor *pVertexDivisor) 6142 { 6152 int vmsvga3dDrawPrimitives(PVGASTATE pThis, uint32_t cid, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl, 6153 uint32_t numRanges, SVGA3dPrimitiveRange *pRange, uint32_t cVertexDivisor, 6154 SVGA3dVertexDivisor *pVertexDivisor) 6155 { 6156 RT_NOREF(pVertexDivisor); 6143 6157 PVMSVGA3DSTATE pState = pThis->svga.p3dState; 6158 AssertReturn(pState, VERR_INTERNAL_ERROR); 6144 6159 PVMSVGA3DCONTEXT pContext; 6145 AssertReturn(pState, VERR_INTERNAL_ERROR);6146 6160 int rc = VERR_NOT_IMPLEMENTED; 6147 6161 uint32_t iCurrentVertex; … … 6169 6183 switch (pVertexDecl[iVertex].identity.usage) 6170 6184 { 6171 case SVGA3D_DECLUSAGE_POSITIONT: 6172 Log(("ShaderSetPositionTransformed: (%d,%d)\n", pContext->state.RectViewPort.w, pContext->state.RectViewPort.h)); 6173 case SVGA3D_DECLUSAGE_POSITION: 6174 ShaderSetPositionTransformed(pContext->pShaderContext, pContext->state.RectViewPort.w, pContext->state.RectViewPort.h, 6175 pVertexDecl[iVertex].identity.usage == SVGA3D_DECLUSAGE_POSITIONT); 6176 break; 6185 case SVGA3D_DECLUSAGE_POSITIONT: 6186 Log(("ShaderSetPositionTransformed: (%d,%d)\n", pContext->state.RectViewPort.w, pContext->state.RectViewPort.h)); 6187 case SVGA3D_DECLUSAGE_POSITION: 6188 ShaderSetPositionTransformed(pContext->pShaderContext, pContext->state.RectViewPort.w, 6189 pContext->state.RectViewPort.h, 6190 pVertexDecl[iVertex].identity.usage == SVGA3D_DECLUSAGE_POSITIONT); 6191 break; 6192 default: /* Shut up MSC. */ break; 6177 6193 } 6178 6194 } … … 6732 6748 int vmsvga3dQueryBegin(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type) 6733 6749 { 6750 RT_NOREF(pThis, cid, type); 6734 6751 AssertFailed(); 6735 6752 return VERR_NOT_IMPLEMENTED; … … 6738 6755 int vmsvga3dQueryEnd(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type, SVGAGuestPtr guestResult) 6739 6756 { 6757 RT_NOREF(pThis, cid, type, guestResult); 6740 6758 AssertFailed(); 6741 6759 return VERR_NOT_IMPLEMENTED; … … 6744 6762 int vmsvga3dQueryWait(PVGASTATE pThis, uint32_t cid, SVGA3dQueryType type, SVGAGuestPtr guestResult) 6745 6763 { 6764 RT_NOREF(pThis, cid, type, guestResult); 6746 6765 AssertFailed(); 6747 6766 return VERR_NOT_IMPLEMENTED;
Note:
See TracChangeset
for help on using the changeset viewer.