mesa: set flags for varying vars
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 24 Nov 2008 16:05:49 +0000 (09:05 -0700)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 24 Nov 2008 20:11:05 +0000 (13:11 -0700)
src/mesa/shader/slang/slang_codegen.c

index dc5fbf5c4abea973ee474b4de0f91984e3693e79..f2cb75f87220352182fc093ad5dda8eb79f092cb 100644 (file)
@@ -3779,10 +3779,19 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
 
       if (prog) {
          /* user-defined varying */
-         GLbitfield flags = 0x0;
-         GLint varyingLoc = _mesa_add_varying(prog->Varying, varName,
-                                              totalSize, flags);
-         GLuint swizzle = _slang_var_swizzle(size, 0);
+         GLbitfield flags;
+         GLint varyingLoc;
+         GLuint swizzle;
+
+         flags = 0x0;
+         if (var->type.centroid == SLANG_CENTROID)
+            flags |= PROG_PARAM_BIT_CENTROID;
+         if (var->type.variant == SLANG_INVARIANT)
+            flags |= PROG_PARAM_BIT_INVARIANT;
+
+         varyingLoc = _mesa_add_varying(prog->Varying, varName,
+                                        totalSize, flags);
+         swizzle = _slang_var_swizzle(size, 0);
          store = _slang_new_ir_storage_swz(PROGRAM_VARYING, varyingLoc,
                                            totalSize, swizzle);
       }