ac/nir: fix a crash in load_gs_input() on pre-GFX9 chips
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 2 Feb 2018 17:56:39 +0000 (18:56 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 5 Feb 2018 10:05:52 +0000 (11:05 +0100)
Fixes: df1d5174fcc ("ac/nir: replace SI.buffer.load.dword with amdgcn.buffer.load")
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 cfcd21790948d9ff5979debed31e61c84d943b1a..fb29b6c46f0f8f66d70fc83f84ce1033ed14d4c2 100644 (file)
@@ -3074,6 +3074,9 @@ load_gs_input(struct ac_shader_abi *abi,
                                                        ctx->ac.i32_0,
                                                        vtx_offset, soffset,
                                                        0, 1, 0, true, false);
+
+                       value[i] = LLVMBuildBitCast(ctx->builder, value[i],
+                                                   type, "");
                }
        }
        result = ac_build_varying_gather_values(&ctx->ac, value, num_components, component);