Commit 34472edc authored by Jason Ekstrand's avatar Jason Ekstrand Committed by Erik Faye-Lund
Browse files

nir: Allow uniform in nir_lower_vars_to_explicit_types


Reviewed-by: Jesse Natalie's avatarJesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon's avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Karol Herbst's avatarKarol Herbst <kherbst@redhat.com>
Part-of: <mesa/mesa!6472>
parent 5fd8d3e4
......@@ -1667,6 +1667,10 @@ lower_vars_to_explicit(nir_shader *shader,
bool progress = false;
unsigned offset;
switch (mode) {
case nir_var_uniform:
assert(shader->info.stage == MESA_SHADER_KERNEL);
offset = 0;
break;
case nir_var_function_temp:
case nir_var_shader_temp:
offset = shader->scratch_size;
......@@ -1694,6 +1698,10 @@ lower_vars_to_explicit(nir_shader *shader,
}
switch (mode) {
case nir_var_uniform:
assert(shader->info.stage == MESA_SHADER_KERNEL);
shader->num_uniforms = offset;
break;
case nir_var_shader_temp:
case nir_var_function_temp:
shader->scratch_size = offset;
......@@ -1724,11 +1732,13 @@ nir_lower_vars_to_explicit_types(nir_shader *shader,
*/
ASSERTED nir_variable_mode supported =
nir_var_mem_shared | nir_var_mem_global |
nir_var_shader_temp | nir_var_function_temp;
nir_var_shader_temp | nir_var_function_temp | nir_var_uniform;
assert(!(modes & ~supported) && "unsupported");
bool progress = false;
if (modes & nir_var_uniform)
progress |= lower_vars_to_explicit(shader, &shader->variables, nir_var_uniform, type_info);
if (modes & nir_var_mem_shared)
progress |= lower_vars_to_explicit(shader, &shader->shared, nir_var_mem_shared, type_info);
if (modes & nir_var_shader_temp)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment