nir: Extract shader_info->cs.shared_size out of union.

It is valid for all stages, just 0 for most of them. In particular
mesh/task shaders might be using it.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10094>
This commit is contained in:
Bas Nieuwenhuizen
2021-04-08 12:30:14 +02:00
committed by Marge Bot
parent afd2f489d3
commit 580f1ac473
25 changed files with 44 additions and 44 deletions

View File

@@ -2288,7 +2288,7 @@ lower_vars_to_explicit(nir_shader *shader,
shader->scratch_size = offset;
break;
case nir_var_mem_shared:
shader->info.cs.shared_size = offset;
shader->info.shared_size = offset;
shader->shared_size = offset;
break;
case nir_var_mem_constant:

View File

@@ -1629,7 +1629,7 @@ nir_print_shader_annotated(nir_shader *shader, FILE *fp,
shader->info.cs.local_size[1],
shader->info.cs.local_size[2],
shader->info.cs.local_size_variable ? " (variable)" : "");
fprintf(fp, "shared-size: %u\n", shader->info.cs.shared_size);
fprintf(fp, "shared-size: %u\n", shader->info.shared_size);
}
fprintf(fp, "inputs: %u\n", shader->num_inputs);

View File

@@ -183,6 +183,11 @@ typedef struct shader_info {
/* SPV_KHR_float_controls: execution mode for floating point ops */
uint16_t float_controls_execution_mode;
/**
* Size of shared variables accessed by compute/task/mesh shaders.
*/
unsigned shared_size;
uint16_t inlinable_uniform_dw_offsets[MAX_INLINABLE_UNIFORMS];
uint8_t num_inlinable_uniforms:4;
@@ -377,11 +382,6 @@ typedef struct shader_info {
bool zero_initialize_shared_memory;
/**
* Size of shared variables accessed by the compute shader.
*/
unsigned shared_size;
/**
* pointer size is:
* AddressingModelLogical: 0 (default)

View File

@@ -6066,7 +6066,7 @@ spirv_to_nir(const uint32_t *words, size_t word_count,
const bool align_to_stride = false;
size = MAX2(size, glsl_get_explicit_size(var->type, align_to_stride));
}
b->shader->info.cs.shared_size = size;
b->shader->info.shared_size = size;
b->shader->shared_size = size;
}