summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_program.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-08-26 09:10:19 -0700
committerEric Anholt <eric@anholt.net>2010-08-26 09:53:01 -0700
commitb72c85df5567713293452db6b60c537cd913dcc1 (patch)
treee8c745215759180391af5219cb4be65a9ef7df46 /src/mesa/drivers/dri/i965/brw_program.c
parentde3b40d8cdc42cc1cd71dd65c90d6d569d922fc6 (diff)
i965: Fix the test for variable indexing of shader inputs.
Shader inputs appear in source registers, not dst registers. Catches unsupported shaders in glsl-fs-varying-array and Humus RaytracedShadows.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_program.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_program.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index 1cdc8c6411..d5b7bee1b1 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -168,6 +168,9 @@ static GLboolean brwProgramStringNotify( GLcontext *ctx,
* See piglit glsl-{vs,fs}-functions-[23] tests.
*/
for (i = 0; i < prog->NumInstructions; i++) {
+ struct prog_instruction *inst = prog->Instructions + i;
+ int r;
+
if (prog->Instructions[i].Opcode == OPCODE_CAL) {
shader_error(ctx, prog,
"i965 driver doesn't yet support uninlined function "
@@ -183,12 +186,15 @@ static GLboolean brwProgramStringNotify( GLcontext *ctx,
return GL_FALSE;
}
- if (prog->Instructions[i].DstReg.RelAddr &&
- prog->Instructions[i].DstReg.File == PROGRAM_INPUT) {
- shader_error(ctx, prog,
- "Variable indexing of shader inputs unsupported\n");
- return GL_FALSE;
+ for (r = 0; r < _mesa_num_inst_src_regs(inst->Opcode); r++) {
+ if (prog->Instructions[i].SrcReg[r].RelAddr &&
+ prog->Instructions[i].SrcReg[r].File == PROGRAM_INPUT) {
+ shader_error(ctx, prog,
+ "Variable indexing of shader inputs unsupported\n");
+ return GL_FALSE;
+ }
}
+
if (prog->Instructions[i].DstReg.RelAddr &&
prog->Instructions[i].DstReg.File == PROGRAM_OUTPUT) {
shader_error(ctx, prog,