OSDN Git Service

glsl: Add single declaration variables to the symbol table too.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 5 Mar 2016 04:32:26 +0000 (20:32 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 7 Mar 2016 22:09:31 +0000 (14:09 -0800)
commitc4960068d5d1b4f882734b0e686092a94c80c9bf
tree1064044b48407b4e383181a4ae685991987711ab
parent1107e48b9af97fc51da551c6d1b3c628b0a42118
glsl: Add single declaration variables to the symbol table too.

The lexer/parser use a symbol table to classify identifiers as
variables, functions, or structure types.

For some reason, we neglected to add variables in simple declarations
such as

    int x = 5;

but did add subsequent variables in multi-declarations:

    int x = 5, y = 6; // y gets added, but not x, for some reason

Fixes four dEQP-GLES2.functional.shaders.scoping.valid subcases:
- local_int_variable_hides_struct_type_vertex
- local_int_variable_hides_struct_type_fragment
- local_struct_variable_hides_struct_type_vertex
- local_struct_variable_hides_struct_type_fragment

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/compiler/glsl/glsl_parser.yy