summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_codegen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/slang/slang_codegen.c')
-rw-r--r--src/mesa/shader/slang/slang_codegen.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c
index b389f411773..ea08c46fcfe 100644
--- a/src/mesa/shader/slang/slang_codegen.c
+++ b/src/mesa/shader/slang/slang_codegen.c
@@ -546,8 +546,12 @@ new_label(slang_atom labName)
static slang_ir_node *
new_float_literal(float x, float y, float z, float w)
{
- GLuint size = 4; /* XXX fix */
+ GLuint size;
slang_ir_node *n = new_node(IR_FLOAT, NULL, NULL);
+ if (x == y && x == z && x == w)
+ size = 1;
+ else
+ size = 4;
n->Value[0] = x;
n->Value[1] = y;
n->Value[2] = z;