Demos (master): multitex: Uniforms must be set after linking the program.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Mon Aug 1 05:19:45 PDT 2011


Module: Demos
Branch: master
Commit: 606882b68bf3a9c7a9e89739d00bde014f34ebb2
URL:    http://cgit.freedesktop.org/mesa/demos/commit/?id=606882b68bf3a9c7a9e89739d00bde014f34ebb2

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Aug  1 13:17:43 2011 +0100

multitex: Uniforms must be set after linking the program.

This fixes the program when replacing gl_Vertex with VertCoord in
multitex.vert, and VertCoord happens to not receive location 0.

---

 src/glsl/multitex.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/glsl/multitex.c b/src/glsl/multitex.c
index d0d5ffd..262ea50 100644
--- a/src/glsl/multitex.c
+++ b/src/glsl/multitex.c
@@ -328,9 +328,6 @@ CreateAProgram(const char *vertProgFile, const char *fragProgFile,
 
    glUseProgram(program);
 
-   SetUniformValues(program, uniforms);
-   PrintUniforms(Uniforms);
-
    assert(ValidateShaderProgram(program));
 
    VertCoord_attr = glGetAttribLocation(program, "VertCoord");
@@ -355,6 +352,9 @@ CreateAProgram(const char *vertProgFile, const char *fragProgFile,
    printf("TexCoord1_attr = %d\n", TexCoord1_attr);
    printf("VertCoord_attr = %d\n", VertCoord_attr);
 
+   SetUniformValues(program, uniforms);
+   PrintUniforms(Uniforms);
+
    return program;
 }
 



More information about the mesa-commit mailing list