glsl: pass datatype to _mesa_add_varying()
authorBrian Paul <brianp@vmware.com>
Fri, 2 Apr 2010 04:15:16 +0000 (22:15 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 2 Apr 2010 04:17:13 +0000 (22:17 -0600)
Will be needed later for transform feedback support.

src/mesa/shader/prog_parameter.c
src/mesa/shader/prog_parameter.h
src/mesa/shader/slang/slang_codegen.c
src/mesa/shader/slang/slang_link.c

index 25bb4f3d4414a1bada68884f2e4733909456397f..aac488c79ab659e708e09f974edc9e23446b2972 100644 (file)
@@ -376,7 +376,8 @@ _mesa_add_sampler(struct gl_program_parameter_list *paramList,
  */
 GLint
 _mesa_add_varying(struct gl_program_parameter_list *paramList,
-                  const char *name, GLuint size, GLbitfield flags)
+                  const char *name, GLuint size, GLenum datatype,
+                  GLbitfield flags)
 {
    GLint i = _mesa_lookup_parameter_index(paramList, -1, name);
    if (i >= 0 && paramList->Parameters[i].Type == PROGRAM_VARYING) {
@@ -386,7 +387,7 @@ _mesa_add_varying(struct gl_program_parameter_list *paramList,
    else {
       /*assert(size == 4);*/
       i = _mesa_add_parameter(paramList, PROGRAM_VARYING, name,
-                              size, GL_NONE, NULL, NULL, flags);
+                              size, datatype, NULL, NULL, flags);
       return i;
    }
 }
index 1111c85976924f8d3e623411b5a2c0d3ca18610e..cc3378ae20129629dfcfd8b93ae1c21dc75b3727 100644 (file)
@@ -146,7 +146,8 @@ _mesa_add_sampler(struct gl_program_parameter_list *paramList,
 
 extern GLint
 _mesa_add_varying(struct gl_program_parameter_list *paramList,
-                  const char *name, GLuint size, GLbitfield flags);
+                  const char *name, GLuint size, GLenum datatype,
+                  GLbitfield flags);
 
 extern GLint
 _mesa_add_attribute(struct gl_program_parameter_list *paramList,
index ecb2f6d5c1e084c02ef6a51e971c669f335883b1..fa79632c18bbf80b055e60eacaa80ea44140bf30 100644 (file)
@@ -5130,7 +5130,7 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
             flags |= PROG_PARAM_BIT_INVARIANT;
 
          varyingLoc = _mesa_add_varying(prog->Varying, varName,
-                                        totalSize, flags);
+                                        totalSize, GL_NONE, flags);
          swizzle = _slang_var_swizzle(size, 0);
          store = _slang_new_ir_storage_swz(PROGRAM_VARYING, varyingLoc,
                                            totalSize, swizzle);
index 7c7bfbdbc5ea616dd0d03b8a04c6bcd1fb033fad..f79af0508f612b89e96965953b1312a52adeb2c3 100644 (file)
@@ -157,7 +157,7 @@ link_varying_vars(GLcontext *ctx,
       else {
          /* not already in linked list */
          j = _mesa_add_varying(shProg->Varying, var->Name, var->Size,
-                               var->Flags);
+                               var->DataType, var->Flags);
       }
 
       if (shProg->Varying->NumParameters > ctx->Const.MaxVarying) {