diff options
author | Francisco Jerez <[email protected]> | 2015-01-28 17:42:37 +0200 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2015-05-04 17:44:17 +0300 |
commit | ce0e15172157b6fa11feabb3ff0672abfb273884 (patch) | |
tree | e899a0277b53e431c81832a4d5b559ebe05cbcc5 /src | |
parent | 6c1f6f8291859209a9b585f65258e090d91f0347 (diff) |
glsl: Keep track of the early_fragment_tests flag in gl_shader.
And rename _mesa_glsl_parse_state::early_fragment_tests to
fs_early_fragment_tests for consistency with other FS-specific flags in the
same struct.
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/ast_type.cpp | 2 | ||||
-rw-r--r-- | src/glsl/glsl_parser_extras.cpp | 4 | ||||
-rw-r--r-- | src/glsl/glsl_parser_extras.h | 2 | ||||
-rw-r--r-- | src/glsl/linker.cpp | 2 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 6 |
5 files changed, 13 insertions, 3 deletions
diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp index 34c2b735a9f..1bcf6a2e81f 100644 --- a/src/glsl/ast_type.cpp +++ b/src/glsl/ast_type.cpp @@ -342,7 +342,7 @@ ast_type_qualifier::merge_in_qualifier(YYLTYPE *loc, } if (q.flags.q.early_fragment_tests) { - state->early_fragment_tests = true; + state->fs_early_fragment_tests = true; } if (create_gs_ast) { diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp index 0aa3c54fc8b..a8ba89eda3a 100644 --- a/src/glsl/glsl_parser_extras.cpp +++ b/src/glsl/glsl_parser_extras.cpp @@ -212,7 +212,7 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx, this->gs_input_size = 0; this->in_qualifier = new(this) ast_type_qualifier(); this->out_qualifier = new(this) ast_type_qualifier(); - this->early_fragment_tests = false; + this->fs_early_fragment_tests = false; memset(this->atomic_counter_offsets, 0, sizeof(this->atomic_counter_offsets)); this->allow_extension_directive_midshader = @@ -1418,6 +1418,7 @@ set_shader_inout_layout(struct gl_shader *shader, assert(!state->fs_redeclares_gl_fragcoord); assert(!state->fs_pixel_center_integer); assert(!state->fs_origin_upper_left); + assert(!state->fs_early_fragment_tests); } switch (shader->Stage) { @@ -1460,6 +1461,7 @@ set_shader_inout_layout(struct gl_shader *shader, shader->origin_upper_left = state->fs_origin_upper_left; shader->ARB_fragment_coord_conventions_enable = state->ARB_fragment_coord_conventions_enable; + shader->EarlyFragmentTests = state->fs_early_fragment_tests; break; default: diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index dae7864fdaf..3c47aab7b36 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -510,7 +510,7 @@ struct _mesa_glsl_parse_state { */ unsigned gs_input_size; - bool early_fragment_tests; + bool fs_early_fragment_tests; /** Atomic counter offsets by binding */ unsigned atomic_counter_offsets[MAX_COMBINED_ATOMIC_BUFFERS]; diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 21fde94442d..330fae004b3 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -1413,6 +1413,8 @@ link_fs_input_layout_qualifiers(struct gl_shader_program *prog, linked_shader->origin_upper_left = shader->origin_upper_left; linked_shader->pixel_center_integer = shader->pixel_center_integer; } + + linked_shader->EarlyFragmentTests |= shader->EarlyFragmentTests; } } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index fb4143086dd..b67fc0c1914 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2499,6 +2499,12 @@ struct gl_shader GLuint NumImages; /** + * Whether early fragment tests are enabled as defined by + * ARB_shader_image_load_store. + */ + bool EarlyFragmentTests; + + /** * Compute shader state from ARB_compute_shader layout qualifiers. */ struct { |