ac/nir: Remove gfx9_stride_size_workaround_for_atomic
[mesa.git] / src / amd / common / ac_nir_to_llvm.c
index e71c8f1fee9c4f16a03d0855da22877a7e45976c..d4b30e4a330dc83499934e530b6b9b80f940d62b 100644 (file)
@@ -2503,7 +2503,7 @@ static LLVMValueRef get_image_buffer_descriptor(struct ac_nir_context *ctx,
                                                bool write, bool atomic)
 {
        LLVMValueRef rsrc = get_image_descriptor(ctx, instr, AC_DESC_BUFFER, write);
-       if (ctx->abi->gfx9_stride_size_workaround_for_atomic && atomic) {
+       if (ctx->ac.chip_class == GFX9 && HAVE_LLVM < 0x900 && atomic) {
                LLVMValueRef elem_count = LLVMBuildExtractElement(ctx->ac.builder, rsrc, LLVMConstInt(ctx->ac.i32, 2, 0), "");
                LLVMValueRef stride = LLVMBuildExtractElement(ctx->ac.builder, rsrc, LLVMConstInt(ctx->ac.i32, 1, 0), "");
                stride = LLVMBuildLShr(ctx->ac.builder, stride, LLVMConstInt(ctx->ac.i32, 16, 0), "");