st/mesa/glsl: set early_fragment_tests directly in shader_info
authorTimothy Arceri <timothy.arceri@collabora.com>
Tue, 22 Nov 2016 02:10:18 +0000 (13:10 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Thu, 19 Jan 2017 06:05:26 +0000 (17:05 +1100)
We also move EarlyFragmentTests out of the gl_shader_info struct
as it is now only used by gl_shader.

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
src/mesa/main/shaderapi.c
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 1b84876079d682ae20b7a41659ce7cb7e61bc726..2b4dce0d359044ed04e30249e430a3e3518baefa 100644 (file)
@@ -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;
index 7073eac9d918e30b9c8db721551c5f25d17ba664..9e85155b6da298b4d1b51ce6cafaba466c0088b4 100644 (file)
@@ -1887,8 +1887,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 |=
index f123142dc5c12c58fc43907f64f6e9970969be8b..94fc6e97f47c8f5f7eac7f5372429c58a80d61b9 100644 (file)
@@ -2315,12 +2315,6 @@ struct gl_shader_info
       GLenum OutputType;
    } 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.
@@ -2434,6 +2428,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;
 };
 
index 3502cb2ee606042cdfb84495153dd089622689c0..80cac37e8ecf1ad99898896c44ca7641a6b05b91 100644 (file)
@@ -2232,7 +2232,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;
index 4bdb3a6532ee737aaa10f5f288cd416196d2fd26..a99e99178c67b1423b89a64e37ff442919d2556d 100644 (file)
@@ -6151,7 +6151,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) {