mesa: Use VERT_{ATTRIB,BIT}* for ARB input validation.
For validating ARB program inputs replace hard coded bitfield and attribute number with the appropriate VERT_{ATTRIB,BIT}* variant. This should fix: https://bugs.freedesktop.org/show_bug.cgi?id=43407 Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
This commit is contained in:
parent
b7a69cbb71
commit
b14c06e10d
|
@ -1110,7 +1110,7 @@ ATTRIB_statement: ATTRIB IDENTIFIER '=' attribBinding
|
||||||
YYERROR;
|
YYERROR;
|
||||||
} else {
|
} else {
|
||||||
s->attrib_binding = $4;
|
s->attrib_binding = $4;
|
||||||
state->InputsBound |= (1U << s->attrib_binding);
|
state->InputsBound |= BITFIELD64_BIT(s->attrib_binding);
|
||||||
|
|
||||||
if (!validate_inputs(& @4, state)) {
|
if (!validate_inputs(& @4, state)) {
|
||||||
YYERROR;
|
YYERROR;
|
||||||
|
@ -2403,9 +2403,9 @@ set_src_reg_swz(struct asm_src_register *r, gl_register_file file, GLint index,
|
||||||
int
|
int
|
||||||
validate_inputs(struct YYLTYPE *locp, struct asm_parser_state *state)
|
validate_inputs(struct YYLTYPE *locp, struct asm_parser_state *state)
|
||||||
{
|
{
|
||||||
const int inputs = state->prog->InputsRead | state->InputsBound;
|
const GLbitfield64 inputs = state->prog->InputsRead | state->InputsBound;
|
||||||
|
|
||||||
if (((inputs & 0x0ffff) & (inputs >> 16)) != 0) {
|
if (((inputs & VERT_BIT_FF_ALL) & (inputs >> VERT_ATTRIB_GENERIC0)) != 0) {
|
||||||
yyerror(locp, state, "illegal use of generic attribute and name attribute");
|
yyerror(locp, state, "illegal use of generic attribute and name attribute");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,7 +191,7 @@ struct asm_parser_state {
|
||||||
* multiple ATTRIB statements bind illegal combinations of vertex
|
* multiple ATTRIB statements bind illegal combinations of vertex
|
||||||
* attributes.
|
* attributes.
|
||||||
*/
|
*/
|
||||||
unsigned InputsBound;
|
GLbitfield64 InputsBound;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
invalid_mode = 0,
|
invalid_mode = 0,
|
||||||
|
|
Loading…
Reference in New Issue