nir: Add compute shader shared variable storage class
Previously we were receiving shared variable accesses via a lowered intrinsic function from glsl. This change allows us to send in variables instead. For example, when converting from SPIR-V. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
@@ -39,6 +39,7 @@ nir_shader_create(void *mem_ctx,
|
||||
exec_list_make_empty(&shader->uniforms);
|
||||
exec_list_make_empty(&shader->inputs);
|
||||
exec_list_make_empty(&shader->outputs);
|
||||
exec_list_make_empty(&shader->shared);
|
||||
|
||||
shader->options = options;
|
||||
memset(&shader->info, 0, sizeof(shader->info));
|
||||
@@ -136,6 +137,11 @@ nir_shader_add_variable(nir_shader *shader, nir_variable *var)
|
||||
exec_list_push_tail(&shader->uniforms, &var->node);
|
||||
break;
|
||||
|
||||
case nir_var_shared:
|
||||
assert(shader->stage == MESA_SHADER_COMPUTE);
|
||||
exec_list_push_tail(&shader->shared, &var->node);
|
||||
break;
|
||||
|
||||
case nir_var_system_value:
|
||||
exec_list_push_tail(&shader->system_values, &var->node);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user