summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-08-22 20:45:50 +0200
committerMarek Olšák <maraeo@gmail.com>2010-08-25 02:44:28 +0200
commit1802007ee9d63f71d1f372a80b169b6291daa378 (patch)
treeb2908c89fbab74875ba3646a03d16d0c46a315cd /src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
parent6c88f84bddf4b61f8306c5e0eb48642cb636bd58 (diff)
r300/compiler: fail to compile if we hit hw limits or an unimplemented feature
i.e. relative addressing (mainly FS), saturate modifiers, exceeding the maximum number of constants.
Diffstat (limited to 'src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c')
-rw-r--r--src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
index d2fa816894..59f4efc888 100644
--- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
+++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c
@@ -224,4 +224,14 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c)
r300FragmentProgramDump(c->code);
}
}
+
+ /* Check the number of constants. */
+ if (!c->Base.Error) {
+ unsigned max = c->Base.is_r500 ? R500_PFS_NUM_CONST_REGS : R300_PFS_NUM_CONST_REGS;
+
+ if (c->Base.Program.Constants.Count > max) {
+ rc_error(&c->Base, "Too many constants. Max: %i, Got: %i\n",
+ max, c->Base.Program.Constants.Count);
+ }
+ }
}