ac/nir: Make intrinsic_name buffer long enough
authorJames Legg <jlegg@feralinteractive.com>
Fri, 23 Jun 2017 10:18:56 +0000 (11:18 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 28 Jun 2017 19:05:04 +0000 (21:05 +0200)
When using cmpswap on an image, it was being trunctated to
lvm.amdgcn.image.atomic.cmpswa, with the coords type missing entirely.

v2: Add stable CC

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index 8877c2241d42e8d819530ee087aa8fcd541c18df..b5c6848bf5912c5bbc9f1c485f03153356e41bb2 100644 (file)
@@ -3397,7 +3397,7 @@ static LLVMValueRef visit_image_atomic(struct nir_to_llvm_context *ctx,
        const char *base_name = "llvm.amdgcn.image.atomic";
        const char *atomic_name;
        LLVMValueRef coords;
-       char intrinsic_name[32], coords_type[8];
+       char intrinsic_name[41], coords_type[8];
        const struct glsl_type *type = glsl_without_array(var->type);
 
        if (ctx->stage == MESA_SHADER_FRAGMENT)