mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
pco: add write memory check before processing nir
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
parent
75cea0ceee
commit
e3195c5a70
1 changed files with 11 additions and 0 deletions
|
|
@ -462,6 +462,14 @@ static void pco_nir_opt(pco_ctx *ctx, nir_shader *nir)
|
|||
} while (progress);
|
||||
}
|
||||
|
||||
static bool check_mem_writes(nir_builder *b,
|
||||
nir_intrinsic_instr *intr,
|
||||
UNUSED void *cb_data)
|
||||
{
|
||||
b->shader->info.writes_memory |= nir_intrinsic_writes_external_memory(intr);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Runs pre-processing passes on a NIR shader.
|
||||
*
|
||||
|
|
@ -470,6 +478,9 @@ static void pco_nir_opt(pco_ctx *ctx, nir_shader *nir)
|
|||
*/
|
||||
void pco_preprocess_nir(pco_ctx *ctx, nir_shader *nir)
|
||||
{
|
||||
if (nir->info.stage == MESA_SHADER_FRAGMENT)
|
||||
nir_shader_intrinsics_pass(nir, check_mem_writes, nir_metadata_all, NULL);
|
||||
|
||||
if (nir->info.stage == MESA_SHADER_COMPUTE)
|
||||
NIR_PASS(_, nir, pco_nir_compute_instance_check);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue