nir: Add new variable modes for ray-tracing

If we were desperate to reduce bits, we could probably also use
shader_in/out for hit attributes as they really are an output from
intersection shaders and read-only in any-hit and closest-hit shaders.
However, other passes such as nir_gether_info like to assume that
anything with nir_var_shader_in/out is indexed using vec4 locations for
interface matching.  It's easier to just add a new variable mode.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6479>
This commit is contained in:
Jason Ekstrand
2020-07-29 14:00:29 -05:00
committed by Marge Bot
parent aa4ea9c7ea
commit 84a8ca1db8
6 changed files with 33 additions and 5 deletions

View File

@@ -473,6 +473,10 @@ get_variable_mode_str(nir_variable_mode mode, bool want_local_global_mode)
return want_local_global_mode ? "shader_temp" : "";
case nir_var_function_temp:
return want_local_global_mode ? "function_temp" : "";
case nir_var_shader_call_data:
return "shader_call_data";
case nir_var_ray_hit_attrib:
return "ray_hit_attrib";
default:
return "";
}