nir/lower_io: Allow ray_hit_attrib in lower_vars_to_explicit_types

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7356>
This commit is contained in:
Jason Ekstrand 2020-07-28 18:01:41 -05:00 committed by Marge Bot
parent bbbb0600f6
commit 477d2f0379
1 changed files with 9 additions and 1 deletions

View File

@ -2240,6 +2240,9 @@ lower_vars_to_explicit(nir_shader *shader,
case nir_var_mem_constant:
offset = shader->constant_data_size;
break;
case nir_var_ray_hit_attrib:
offset = 0;
break;
default:
unreachable("Unsupported mode");
}
@ -2276,6 +2279,8 @@ lower_vars_to_explicit(nir_shader *shader,
case nir_var_mem_constant:
shader->constant_data_size = offset;
break;
case nir_var_ray_hit_attrib:
break;
default:
unreachable("Unsupported mode");
}
@ -2299,7 +2304,8 @@ nir_lower_vars_to_explicit_types(nir_shader *shader,
*/
ASSERTED nir_variable_mode supported =
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_temp | nir_var_function_temp | nir_var_uniform |
nir_var_ray_hit_attrib;
assert(!(modes & ~supported) && "unsupported");
bool progress = false;
@ -2312,6 +2318,8 @@ nir_lower_vars_to_explicit_types(nir_shader *shader,
progress |= lower_vars_to_explicit(shader, &shader->variables, nir_var_shader_temp, type_info);
if (modes & nir_var_mem_constant)
progress |= lower_vars_to_explicit(shader, &shader->variables, nir_var_mem_constant, type_info);
if (modes & nir_var_ray_hit_attrib)
progress |= lower_vars_to_explicit(shader, &shader->variables, nir_var_ray_hit_attrib, type_info);
nir_foreach_function(function, shader) {
if (function->impl) {