ac/nir: restrict fmask lookup to image load intrinsics
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 18 Dec 2018 14:21:56 +0000 (15:21 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 20 Dec 2018 17:01:11 +0000 (18:01 +0100)
We don't ever want to do the fmask lookup on a atomic or
store, the fmask should have been decompressed if the
surface has been moved to IMAGE_LAYOUT.

Original patch by Dave Airlie.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index 81b76f65b8247958e65ccd638ac76e2081b53c4f..6d97212b8058efb7b3e6ec18b4cd0bd547555efc 100644 (file)
@@ -2249,7 +2249,7 @@ static void get_image_coords(struct ac_nir_context *ctx,
        bool gfx9_1d = ctx->ac.chip_class >= GFX9 && dim == GLSL_SAMPLER_DIM_1D;
        count = image_type_to_components_count(dim, is_array);
 
-       if (is_ms) {
+       if (is_ms && instr->intrinsic == nir_intrinsic_image_deref_load) {
                LLVMValueRef fmask_load_address[3];
                int chan;