[Bf-blender-cvs] [b01df8222f7] blender2.8: Comment out places which are using texture matrix mode for core profile

Sergey Sharybin noreply at git.blender.org
Wed Apr 19 14:46:52 CEST 2017


Commit: b01df8222f7d262c7cc08a6e38ab693cad5e27da
Author: Sergey Sharybin
Date:   Wed Apr 19 14:38:26 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBb01df8222f7d262c7cc08a6e38ab693cad5e27da

Comment out places which are using texture matrix mode for core profile

There is only two places which are using texture matrix mode:

- Tiled tface support.
- Texture shading mode for texture mapping.

Both cases are subject for reconsideration: it is likely that we'll be getting
rid of tface, which means game properties like tiles needs to be revisited
anyway. As for texture shading it is using basic shader which is also not
supported by core profile anyway.

===================================================================

M	source/blender/editors/space_view3d/drawmesh.c
M	source/blender/gpu/intern/gpu_draw.c

===================================================================

diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 92fb8d3efa1..f1deae7e0fd 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -1103,9 +1103,13 @@ static void tex_mat_set_texture_cb(void *userData, int mat_nr, void *attribs)
 			/* bind texture */
 			glBindTexture(GL_TEXTURE_2D, ima->bindcode[TEXTARGET_TEXTURE_2D]);
 
+#if SUPPORT_LEGACY_MATRIX
 			glMatrixMode(GL_TEXTURE);
 			glLoadMatrixf((float*) texbase->tex_mapping.mat); /* TEXTURE */
 			glMatrixMode(GL_MODELVIEW);
+#else
+			(void)texbase;
+#endif
 
 			/* use active UV texture layer */
 			memset(gattribs, 0, sizeof(*gattribs));
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 4115c115536..a213d8dd911 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -420,9 +420,11 @@ void GPU_clear_tpage(bool force)
 	GTS.curtile = 0;
 	GTS.curima = NULL;
 	if (GTS.curtilemode != 0) {
+#if SUPPORT_LEGACY_MATRIX
 		glMatrixMode(GL_TEXTURE);
 		glLoadIdentity(); /* TEXTURE */
 		glMatrixMode(GL_MODELVIEW);
+#endif
 	}
 	GTS.curtilemode = 0;
 	GTS.curtileXRep = 0;
@@ -604,6 +606,7 @@ int GPU_verify_image(
 	if (GTS.tilemode != GTS.curtilemode || GTS.curtileXRep != GTS.tileXRep ||
 	    GTS.curtileYRep != GTS.tileYRep)
 	{
+#if SUPPORT_LEGACY_MATRIX
 		glMatrixMode(GL_TEXTURE);
 		glLoadIdentity(); /* TEXTURE */
 
@@ -611,6 +614,7 @@ int GPU_verify_image(
 			glScalef(ima->xrep, ima->yrep, 0); /* TEXTURE */
 
 		glMatrixMode(GL_MODELVIEW);
+#endif
 	}
 
 	/* check if we have a valid image */
@@ -2117,9 +2121,11 @@ void GPU_end_object_materials(void)
 
 	/* resetting the texture matrix after the scaling needed for tiled textures */
 	if (GTS.tilemode) {
+#if SUPPORT_LEGACY_MATRIX
 		glMatrixMode(GL_TEXTURE);
 		glLoadIdentity(); /* TEXTURE */
 		glMatrixMode(GL_MODELVIEW);
+#endif
 	}
 }
 
@@ -2302,9 +2308,11 @@ void GPU_state_init(void)
 
 	glDepthRange(0.0, 1.0);
 
+#if SUPPORT_LEGACY_MATRIX
 	glMatrixMode(GL_TEXTURE);
 	glLoadIdentity(); /* TEXTURE */
 	glMatrixMode(GL_MODELVIEW);
+#endif
 
 	glFrontFace(GL_CCW);
 	glCullFace(GL_BACK);




More information about the Bf-blender-cvs mailing list