Changeset 54786 in vbox
- Timestamp:
- Mar 16, 2015 2:38:46 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 98975
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp ¶
r54785 r54786 6116 6116 6117 6117 /* Active the right texture unit for subsequent texture state changes. */ 6118 if (pTextureState[i].stage != currentStage) 6119 { 6120 pState->ext.glActiveTexture(GL_TEXTURE0 + pTextureState[i].stage); 6121 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); 6122 currentStage = pTextureState[i].stage; 6118 if (pTextureState[i].stage != currentStage || i == 0) 6119 { 6120 /** @todo Is this the appropriate limit for all kinds of textures? It is the 6121 * size of aSidActiveTexture and for binding/unbinding we cannot exceed it. */ 6122 if (pTextureState[i].stage < SVGA3D_MAX_TEXTURE_STAGE) 6123 { 6124 pState->ext.glActiveTexture(GL_TEXTURE0 + pTextureState[i].stage); 6125 VMSVGA3D_CHECK_LAST_ERROR(pState, pContext); 6126 currentStage = pTextureState[i].stage; 6127 } 6128 else 6129 { 6130 AssertMsgFailed(("pTextureState[%d].stage=%#x name=%#x\n", i, pTextureState[i].stage, pTextureState[i].name)); 6131 continue; 6132 } 6123 6133 } 6124 6134 … … 6162 6172 { 6163 6173 Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x replacing=%x\n", 6164 pTextureState[i].stage, pTextureState[i].value, pContext->aSidActiveTexture[currentStage]));6174 currentStage, pTextureState[i].value, pContext->aSidActiveTexture[currentStage])); 6165 6175 6166 6176 pContext->aSidActiveTexture[currentStage] = SVGA3D_INVALID_ID; … … 6182 6192 6183 6193 Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x (%d,%d) replacing=%x\n", 6184 pTextureState[i].stage, pTextureState[i].value, pSurface->pMipmapLevels[0].size.width,6194 currentStage, pTextureState[i].value, pSurface->pMipmapLevels[0].size.width, 6185 6195 pSurface->pMipmapLevels[0].size.height, pContext->aSidActiveTexture[currentStage])); 6186 6196 … … 6264 6274 else 6265 6275 val = vmsvga3dTextureFilter2OGL((SVGA3dTextureFilter)minFilter); 6266 6267 6276 break; 6268 6277 } -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp ¶
r54785 r54786 4705 4705 D3DTEXTURESTAGESTATETYPE textureType = D3DTSS_FORCE_DWORD; 4706 4706 D3DSAMPLERSTATETYPE samplerType = D3DSAMP_FORCE_DWORD; 4707 4708 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)); 4707 uint32_t currentStage = pTextureState[i].stage; 4708 4709 Log(("vmsvga3dSetTextureState: cid=%x stage=%d type=%s (%x) val=%x\n", cid, currentStage, vmsvga3dTextureStateToString(pTextureState[i].name), pTextureState[i].name, pTextureState[i].value)); 4710 4711 /** @todo Is this the appropriate limit for all kinds of textures? It is the 4712 * size of aSidActiveTexture and for binding/unbinding we cannot exceed it. */ 4713 if (RT_UNLIKELY(currentStage >= SVGA3D_MAX_TEXTURE_STAGE)) 4714 { 4715 AssertMsgFailed(("pTextureState[%d].stage=%#x name=%#x\n", i, pTextureState[i].stage, pTextureState[i].name)); 4716 continue; 4717 } 4718 4709 4719 /* Record the texture state for vm state saving. */ 4710 if ( pTextureState[i].stage < SVGA3D_MAX_TEXTURE_STAGE4720 if ( currentStage < SVGA3D_MAX_TEXTURE_STAGE 4711 4721 && pTextureState[i].name < SVGA3D_TS_MAX) 4712 4722 { 4713 pContext->state.aTextureState[ pTextureState[i].stage][pTextureState[i].name] = pTextureState[i];4723 pContext->state.aTextureState[currentStage][pTextureState[i].name] = pTextureState[i]; 4714 4724 } 4715 4725 … … 4799 4809 if (pTextureState[i].value == SVGA3D_INVALID_ID) 4800 4810 { 4801 Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x\n", pTextureState[i].stage, pTextureState[i].value));4802 4803 pContext->aSidActiveTexture[ pTextureState[i].stage] = SVGA3D_INVALID_ID;4811 Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x\n", currentStage, pTextureState[i].value)); 4812 4813 pContext->aSidActiveTexture[currentStage] = SVGA3D_INVALID_ID; 4804 4814 /* Unselect the currently associated texture. */ 4805 hr = pContext->pDevice->SetTexture(pTextureState[i].stage, 4806 NULL); 4815 hr = pContext->pDevice->SetTexture(currentStage, NULL); 4807 4816 AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetTextureState: SetTexture failed with %x\n", hr), VERR_INTERNAL_ERROR); 4808 4817 } … … 4817 4826 PVMSVGA3DSURFACE pSurface = &pState->paSurface[sid]; 4818 4827 4819 Log(("SVGA3D_TS_BIND_TEXTURE: stage %d, texture surface id=%x (%d,%d)\n", pTextureState[i].stage, pTextureState[i].value, pSurface->pMipmapLevels[0].size.width, pSurface->pMipmapLevels[0].size.height));4828 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)); 4820 4829 4821 4830 if (!pSurface->u.pTexture) … … 4840 4849 AssertReturn(pSharedSurface, VERR_INTERNAL_ERROR); 4841 4850 4842 hr = pContext->pDevice->SetTexture(pTextureState[i].stage, 4843 pSharedSurface->u.pTexture); 4851 hr = pContext->pDevice->SetTexture(currentStage, pSharedSurface->u.pTexture); 4844 4852 } 4845 4853 else 4846 4854 #endif 4847 hr = pContext->pDevice->SetTexture(pTextureState[i].stage, 4848 pSurface->u.pTexture); 4855 hr = pContext->pDevice->SetTexture(currentStage, pSurface->u.pTexture); 4849 4856 4850 4857 AssertMsgReturn(hr == D3D_OK, ("vmsvga3dSetTextureState: SetTexture failed with %x\n", hr), VERR_INTERNAL_ERROR); 4851 4858 4852 pContext->aSidActiveTexture[ pTextureState[i].stage] = sid;4859 pContext->aSidActiveTexture[currentStage] = sid; 4853 4860 } 4854 4861 /* Finished; continue with the next one. */ … … 4931 4938 if (textureType != D3DTSS_FORCE_DWORD) 4932 4939 { 4933 hr = pContext->pDevice->SetTextureStageState( pTextureState[i].stage, textureType, val);4940 hr = pContext->pDevice->SetTextureStageState(currentStage, textureType, val); 4934 4941 } 4935 4942 else 4936 4943 { 4937 4944 Assert(samplerType != D3DSAMP_FORCE_DWORD); 4938 hr = pContext->pDevice->SetSamplerState( pTextureState[i].stage, samplerType, val);4945 hr = pContext->pDevice->SetSamplerState(currentStage, samplerType, val); 4939 4946 } 4940 4947
Note:
See TracChangeset
for help on using the changeset viewer.