This one is always a size in bytes.
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6524>
shader->num_inputs = 0;
shader->num_outputs = 0;
shader->num_uniforms = 0;
- shader->num_shared = 0;
+ shader->shared_size = 0;
return shader;
}
* the highest index a load_input_*, load_uniform_*, etc. intrinsic can
* access plus one
*/
- unsigned num_inputs, num_uniforms, num_outputs, num_shared;
+ unsigned num_inputs, num_uniforms, num_outputs;
+
+ /** Size in bytes of required shared memory */
+ unsigned shared_size;
/** Size in bytes of required scratch space */
unsigned scratch_size;
ns->num_inputs = s->num_inputs;
ns->num_uniforms = s->num_uniforms;
ns->num_outputs = s->num_outputs;
- ns->num_shared = s->num_shared;
+ ns->shared_size = s->shared_size;
ns->scratch_size = s->scratch_size;
ns->constant_data_size = s->constant_data_size;
break;
case nir_var_mem_shared:
shader->info.cs.shared_size = offset;
- shader->num_shared = offset;
+ shader->shared_size = offset;
break;
default:
unreachable("Unsupported mode");
fprintf(fp, "uniforms: %u\n", shader->num_uniforms);
if (shader->info.num_ubos)
fprintf(fp, "ubos: %u\n", shader->info.num_ubos);
- fprintf(fp, "shared: %u\n", shader->num_shared);
+ fprintf(fp, "shared: %u\n", shader->shared_size);
if (shader->scratch_size)
fprintf(fp, "scratch: %u\n", shader->scratch_size);
if (shader->constant_data_size)
blob_write_uint32(blob, nir->num_inputs);
blob_write_uint32(blob, nir->num_uniforms);
blob_write_uint32(blob, nir->num_outputs);
- blob_write_uint32(blob, nir->num_shared);
+ blob_write_uint32(blob, nir->shared_size);
blob_write_uint32(blob, nir->scratch_size);
blob_write_uint32(blob, exec_list_length(&nir->functions));
ctx.nir->num_inputs = blob_read_uint32(blob);
ctx.nir->num_uniforms = blob_read_uint32(blob);
ctx.nir->num_outputs = blob_read_uint32(blob);
- ctx.nir->num_shared = blob_read_uint32(blob);
+ ctx.nir->shared_size = blob_read_uint32(blob);
ctx.nir->scratch_size = blob_read_uint32(blob);
unsigned num_functions = blob_read_uint32(blob);
char **error_str)
{
prog_data->base.total_shared = src_shader->info.cs.shared_size;
- prog_data->slm_size = src_shader->num_shared;
+ prog_data->slm_size = src_shader->shared_size;
/* Generate code for all the possible SIMD variants. */
bool generate_all;