[Mesa-dev] [PATCH 0/6] glsl: Add support for switch statements

Dan McCabe zen3d.linux at gmail.com
Fri Jun 17 17:54:21 PDT 2011


There are three changes from the patch set I published on 6/15:
1) Removed IR pointers from AST classes and moved them to glsl_parser_state,
2) Manage the new IR in a stack-like manner to properly handle nesting, and
3) Squash 6/7 and 7/7 together, since both deal with IR generation

#1 was in response to the concerns Kenneth expressed from his code 
review on 6/15 about embedding IR data into AST structures.

#2 was need as a consequence of #1 to support nested switch statements 
correctly.

#3 is a minor cosmetic change that merges the final implicit break IR 
insertion into the larger collection of IR changes.

cheers, danm

On 06/17/2011 05:43 PM, Dan McCabe wrote:
> This patch set adds support for switch statements to the GLSL compiler. We
> modify the grammar for the compiler with productions for switch statements
> and case labels, while adding supporting supporting productions not already
> present. New AST classes are defined to support those productions. However,
> with our apporach no new IR is needed, allowing us to leverage all existing
> optimizations and code generation.



More information about the mesa-dev mailing list