summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>2021-05-05 09:34:46 -0700
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>2021-06-08 09:23:55 -0700
commitb5f6fc442c1014e2e05f752d971a2276ae6cd13e (patch)
treeb58a78aefe87436a331869c6cc0dee6a6b470c02 /src/compiler
parent7b13c1461d7bb1a976f56717bf5b26b9dc82642b (diff)
nir: Move zero_initialize_shared_memory into common shader_info
Move it out the "cs" sub-struct, since the bit will be used for other shader stages in the future. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11225>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/shader_info.h7
-rw-r--r--src/compiler/spirv/vtn_variables.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h
index b1800226c23..7c18e565433 100644
--- a/src/compiler/shader_info.h
+++ b/src/compiler/shader_info.h
@@ -254,6 +254,11 @@ typedef struct shader_info {
*/
bool shared_memory_explicit_layout:1;
+ /**
+ * Used for VK_KHR_zero_initialize_workgroup_memory.
+ */
+ bool zero_initialize_shared_memory:1;
+
union {
struct {
/* Which inputs are doubles */
@@ -396,8 +401,6 @@ typedef struct shader_info {
*/
enum gl_derivative_group derivative_group:2;
- bool zero_initialize_shared_memory;
-
/**
* pointer size is:
* AddressingModelLogical: 0 (default)
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index a93d3d52067..cc49564a20c 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1960,7 +1960,7 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
"as initializer, but have %u instead",
vtn_id_for_value(b, val),
vtn_id_for_value(b, initializer));
- b->shader->info.cs.zero_initialize_shared_memory = true;
+ b->shader->info.zero_initialize_shared_memory = true;
break;
case SpvStorageClassUniformConstant: