Merge branch 'mesa_7_5_branch'
authorBrian Paul <brianp@vmware.com>
Wed, 26 Aug 2009 18:01:23 +0000 (12:01 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 26 Aug 2009 18:01:23 +0000 (12:01 -0600)
progs/glsl/Makefile
progs/glsl/samplers.c
src/mesa/shader/shader_api.c
src/mesa/vbo/vbo_exec_draw.c

index 0875bdd795097ee27bb532b04c560fdf67ecc2ea..8103a5cbca0f046e10b8b4716e550b572401a3fe 100644 (file)
@@ -37,6 +37,7 @@ DEMO_SOURCES = \
        pointcoord.c \
        points.c \
        samplers.c \
+       samplers_array.c \
        shadow_sampler.c \
        shtest.c \
        skinning.c \
@@ -79,6 +80,9 @@ clean:
 
 ##### Extra dependencies
 
+samplers_array.o: samplers.c
+       $(APP_CC) $(CFLAGS) -DSAMPLERS_ARRAY $< -c -o $@
+
 extfuncs.h: $(TOP)/progs/util/extfuncs.h
        cp $< .
 
index 113e5bbeff14d5471a78b5bcaaf363e32ac93528..87dad5d85752daaeab1632fe2d96aa813bd3dbbf 100644 (file)
@@ -211,10 +211,18 @@ InitTextures(void)
       for (y = 0; y < stripeSize; y++) {
          for (x = 0; x < size; x++) {
             GLint k = 4 * ((ypos + y) * size + x);
-            texImage[k + 0] = intensity;
-            texImage[k + 1] = intensity;
-            texImage[k + 2] = 0;
-            texImage[k + 3] = 255;
+            if (x < size / 2) {
+               texImage[k + 0] = intensity;
+               texImage[k + 1] = intensity;
+               texImage[k + 2] = 0;
+               texImage[k + 3] = 255;
+            }
+            else {
+               texImage[k + 0] = 255 - intensity;
+               texImage[k + 1] = 0;
+               texImage[k + 2] = 0;
+               texImage[k + 3] = 255;
+            }
          }
       }
 
index 42b7fa78b6a421bf69c9bdd1bcd58f38d1ea7b69..b52be128c3b5d8f48c1c2bef2203d4cbb4f48918 100644 (file)
@@ -1632,7 +1632,6 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program,
 
    if (param->Type == PROGRAM_SAMPLER) {
       /* This controls which texture unit which is used by a sampler */
-      GLuint texUnit, sampler;
       GLint i;
 
       /* data type for setting samplers must be int */
@@ -1647,8 +1646,9 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program,
        * common thing...
        */
       for (i = 0; i < count; i++) {
-         sampler = (GLuint) program->Parameters->ParameterValues[index + i][0];
-         texUnit = ((GLuint *) values)[i];
+         GLuint sampler =
+            (GLuint) program->Parameters->ParameterValues[index + offset + i][0];
+         GLuint texUnit = ((GLuint *) values)[i];
 
          /* check that the sampler (tex unit index) is legal */
          if (texUnit >= ctx->Const.MaxTextureImageUnits) {
@@ -1659,6 +1659,10 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program,
 
          /* This maps a sampler to a texture unit: */
          if (sampler < MAX_SAMPLERS) {
+#if 0
+            _mesa_printf("Set program %p sampler %d '%s' to unit %u\n",
+                         program, sampler, param->Name, texUnit);
+#endif
             program->SamplerUnits[sampler] = texUnit;
          }
       }
index 625452ac09a03845a67d0d5d3f027e6eca3e1155..53fa90b8afaa747befbbd7b31fc813bcccdf7474 100644 (file)
@@ -398,6 +398,7 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap )
       vbo_exec_vtx_unmap( exec );
    }
 
+
    if (unmap || exec->vtx.vertex_size == 0)
       exec->vtx.max_vert = 0;
    else