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
+3 -3
View File
@@ -637,9 +637,9 @@ union packed_instr {
unsigned instr_type:4;
unsigned deref_type:3;
unsigned cast_type_same_as_last:1;
unsigned modes:12; /* deref_var redefines this */
unsigned modes:14; /* deref_var redefines this */
unsigned packed_src_ssa_16bit:1; /* deref_var redefines this */
unsigned _pad:3; /* deref_var redefines this */
unsigned _pad:1; /* deref_var redefines this */
unsigned dest:8;
} deref;
struct {
@@ -984,7 +984,7 @@ static void
write_deref(write_ctx *ctx, const nir_deref_instr *deref)
{
assert(deref->deref_type < 8);
assert(deref->modes < (1 << 12));
assert(deref->modes < (1 << 14));
union packed_instr header;
header.u32 = 0;