[Mesa-dev] [PATCH 12/25] st/mesa/glsl: set early_fragment_tests directly in shader_info

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


We also move EarlyFragmentTests out of the gl_shader_info struct
as it is now only used by gl_shader.
---
 src/compiler/glsl/glsl_parser_extras.cpp   |  2 +-
 src/compiler/glsl/linker.cpp               |  4 ++--
 src/mesa/main/mtypes.h                     | 12 ++++++------
 src/mesa/main/shaderapi.c                  |  1 -
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp |  2 +-
 5 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index 1b84876..2b4dce0 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -1815,7 +1815,7 @@ set_shader_inout_layout(struct gl_shader *shader,
       shader->info.origin_upper_left = state->fs_origin_upper_left;
       shader->info.ARB_fragment_coord_conventions_enable =
          state->ARB_fragment_coord_conventions_enable;
-      shader->info.EarlyFragmentTests = state->fs_early_fragment_tests;
+      shader->EarlyFragmentTests = state->fs_early_fragment_tests;
       shader->info.InnerCoverage = state->fs_inner_coverage;
       shader->info.PostDepthCoverage = state->fs_post_depth_coverage;
       shader->BlendSupport = state->fs_blend_support;
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index 9f86aae..7479fa8 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -1886,8 +1886,8 @@ link_fs_inout_layout_qualifiers(struct gl_shader_program *prog,
             shader->info.pixel_center_integer;
       }
 
-      linked_shader->info.EarlyFragmentTests |=
-         shader->info.EarlyFragmentTests;
+      linked_shader->Program->info.fs.early_fragment_tests |=
+         shader->EarlyFragmentTests;
       linked_shader->info.InnerCoverage |=
          shader->info.InnerCoverage;
       linked_shader->Program->info.fs.post_depth_coverage |=
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 960efea..2e4e270 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2312,12 +2312,6 @@ struct gl_shader_info
    } Geom;
 
    /**
-    * Whether early fragment tests are enabled as defined by
-    * ARB_shader_image_load_store.
-    */
-   bool EarlyFragmentTests;
-
-   /**
     * Compute shader state from ARB_compute_shader and
     * ARB_compute_variable_group_size layout qualifiers.
     */
@@ -2430,6 +2424,12 @@ struct gl_shader
     */
    GLbitfield BlendSupport;
 
+   /**
+    * Whether early fragment tests are enabled as defined by
+    * ARB_shader_image_load_store.
+    */
+   bool EarlyFragmentTests;
+
    struct gl_shader_info info;
 };
 
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 442e1a8..a987536 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -2222,7 +2222,6 @@ _mesa_copy_linked_program_data(const struct gl_shader_program *src,
    }
    case MESA_SHADER_FRAGMENT: {
       dst->info.fs.depth_layout = src->FragDepthLayout;
-      dst->info.fs.early_fragment_tests = dst_sh->info.EarlyFragmentTests;
       dst->info.fs.inner_coverage = dst_sh->info.InnerCoverage;
       dst->info.fs.post_depth_coverage = dst_sh->info.PostDepthCoverage;
       break;
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index bc00a4e..545e0b7 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -6142,7 +6142,7 @@ st_translate_program(
    }
 
    if (procType == PIPE_SHADER_FRAGMENT) {
-      if (program->shader->info.EarlyFragmentTests)
+      if (program->shader->Program->info.fs.early_fragment_tests)
          ureg_property(ureg, TGSI_PROPERTY_FS_EARLY_DEPTH_STENCIL, 1);
 
       if (proginfo->info.inputs_read & VARYING_BIT_POS) {
-- 
2.9.3



More information about the mesa-dev mailing list