summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-11-24 09:05:49 -0700
committerBrian Paul <brianp@vmware.com>2009-01-06 08:53:01 -0700
commitc249ac6d149c6b789df68ed14bdd5bb7395bfa00 (patch)
tree17156e1dbde73a9dd3cb5b7e32d5735750dffa4d /src/mesa
parentaf988262e318629cc29d11171889c5bc5efd3096 (diff)
mesa: set flags for varying vars
(cherry picked from commit 3197954554bfc492283c7db009d10ab408664cad)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/slang/slang_codegen.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index 0f004c813e..e8485c3fab 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -3776,10 +3776,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);
}