ac/llvm: ignore g16 if the image opcode doesn't use derivatives
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 19 Oct 2022 17:34:12 +0000 (18:34 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 21 Oct 2022 19:09:49 +0000 (19:09 +0000)
g16 is irrelevant in this case.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19198>

src/amd/llvm/ac_llvm_build.c

index 6bdfb27..3f7159b 100644 (file)
@@ -2139,7 +2139,7 @@ LLVMValueRef ac_build_image_opcode(struct ac_llvm_context *ctx, struct ac_image_
                       a->opcode != ac_image_atomic_cmpswap && a->opcode != ac_image_get_lod &&
                       a->opcode != ac_image_get_resinfo));
    assert(!a->a16 || ctx->gfx_level >= GFX9);
-   assert(a->g16 == a->a16 || ctx->gfx_level >= GFX10);
+   assert(!a->derivs[0] || a->g16 == a->a16 || ctx->gfx_level >= GFX10);
 
    assert(!a->offset ||
           ac_get_elem_bits(ctx, LLVMTypeOf(a->offset)) == 32);