[Mesa-dev] [PATCH 03/14] st/mesa/glsl: set early_fragment_tests directly in shader_info
Timothy Arceri
timothy.arceri at collabora.com
Tue Nov 22 23:22:38 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 4f76815..0efcfe9 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->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->BlendSupport = state->fs_blend_support;
break;
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index cec4cab..a98ffc0 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->Program->sh.fs.BlendSupport |= shader->BlendSupport;
}
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 93a70b4..a149d0a 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2308,12 +2308,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.
*/
@@ -2420,6 +2414,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 6740f9a..9d2fdde 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -2200,7 +2200,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;
break;
}
case MESA_SHADER_COMPUTE: {
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index c5ba53a..c66eae9 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -6098,7 +6098,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.7.4
More information about the mesa-dev
mailing list