[Mesa-dev] [PATCH 16/25] mesa/glsl: move origin_upper_left to gl_shader

Timothy Arceri timothy.arceri at collabora.com
Mon Jan 9 05:13:41 UTC 2017


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             | 8 +++-----
 src/mesa/main/mtypes.h                   | 9 +++++----
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index afb7260..fe49423 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -1811,7 +1811,7 @@ set_shader_inout_layout(struct gl_shader *shader,
       shader->redeclares_gl_fragcoord = state->fs_redeclares_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->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;
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 01c3aa3..0bcf745 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -1827,7 +1827,7 @@ link_fs_inout_layout_qualifiers(struct gl_shader_program *prog,
 {
    bool redeclares_gl_fragcoord = false;
    bool uses_gl_fragcoord = false;
-   linked_shader->info.origin_upper_left = false;
+   bool origin_upper_left = false;
    linked_shader->info.pixel_center_integer = false;
 
    if (linked_shader->Stage != MESA_SHADER_FRAGMENT ||
@@ -1857,8 +1857,7 @@ link_fs_inout_layout_qualifiers(struct gl_shader_program *prog,
        *    single program must have the same set of qualifiers."
        */
       if (redeclares_gl_fragcoord && shader->redeclares_gl_fragcoord &&
-          (shader->info.origin_upper_left !=
-           linked_shader->info.origin_upper_left ||
+          (shader->origin_upper_left != origin_upper_left ||
            shader->info.pixel_center_integer !=
            linked_shader->info.pixel_center_integer)) {
          linker_error(prog, "fragment shader defined with conflicting "
@@ -1873,8 +1872,7 @@ link_fs_inout_layout_qualifiers(struct gl_shader_program *prog,
       if (shader->redeclares_gl_fragcoord || shader->uses_gl_fragcoord) {
          redeclares_gl_fragcoord = shader->redeclares_gl_fragcoord;
          uses_gl_fragcoord |= shader->uses_gl_fragcoord;
-         linked_shader->info.origin_upper_left =
-            shader->info.origin_upper_left;
+         origin_upper_left = shader->origin_upper_left;
          linked_shader->info.pixel_center_integer =
             shader->info.pixel_center_integer;
       }
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 03c99c2..4edfaac 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2241,10 +2241,6 @@ struct gl_shader_info
    bool PostDepthCoverage;
    bool InnerCoverage;
 
-   /**
-    * Fragment shader state from GLSL 1.50 layout qualifiers.
-    */
-   bool origin_upper_left;
    bool pixel_center_integer;
 
    struct {
@@ -2432,6 +2428,11 @@ struct gl_shader
    bool redeclares_gl_fragcoord;
    bool uses_gl_fragcoord;
 
+   /**
+    * Fragment shader state from GLSL 1.50 layout qualifiers.
+    */
+   bool origin_upper_left;
+
    struct gl_shader_info info;
 };
 
-- 
2.9.3



More information about the mesa-dev mailing list