mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
nir: gather tess.tcs_cross_invocation info from lowered IO intrinsics
Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6758>
This commit is contained in:
parent
10be706778
commit
abe9588ff0
1 changed files with 21 additions and 0 deletions
|
|
@ -25,6 +25,17 @@
|
||||||
#include "nir_deref.h"
|
#include "nir_deref.h"
|
||||||
#include "main/menums.h"
|
#include "main/menums.h"
|
||||||
|
|
||||||
|
static bool
|
||||||
|
src_is_invocation_id(const nir_src *src)
|
||||||
|
{
|
||||||
|
assert(src->is_ssa);
|
||||||
|
if (src->parent_instr->type != nir_instr_type_intrinsic)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return nir_instr_as_intrinsic(src->parent_instr)->intrinsic ==
|
||||||
|
nir_intrinsic_load_invocation_id;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_deref_info(nir_shader *shader, nir_variable *var, nir_deref_instr *deref,
|
get_deref_info(nir_shader *shader, nir_variable *var, nir_deref_instr *deref,
|
||||||
bool *cross_invocation, bool *indirect)
|
bool *cross_invocation, bool *indirect)
|
||||||
|
|
@ -367,6 +378,11 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader,
|
||||||
if (!nir_src_is_const(*nir_get_io_offset_src(instr)))
|
if (!nir_src_is_const(*nir_get_io_offset_src(instr)))
|
||||||
shader->info.inputs_read_indirectly |= slot_mask;
|
shader->info.inputs_read_indirectly |= slot_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shader->info.stage == MESA_SHADER_TESS_CTRL &&
|
||||||
|
instr->intrinsic == nir_intrinsic_load_per_vertex_input &&
|
||||||
|
!src_is_invocation_id(nir_get_io_vertex_index_src(instr)))
|
||||||
|
shader->info.tess.tcs_cross_invocation_inputs_read |= slot_mask;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case nir_intrinsic_load_output:
|
case nir_intrinsic_load_output:
|
||||||
|
|
@ -381,6 +397,11 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, nir_shader *shader,
|
||||||
if (!nir_src_is_const(*nir_get_io_offset_src(instr)))
|
if (!nir_src_is_const(*nir_get_io_offset_src(instr)))
|
||||||
shader->info.outputs_accessed_indirectly |= slot_mask;
|
shader->info.outputs_accessed_indirectly |= slot_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shader->info.stage == MESA_SHADER_TESS_CTRL &&
|
||||||
|
instr->intrinsic == nir_intrinsic_load_per_vertex_output &&
|
||||||
|
!src_is_invocation_id(nir_get_io_vertex_index_src(instr)))
|
||||||
|
shader->info.tess.tcs_cross_invocation_outputs_read |= slot_mask;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case nir_intrinsic_store_output:
|
case nir_intrinsic_store_output:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue