[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49320] branches/soc-2012-swiss_cheese/ source/blender/gpu: Fix initialization for GPU_ext_config.

Alexander Kuznetsov kuzsasha at gmail.com
Sat Jul 28 05:16:26 CEST 2012


Revision: 49320
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49320
Author:   alexk
Date:     2012-07-28 03:16:20 +0000 (Sat, 28 Jul 2012)
Log Message:
-----------
Fix initialization for GPU_ext_config.
Added GPU_gl_type and GPU_GLTYPE_FIXED flag
GPU_GLTYPE_FIXED_ENABLED is true only if system supports fixed pipeline (aka OpenGL 1.1-3.0)
It is false for Shader Only OpenGL (not yet initialized properly for Desktop)
With OpenGL ES, GPU_GLTYPE_FIXED_ENABLED is defined as 0 to allow optimization and removal of the unreachable code.
Soon, all OpenGL branching code will use GPU_GLTYPE_FIXED_ENABLED and !GPU_GLTYPE_FIXED_ENABLED for check instead of #ifdef, making easier migration to OpenGL 3.1+ on Desktop

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

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_extensions.h
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_extensions.h	2012-07-28 02:50:38 UTC (rev 49319)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_extensions.h	2012-07-28 03:16:20 UTC (rev 49320)
@@ -37,8 +37,8 @@
 #endif
 
 extern unsigned int GPU_ext_config ;
+extern unsigned int GPU_gl_type ;
 
-
 #define GPU_EXT_GLSL (1<<0)
 #define GPU_EXT_GLSL_ENABLED (GPU_ext_config & GPU_EXT_GLSL)
 #define GPU_EXT_GLSL_VERTEX (1<<1)
@@ -48,6 +48,13 @@
 #define GPU_EXT_FRAMEBUFFERS (1<<3)
 #define GPU_EXT_FRAMEBUFFERS_ENABLED (GPU_ext_config & GPU_EXT_FRAMEBUFFERS)
 
+#ifdef GLES
+#define GPU_GLTYPE_FIXED_ENABLED (0)
+#else
+#define GPU_GLTYPE_FIXED (1<<0)
+#define GPU_GLTYPE_FIXED_ENABLED (GPU_gl_type & GPU_GLTYPE_FIXED)
+#endif
+
 /* GPUShader */
 
 struct GPUShader {

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-07-28 02:50:38 UTC (rev 49319)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c	2012-07-28 03:16:20 UTC (rev 49320)
@@ -78,7 +78,8 @@
 extern char datatoc_gpu_shader_vsm_store_frag_glsl[];
 extern char datatoc_gpu_shader_sep_gaussian_blur_vert_glsl[];
 extern char datatoc_gpu_shader_sep_gaussian_blur_frag_glsl[];
-unsigned int GPU_ext_config ;
+unsigned int GPU_ext_config = 0;
+unsigned int GPU_gl_type = 0;
 
 typedef struct GPUShaders {
 	GPUShader *vsm_store;
@@ -142,6 +143,7 @@
 	if (!GLEW_ARB_fragment_shader) GG.glslsupport = 0;
 	if (GLEW_VERSION_2_0) GG.glslsupport = 1;
 	if (GLEW_EXT_framebuffer_object || GLEW_VERSION_3_0) GPU_ext_config |= GPU_EXT_FRAMEBUFFERS;
+	GPU_gl_type |= GPU_GLTYPE_FIXED;
 #else 
 	GPU_ext_config |= GPU_EXT_FRAMEBUFFERS;
 #endif




More information about the Bf-blender-cvs mailing list