Commit 51d56001 authored by Jesse Natalie's avatar Jesse Natalie Committed by Erik Faye-Lund

FORK ONLY: nir_lower_io: Deal with shader_in and non-merged variable list

parent 17b9f908
......@@ -1668,6 +1668,7 @@ lower_vars_to_explicit(nir_shader *shader,
unsigned offset;
switch (mode) {
case nir_var_uniform:
case nir_var_shader_in:
assert(shader->info.stage == MESA_SHADER_KERNEL);
offset = 0;
break;
......@@ -1685,6 +1686,9 @@ lower_vars_to_explicit(nir_shader *shader,
unreachable("Unsupported mode");
}
nir_foreach_variable(var, vars) {
if (var->data.mode != mode)
continue;
unsigned size, align;
const struct glsl_type *explicit_type =
glsl_get_explicit_type_for_size_align(var->type, type_info, &size, &align);
......@@ -1699,6 +1703,7 @@ lower_vars_to_explicit(nir_shader *shader,
switch (mode) {
case nir_var_uniform:
case nir_var_shader_in:
assert(shader->info.stage == MESA_SHADER_KERNEL);
shader->num_uniforms = offset;
break;
......@@ -1731,14 +1736,18 @@ nir_lower_vars_to_explicit_types(nir_shader *shader,
* - interface types
*/
ASSERTED nir_variable_mode supported =
nir_var_mem_shared | nir_var_mem_global |
nir_var_shader_temp | nir_var_function_temp | nir_var_uniform;
nir_var_mem_shared | nir_var_mem_global | nir_var_mem_constant |
nir_var_shader_temp | nir_var_function_temp | nir_var_uniform | nir_var_shader_in;
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);
progress |= lower_vars_to_explicit(shader, &shader->uniforms, nir_var_uniform, type_info);
if (modes & nir_var_mem_constant)
progress |= lower_vars_to_explicit(shader, &shader->uniforms, nir_var_mem_constant, type_info);
if (modes & nir_var_shader_in)
progress |= lower_vars_to_explicit(shader, &shader->inputs, nir_var_shader_in, 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