[Mesa-dev] [PATCH 57/70] st/mesa/glsl: set early_fragment_tests directly in shader_info
Timothy Arceri
timothy.arceri at collabora.com
Tue Dec 20 10:38:07 UTC 2016
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 4566aa9..9138133 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 9fe7278..337fa17 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 407e11a..a05ea60 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2310,12 +2310,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.
*/
@@ -2428,6 +2422,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 d97c594..b03503e 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -2207,7 +2207,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 193e450..0ba83f4 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -6118,7 +6118,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