summaryrefslogtreecommitdiff
path: root/src/VBox/GuestHost/OpenGL/state_tracker/state_texdiff.c
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/GuestHost/OpenGL/state_tracker/state_texdiff.c
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-master.tar.gz
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/state_tracker/state_texdiff.c')
-rw-r--r--src/VBox/GuestHost/OpenGL/state_tracker/state_texdiff.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/VBox/GuestHost/OpenGL/state_tracker/state_texdiff.c b/src/VBox/GuestHost/OpenGL/state_tracker/state_texdiff.c
index 00adbfff..5ac9028a 100644
--- a/src/VBox/GuestHost/OpenGL/state_tracker/state_texdiff.c
+++ b/src/VBox/GuestHost/OpenGL/state_tracker/state_texdiff.c
@@ -603,6 +603,10 @@ crStateTextureObjectDiff(CRContext *fromCtx,
CRTextureState *from = &(fromCtx->texture);
glAble able[2];
int u = 0; /* always use texture unit 0 for diff'ing */
+ GLuint hwid = crStateGetTextureObjHWID(tobj);
+
+ if (!hwid)
+ return;
able[0] = diff_api.Disable;
able[1] = diff_api.Enable;
@@ -619,7 +623,7 @@ crStateTextureObjectDiff(CRContext *fromCtx,
}
#endif
- diff_api.BindTexture(tobj->target, crStateGetTextureObjHWID(tobj));
+ diff_api.BindTexture(tobj->target, hwid);
if (alwaysDirty || CHECKDIRTY(tobj->paramsBit[u], bitID))
{
@@ -1448,7 +1452,7 @@ crStateDiffAllTextureObjects( CRContext *g, CRbitvalue *bitID, GLboolean bForceU
#endif
/* restore bindings */
- diff_api.ActiveTextureARB(GL_TEXTURE0_ARB + origUnit);
+ /* first restore unit 0 bindings the unit 0 is active currently */
diff_api.BindTexture(GL_TEXTURE_1D, orig1D);
diff_api.BindTexture(GL_TEXTURE_2D, orig2D);
diff_api.BindTexture(GL_TEXTURE_3D, orig3D);
@@ -1458,4 +1462,6 @@ crStateDiffAllTextureObjects( CRContext *g, CRbitvalue *bitID, GLboolean bForceU
#ifdef CR_NV_texture_rectangle
diff_api.BindTexture(GL_TEXTURE_RECTANGLE_NV, origRect);
#endif
+ /* now restore the proper active unit */
+ diff_api.ActiveTextureARB(GL_TEXTURE0_ARB + origUnit);
}