[Mesa-dev] [PATCH 06/14] mesa/glsl: move uses_gl_fragcoord to gl_shader
Timothy Arceri
timothy.arceri at collabora.com
Tue Nov 22 23:22:41 UTC 2016
This is only used by gl_linked_shader as a temp during linking
so use a temp there instead.
---
src/compiler/glsl/glsl_parser_extras.cpp | 2 +-
src/compiler/glsl/linker.cpp | 12 +++++-------
src/mesa/main/mtypes.h | 3 +--
3 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index 7e62eaa..7d100bb 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -1805,7 +1805,7 @@ set_shader_inout_layout(struct gl_shader *shader,
case MESA_SHADER_FRAGMENT:
shader->redeclares_gl_fragcoord = state->fs_redeclares_gl_fragcoord;
- shader->info.uses_gl_fragcoord = state->fs_uses_gl_fragcoord;
+ shader->uses_gl_fragcoord = state->fs_uses_gl_fragcoord;
shader->info.pixel_center_integer = state->fs_pixel_center_integer;
shader->info.origin_upper_left = state->fs_origin_upper_left;
shader->ARB_fragment_coord_conventions_enable =
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index b31c055..5201005 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,
unsigned num_shaders)
{
bool redeclares_gl_fragcoord = false;
- linked_shader->info.uses_gl_fragcoord = false;
+ bool uses_gl_fragcoord = false;
linked_shader->info.origin_upper_left = false;
linked_shader->info.pixel_center_integer = false;
@@ -1844,9 +1844,9 @@ link_fs_inout_layout_qualifiers(struct gl_shader_program *prog,
* that have a static use gl_FragCoord."
*/
if ((redeclares_gl_fragcoord && !shader->redeclares_gl_fragcoord &&
- shader->info.uses_gl_fragcoord)
+ shader->uses_gl_fragcoord)
|| (shader->redeclares_gl_fragcoord && !redeclares_gl_fragcoord &&
- linked_shader->info.uses_gl_fragcoord)) {
+ uses_gl_fragcoord)) {
linker_error(prog, "fragment shader defined with conflicting "
"layout qualifiers for gl_FragCoord\n");
}
@@ -1870,11 +1870,9 @@ 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->redeclares_gl_fragcoord || shader->info.uses_gl_fragcoord) {
+ if (shader->redeclares_gl_fragcoord || shader->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;
+ uses_gl_fragcoord |= shader->uses_gl_fragcoord;
linked_shader->info.origin_upper_left =
shader->info.origin_upper_left;
linked_shader->info.pixel_center_integer =
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index b8d9fcf..3882571 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2234,8 +2234,6 @@ struct gl_subroutine_function
*/
struct gl_shader_info
{
- bool uses_gl_fragcoord;
-
/**
* Fragment shader state from GLSL 1.50 layout qualifiers.
*/
@@ -2421,6 +2419,7 @@ struct gl_shader
bool ARB_fragment_coord_conventions_enable;
bool redeclares_gl_fragcoord;
+ bool uses_gl_fragcoord;
struct gl_shader_info info;
};
--
2.7.4
More information about the mesa-dev
mailing list