From 77be5b2f88d44a16c8f272a05f23b6c0a5971222 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Tue, 4 Jun 2019 14:12:34 +0200 Subject: [PATCH] nir: Use reorderable access flag No changes with radeonsi shader-db. Reviewed-by: Timothy Arceri --- src/compiler/nir/nir.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index bbe3fed70dd..203601cee2c 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1459,10 +1459,18 @@ void nir_rewrite_image_intrinsic(nir_intrinsic_instr *instr, static inline bool nir_intrinsic_can_reorder(nir_intrinsic_instr *instr) { - const nir_intrinsic_info *info = - &nir_intrinsic_infos[instr->intrinsic]; - return (info->flags & NIR_INTRINSIC_CAN_ELIMINATE) && - (info->flags & NIR_INTRINSIC_CAN_REORDER); + if (instr->intrinsic == nir_intrinsic_load_deref || + instr->intrinsic == nir_intrinsic_load_ssbo || + instr->intrinsic == nir_intrinsic_bindless_image_load || + instr->intrinsic == nir_intrinsic_image_deref_load || + instr->intrinsic == nir_intrinsic_image_load) { + return nir_intrinsic_access(instr) & ACCESS_CAN_REORDER; + } else { + const nir_intrinsic_info *info = + &nir_intrinsic_infos[instr->intrinsic]; + return (info->flags & NIR_INTRINSIC_CAN_ELIMINATE) && + (info->flags & NIR_INTRINSIC_CAN_REORDER); + } } /** -- 2.30.2