mesa/glsl: move origin_upper_left to gl_shader
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 22 Nov 2016 07:50:03 +0000 (18:50 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Thu, 19 Jan 2017 06:05:26 +0000 (17:05 +1100)
This is only used by gl_linked_shader as a temp during linking
so use a temp there instead.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/compiler/glsl/glsl_parser_extras.cpp
src/compiler/glsl/linker.cpp
src/mesa/main/mtypes.h

index afb7260dddacef4ded8def02d8d21d90fc4d0934..fe494235066b097f319e942580dfc9a347a93f53 100644 (file)
@@ -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;
index 332455430a25965737dacfaac428d37054dae6d3..6db48f9808b58917b726078b7020dccb4f45d75a 100644 (file)
@@ -1828,7 +1828,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 ||
@@ -1858,8 +1858,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 "
@@ -1874,8 +1873,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;
       }
index 5548827a992d1b767a14266338c699c39c7300af..cf06674ebfeec22a16be69da57cb9761ae6a6742 100644 (file)
@@ -2245,10 +2245,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 {
@@ -2436,6 +2432,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;
 };