summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_program.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_program.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_program.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index bd560acdad..4b08d2599b 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -31,10 +31,10 @@
#include "main/imports.h"
#include "main/enums.h"
-#include "shader/prog_parameter.h"
-#include "shader/program.h"
-#include "shader/programopt.h"
-#include "shader/shader_api.h"
+#include "main/shaderobj.h"
+#include "program/prog_parameter.h"
+#include "program/program.h"
+#include "program/programopt.h"
#include "tnl/tnl.h"
#include "brw_context.h"
@@ -174,9 +174,36 @@ static GLboolean brwProgramStringNotify( GLcontext *ctx,
shader_error(ctx, prog,
"i965 driver doesn't yet support uninlined function "
"calls. Move to using a single return statement at "
- "the end of the function to work around it.");
+ "the end of the function to work around it.\n");
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;
+ }
+ if (prog->Instructions[i].DstReg.RelAddr &&
+ prog->Instructions[i].DstReg.File == PROGRAM_OUTPUT) {
+ shader_error(ctx, prog,
+ "Variable indexing of shader outputs unsupported\n");
+ return GL_FALSE;
+ }
+ if (target == GL_FRAGMENT_PROGRAM_ARB) {
+ if ((prog->Instructions[i].DstReg.RelAddr &&
+ prog->Instructions[i].DstReg.File == PROGRAM_TEMPORARY) ||
+ (prog->Instructions[i].SrcReg[0].RelAddr &&
+ prog->Instructions[i].SrcReg[0].File == PROGRAM_TEMPORARY) ||
+ (prog->Instructions[i].SrcReg[1].RelAddr &&
+ prog->Instructions[i].SrcReg[1].File == PROGRAM_TEMPORARY) ||
+ (prog->Instructions[i].SrcReg[2].RelAddr &&
+ prog->Instructions[i].SrcReg[2].File == PROGRAM_TEMPORARY)) {
+ shader_error(ctx, prog,
+ "Variable indexing of variable arrays in the FS "
+ "unsupported\n");
+ return GL_FALSE;
+ }
+ }
}
return GL_TRUE;