freedreno/ir3: fix resinfo wrmask
authorJonathan Marek <jonathan@marek.ca>
Sun, 28 Jun 2020 01:50:17 +0000 (21:50 -0400)
committerMarge Bot <eric+marge@anholt.net>
Sun, 28 Jun 2020 16:32:08 +0000 (16:32 +0000)
resinfo always writes 3 components, which was not being taken into account

Fixes these tests:
dEQP-VK.renderpass.suballocation.attachment_sparse_filling.input_attachment_3
dEQP-VK.renderpass.suballocation.attachment_sparse_filling.input_attachment_7

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5674>

src/freedreno/ir3/ir3_a6xx.c

index a8c6553a518081cb10465586188a2e6395b44631..b10e1b9502763b6bd1f9e4b58d1c51d9361eb9c0 100644 (file)
@@ -351,7 +351,9 @@ emit_intrinsic_image_size(struct ir3_context *ctx, nir_intrinsic_instr *intr,
        resinfo->cat6.d = intr->num_components;
        resinfo->cat6.type = TYPE_U32;
        resinfo->cat6.typed = false;
-       resinfo->regs[0]->wrmask = MASK(intr->num_components);
+       /* resinfo has no writemask and always writes out 3 components: */
+       compile_assert(ctx, intr->num_components <= 3);
+       resinfo->regs[0]->wrmask = MASK(3);
        ir3_handle_bindless_cat6(resinfo, intr->src[0]);
 
        ir3_split_dest(b, dst, resinfo, 0, intr->num_components);