diff options
author | Timothy Arceri <[email protected]> | 2016-11-22 18:25:20 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-01-19 17:05:26 +1100 |
commit | 66a6050ad8a56d4d04624870e6845579bd0581b2 (patch) | |
tree | 5c1ab139a67ea03330a16576ce2c4c72a1e4e726 /src/compiler/glsl/linker.cpp | |
parent | cc7ecce2533667e4ce958ffc3e128974ec2d5b15 (diff) |
mesa/glsl: move redeclares_gl_fragcoord to gl_shader
This is never used in gl_linked_shader other than as a temp
during linking so just use a temp instead.
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/compiler/glsl/linker.cpp')
-rw-r--r-- | src/compiler/glsl/linker.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 3846679c260..68761518290 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -1826,7 +1826,7 @@ link_fs_inout_layout_qualifiers(struct gl_shader_program *prog, struct gl_shader **shader_list, unsigned num_shaders) { - linked_shader->info.redeclares_gl_fragcoord = false; + bool redeclares_gl_fragcoord = false; linked_shader->info.uses_gl_fragcoord = false; linked_shader->info.origin_upper_left = false; linked_shader->info.pixel_center_integer = false; @@ -1844,12 +1844,10 @@ link_fs_inout_layout_qualifiers(struct gl_shader_program *prog, * it must be redeclared in all the fragment shaders in that program * that have a static use gl_FragCoord." */ - if ((linked_shader->info.redeclares_gl_fragcoord - && !shader->info.redeclares_gl_fragcoord - && shader->info.uses_gl_fragcoord) - || (shader->info.redeclares_gl_fragcoord - && !linked_shader->info.redeclares_gl_fragcoord - && linked_shader->info.uses_gl_fragcoord)) { + if ((redeclares_gl_fragcoord && !shader->redeclares_gl_fragcoord && + shader->info.uses_gl_fragcoord) + || (shader->redeclares_gl_fragcoord && !redeclares_gl_fragcoord && + linked_shader->info.uses_gl_fragcoord)) { linker_error(prog, "fragment shader defined with conflicting " "layout qualifiers for gl_FragCoord\n"); } @@ -1859,8 +1857,7 @@ link_fs_inout_layout_qualifiers(struct gl_shader_program *prog, * "All redeclarations of gl_FragCoord in all fragment shaders in a * single program must have the same set of qualifiers." */ - if (linked_shader->info.redeclares_gl_fragcoord && - shader->info.redeclares_gl_fragcoord && + if (redeclares_gl_fragcoord && shader->redeclares_gl_fragcoord && (shader->info.origin_upper_left != linked_shader->info.origin_upper_left || shader->info.pixel_center_integer != @@ -1874,10 +1871,8 @@ link_fs_inout_layout_qualifiers(struct gl_shader_program *prog, * are multiple redeclarations, all the fields except uses_gl_fragcoord * are already known to be the same. */ - if (shader->info.redeclares_gl_fragcoord || - shader->info.uses_gl_fragcoord) { - linked_shader->info.redeclares_gl_fragcoord = - shader->info.redeclares_gl_fragcoord; + if (shader->redeclares_gl_fragcoord || shader->info.uses_gl_fragcoord) { + redeclares_gl_fragcoord = shader->redeclares_gl_fragcoord; linked_shader->info.uses_gl_fragcoord = linked_shader->info.uses_gl_fragcoord || shader->info.uses_gl_fragcoord; |