Revision: 48554
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48554
Author:   alexk
Date:     2012-07-03 16:41:25 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
Some temporarily changes for GLES.
Plus attrib location assigning for GLES.

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.h
    
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate_gl11.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_material.c

Modified: 
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.h
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.h    
2012-07-03 16:26:38 UTC (rev 48553)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.h    
2012-07-03 16:41:25 UTC (rev 48554)
@@ -33,12 +33,16 @@
 #define __GPU_IMMEDIATE_H__
 
 #ifdef GLES
+#include REAL_GL_MODE
 #include <GLES2/gl2.h>
+#include <GL/glew.h>
 #else
 #include <GL/glew.h>
 #endif
 
+#ifndef GLES
 #include <stdlib.h>
+#endif
 
 #include "BLI_utildefines.h"
 

Modified: 
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate_gl11.c
===================================================================
--- 
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate_gl11.c   
    2012-07-03 16:26:38 UTC (rev 48553)
+++ 
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate_gl11.c   
    2012-07-03 16:41:25 UTC (rev 48554)
@@ -42,8 +42,10 @@
        GLubyte* ptr;
 } bufferDataGL11;
 
+#ifdef GLES
+#define glClientActiveTexture
+#endif
 
-
 static void allocate(void)
 {
        size_t newSize;

Modified: 
branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_material.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_material.c     
2012-07-03 16:26:38 UTC (rev 48553)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_material.c     
2012-07-03 16:41:25 UTC (rev 48554)
@@ -33,6 +33,11 @@
 #include <math.h>
 #include <string.h>
 
+#ifdef GLES
+#include <GLES2/gl2.h>
+#endif
+
+
 #include <GL/glew.h>
 
 #include "MEM_guardedalloc.h"
@@ -61,9 +66,15 @@
 
 #include "GPU_extensions.h"
 #include "GPU_material.h"
+#include "GPU_matrix.h"
 
 #include "gpu_codegen.h"
 
+#ifdef GLES
+#include "gpu_object_gles.h"
+#endif
+
+
 #include <string.h>
 
 /* Structs */
@@ -75,6 +86,7 @@
        DYN_LAMP_PERSMAT = 8,
 } DynMatProperty;
 
+
 struct GPUMaterial {
        Scene *scene;
        Material *ma;
@@ -95,7 +107,11 @@
        int viewmatloc, invviewmatloc;
        int obmatloc, invobmatloc;
        int obcolloc, obautobumpscaleloc;
-
+       
+#ifdef GLES    
+       struct GPUGLSL_ES_info glslloc;
+#endif
+       
        ListBase lamps;
 };
 
@@ -221,6 +237,11 @@
                        material->obcolloc = GPU_shader_get_uniform(shader, 
GPU_builtin_name(GPU_OBCOLOR));
                if (material->builtins & GPU_AUTO_BUMPSCALE)
                        material->obautobumpscaleloc = 
GPU_shader_get_uniform(shader, GPU_builtin_name(GPU_AUTO_BUMPSCALE));
+
+               #ifdef GLES
+               gpu_assign_gles_loc(&material->glslloc, shader->object);
+               #endif                                  
+                       
                return 1;
        }
 
@@ -339,6 +360,9 @@
                }
 
                GPU_pass_update_uniforms(material->pass);
+#ifdef GLES
+               gpu_set_shader_es(&material->glslloc,1);
+#endif
        }
 }
 
@@ -2032,4 +2056,3 @@
 
        MEM_freeN(shader);
 }
-

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to