summaryrefslogtreecommitdiffstats
path: root/src/mesa/slang/slang_codegen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/slang/slang_codegen.c')
-rw-r--r--src/mesa/slang/slang_codegen.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/mesa/slang/slang_codegen.c b/src/mesa/slang/slang_codegen.c
index 79072cb3569..11a9074d1ec 100644
--- a/src/mesa/slang/slang_codegen.c
+++ b/src/mesa/slang/slang_codegen.c
@@ -5155,7 +5155,7 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
/* fragment program input */
GLuint swizzle;
GLint index = _slang_input_index(varName, GL_FRAGMENT_PROGRAM_ARB,
- &swizzle);
+ &swizzle, NULL);
assert(index >= 0);
assert(index < FRAG_ATTRIB_MAX);
store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index,
@@ -5171,9 +5171,10 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
size, swizzle);
} else {
/* geometry program input */
+ GLboolean is_array = GL_FALSE;
GLuint swizzle;
GLint index = _slang_input_index(varName, MESA_GEOMETRY_PROGRAM,
- &swizzle);
+ &swizzle, &is_array);
if (index < 0) {
/* geometry program output */
index = _slang_output_index(varName, MESA_GEOMETRY_PROGRAM);
@@ -5187,8 +5188,12 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
} else {
assert(index >= 0);
/* assert(index < GEOM_ATTRIB_MAX); */
- store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index,
- size, swizzle);
+ if (is_array)
+ store = _slang_new_ir_storage_2d(PROGRAM_INPUT, 0, index,
+ size, swizzle);
+ else
+ store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index,
+ size, swizzle);
}
}
if (dbg) printf("V/F ");
@@ -5217,7 +5222,7 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
}
else {
/* pre-defined vertex attrib */
- index = _slang_input_index(varName, GL_VERTEX_PROGRAM_ARB, &swizzle);
+ index = _slang_input_index(varName, GL_VERTEX_PROGRAM_ARB, &swizzle, NULL);
assert(index >= 0);
}
store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index, size, swizzle);
@@ -5227,12 +5232,16 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var,
GLuint swizzle = SWIZZLE_XYZW; /* silence compiler warning */
if (type == SLANG_UNIT_FRAGMENT_BUILTIN) {
GLint index = _slang_input_index(varName, GL_FRAGMENT_PROGRAM_ARB,
- &swizzle);
+ &swizzle, NULL);
store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index, size, swizzle);
} else if (type == SLANG_UNIT_GEOMETRY_BUILTIN) {
+ GLboolean is_array;
GLint index = _slang_input_index(varName, MESA_GEOMETRY_PROGRAM,
- &swizzle);
- store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index, size, swizzle);
+ &swizzle, &is_array);
+ if (is_array)
+ store = _slang_new_ir_storage_2d(PROGRAM_INPUT, 0, index, size, swizzle);
+ else
+ store = _slang_new_ir_storage_swz(PROGRAM_INPUT, index, size, swizzle);
}
if (dbg) printf("INPUT ");
}