summaryrefslogtreecommitdiff
path: root/src/mesa/program
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program')
-rw-r--r--src/mesa/program/program.c3
-rw-r--r--src/mesa/program/program_parse.y4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index 52254e9365..cfdd0da86d 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -71,6 +71,9 @@ _mesa_init_program(struct gl_context *ctx)
ASSERT(ctx->Const.VertexProgram.MaxUniformComponents <= 4 * MAX_UNIFORMS);
ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents <= 4 * MAX_UNIFORMS);
+ ASSERT(ctx->Const.VertexProgram.MaxAddressOffset <= (1 << INST_INDEX_BITS));
+ ASSERT(ctx->Const.FragmentProgram.MaxAddressOffset <= (1 << INST_INDEX_BITS));
+
/* If this fails, increase prog_instruction::TexSrcUnit size */
ASSERT(MAX_TEXTURE_UNITS < (1 << 5));
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index 784ea28c17..19aa8ccdb5 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -935,7 +935,7 @@ addrRegRelOffset: { $$ = 0; }
addrRegPosOffset: INTEGER
{
- if (($1 < 0) || ($1 > 4095)) {
+ if (($1 < 0) || ($1 > (state->limits->MaxAddressOffset - 1))) {
char s[100];
_mesa_snprintf(s, sizeof(s),
"relative address offset too large (%d)", $1);
@@ -949,7 +949,7 @@ addrRegPosOffset: INTEGER
addrRegNegOffset: INTEGER
{
- if (($1 < 0) || ($1 > 4096)) {
+ if (($1 < 0) || ($1 > state->limits->MaxAddressOffset)) {
char s[100];
_mesa_snprintf(s, sizeof(s),
"relative address offset too large (%d)", $1);