From 56643096f1eb01eefa1a532ac096b32d23b6b8ba Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Jul 2010 14:24:23 -0600 Subject: mesa: added gl_program::IndirectRegisterFiles field Now drivers, etc. can know which register files are accessed with indirect addressing. Before we just checked gl_program::NumAddressRegs but didn't know if that was the constant buffer, temp regs, or what. The only user of this new field so far will be the gallium state tracker. --- src/mesa/program/program_parse.y | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/program/program_parse.y') diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y index 861927c744..7753dd7cfe 100644 --- a/src/mesa/program/program_parse.y +++ b/src/mesa/program/program_parse.y @@ -835,6 +835,7 @@ srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */ $$.Base.File = $1->param_binding_type; if ($3.Base.RelAddr) { + state->prog->IndirectRegisterFiles |= (1 << $$.Base.File); $1->param_accessed_indirectly = 1; $$.Base.RelAddr = 1; -- cgit v1.2.3 From 0614006d090902324149387ec150231b647928fd Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 31 Jul 2010 20:12:21 +0200 Subject: mesa: increase the relative address offset limit to 4096 in ARB_vp/fp Even though the spec says that the limits should be -64/+63, proprietary drivers support much larger relative offsets and some applications do depend on this non-standard behavior. Also program_parse.tab.c has been regenerated. This fixes the parser error: ARB_vp: error: relative address offset too large See also: https://bugs.freedesktop.org/show_bug.cgi?id=28628 4096 * sizeof(vec4) is the maximum size of the constant buffer on NV50. It is not supposed to be a definite hardware limit, it is for the parser not to get in the way and let the underlying driver decide whether it can run the shader or not. --- src/mesa/program/program_parse.tab.c | 4 ++-- src/mesa/program/program_parse.y | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa/program/program_parse.y') diff --git a/src/mesa/program/program_parse.tab.c b/src/mesa/program/program_parse.tab.c index 34e1fdcf0e..31a609600b 100644 --- a/src/mesa/program/program_parse.tab.c +++ b/src/mesa/program/program_parse.tab.c @@ -2983,7 +2983,7 @@ yyreduce: /* Line 1455 of yacc.c */ #line 937 "program_parse.y" { - if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { + if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 4095)) { char s[100]; _mesa_snprintf(s, sizeof(s), "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); @@ -3000,7 +3000,7 @@ yyreduce: /* Line 1455 of yacc.c */ #line 951 "program_parse.y" { - if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { + if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 4096)) { char s[100]; _mesa_snprintf(s, sizeof(s), "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y index 7753dd7cfe..fb6ef85a9f 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 > 63)) { + if (($1 < 0) || ($1 > 4095)) { 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 > 64)) { + if (($1 < 0) || ($1 > 4096)) { char s[100]; _mesa_snprintf(s, sizeof(s), "relative address offset too large (%d)", $1); -- cgit v1.2.3