[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49965] branches/soc-2012-swiss_cheese/ source/blender/gpu/intern: Some small gpu matrix and other changes.

Alexander Kuznetsov kuzsasha at gmail.com
Fri Aug 17 21:23:09 CEST 2012


Revision: 49965
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49965
Author:   alexk
Date:     2012-08-17 19:23:08 +0000 (Fri, 17 Aug 2012)
Log Message:
-----------
Some small gpu matrix and other changes.

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_matrix.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_primitives.c

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c	2012-08-17 19:17:14 UTC (rev 49964)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c	2012-08-17 19:23:08 UTC (rev 49965)
@@ -50,6 +50,7 @@
 #include "intern/gpu_codegen.h"
 #include "GPU_compatibility.h"
 #include "GPU_functions.h"
+#include "gpu_object_gles.h"
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -135,7 +136,11 @@
 	GPU_func_comp_init();
 	gpuInitializeViewFuncs();
 	GPU_codegen_init();
-
+	
+	if(!GPU_GLTYPE_FIXED_ENABLED)
+		gpu_object_init_gles();
+	
+	
 	/* glewIsSupported("GL_VERSION_2_0") */
 #include REAL_GL_MODE
 	if (GLEW_ARB_multitexture)

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_matrix.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_matrix.c	2012-08-17 19:17:14 UTC (rev 49964)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_matrix.c	2012-08-17 19:23:08 UTC (rev 49965)
@@ -44,9 +44,8 @@
 #include "GPU_matrix.h"
 
 
-#ifdef GLES
 #include "gpu_object_gles.h"
-#endif
+#include "GPU_extensions.h"
 
 #if WITH_GPU_SAFETY
 #define GPU_STACK_DEBUG
@@ -219,6 +218,8 @@
 
 void gpuMatrixCommit(void)
 {
+if(GPU_GLTYPE_FIXED_ENABLED)
+{
 #ifndef GLES
 	if(ms_modelview.changed)
 	{
@@ -239,20 +240,24 @@
 		glLoadMatrixf((GLfloat*)ms_texture.dynstack[ms_texture.pos]);
 	}
 
-#else
-if(curglslesi)
+#endif
+} else if(curglslesi)
 {
 #include REAL_GL_MODE
 
 	if(ms_modelview.changed || glslneedupdate)
 	{
 
-		GLfloat t[3][3] = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0};
-		copy_m3_m4(t, ms_modelview.dynstack[ms_modelview.pos]); 
+		 
 		if(curglslesi->viewmatloc!=-1)
 			glUniformMatrix4fv(curglslesi->viewmatloc, 1, 0, ms_modelview.dynstack[ms_modelview.pos]);
+			
 		if(curglslesi->normalmatloc!=-1)
+		{
+			GLfloat t[3][3] = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0};
+			copy_m3_m4(t, ms_modelview.dynstack[ms_modelview.pos]);
 			glUniformMatrix3fv(curglslesi->normalmatloc, 1, 0, t);
+		}
 		
 		
 	}
@@ -261,12 +266,14 @@
 		if(curglslesi->projectionmatloc!=-1)
 		glUniformMatrix4fv(curglslesi->projectionmatloc, 1, 0, ms_projection.dynstack[ms_projection.pos]);
 	}
-
+	
+	if(ms_texture.changed|| glslneedupdate)
+	{
+		if(curglslesi->texturecoordloc!=-1)
+		glUniformMatrix4fv(curglslesi->texturecoordloc, 1, 0, ms_texture.dynstack[ms_texture.pos]);
+	}
 }
 
-
-#endif
-//CHECKMAT
 }
 
 

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_primitives.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_primitives.c	2012-08-17 19:17:14 UTC (rev 49964)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_primitives.c	2012-08-17 19:23:08 UTC (rev 49965)
@@ -614,7 +614,9 @@
 void gpuBeginSprites(void)
 {
 	GLfloat range[4];
+	#include REAL_GL_MODE
 	glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, range);
+	#include FAKE_GL_MODE
 
 	if (range[1] < 2.0f) {
 		GLfloat size[4];




More information about the Bf-blender-cvs mailing list