X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglsl%2Fglsl_parser_extras.h;h=1a909c68b7f174bfc5c00f14f54c974f6f8413a9;hb=6a829a1b724ca0d960decee217d260b4de8a5463;hp=2f4d3cba77f8e2ad26f693bc37e080e6c3ca97b0;hpb=636d01bd61cac83e13c3c64874e7e34e828ca93a;p=mesa.git diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index 2f4d3cba77f..1a909c68b7f 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -42,8 +42,22 @@ enum _mesa_glsl_parser_targets { struct gl_context; +struct glsl_switch_state { + /** Temporary variables needed for switch statement. */ + ir_variable *test_var; + ir_variable *is_fallthru_var; + ir_variable *is_break_var; + class ast_switch_statement *switch_nesting_ast; + + /** Table of constant values already used in case labels */ + struct hash_table *labels_ht; + class ast_case_label *previous_default; + + bool is_switch_innermost; // if switch stmt is closest to break, ... +}; + struct _mesa_glsl_parse_state { - _mesa_glsl_parse_state(struct gl_context *ctx, GLenum target, + _mesa_glsl_parse_state(struct gl_context *_ctx, GLenum target, void *mem_ctx); /* Callers of this ralloc-based new need not call delete. It's @@ -63,6 +77,7 @@ struct _mesa_glsl_parse_state { ralloc_free(mem); } + struct gl_context *const ctx; void *scanner; exec_list translation_unit; glsl_symbol_table *symbols; @@ -118,6 +133,7 @@ struct _mesa_glsl_parse_state { unsigned GLSL_110:1; unsigned GLSL_120:1; unsigned GLSL_130:1; + unsigned GLSL_140:1; /*@}*/ } Const; @@ -129,6 +145,12 @@ struct _mesa_glsl_parse_state { */ class ir_function_signature *current_function; + /** + * During AST to IR conversion, pointer to the toplevel IR + * instruction list being generated. + */ + exec_list *toplevel_ir; + /** Have we found a return statement in this function? */ bool found_return; @@ -143,8 +165,9 @@ struct _mesa_glsl_parse_state { bool all_invariant; /** Loop or switch statement containing the current instructions. */ - class ir_instruction *loop_or_switch_nesting; - class ast_iteration_statement *loop_or_switch_nesting_ast; + class ast_iteration_statement *loop_nesting_ast; + + struct glsl_switch_state switch_state; /** List of structures defined in user code. */ const glsl_type **user_structures; @@ -174,10 +197,14 @@ struct _mesa_glsl_parse_state { bool ARB_shader_stencil_export_warn; bool AMD_conservative_depth_enable; bool AMD_conservative_depth_warn; + bool ARB_conservative_depth_enable; + bool ARB_conservative_depth_warn; bool AMD_shader_stencil_export_enable; bool AMD_shader_stencil_export_warn; bool OES_texture_3D_enable; bool OES_texture_3D_warn; + bool OES_EGL_image_external_enable; + bool OES_EGL_image_external_warn; /*@}*/ /** Extensions supported by the OpenGL implementation. */