summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2013-02-06 15:43:10 +0100
committerMichel Dänzer <[email protected]>2013-02-07 19:07:43 +0100
commit07eddc444c2cb49180f2fbca6b189788839fc117 (patch)
tree2419ec0a2ca444793187bc44c79cd3ed315a1c06 /src/gallium/drivers
parent74a17a764dc2ad20d9d6f56afee963b23b597132 (diff)
radeonsi: Use unique names for referring to texture sampling intrinsics.
Append the overloaded vector type used for passing in the addressing parameters. Without this, LLVM uses the same function signature for all those types, which cannot work. Fixes problems e.g. with FlightGear and Red Eclipse.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeonsi/radeonsi_shader.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c
index e6395663711..2d640f245b2 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_shader.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c
@@ -940,21 +940,36 @@ static void tex_fetch_args(
4);
}
+static void build_tex_intrinsic(const struct lp_build_tgsi_action * action,
+ struct lp_build_tgsi_context * bld_base,
+ struct lp_build_emit_data * emit_data)
+{
+ struct lp_build_context * base = &bld_base->base;
+ char intr_name[23];
+
+ sprintf(intr_name, "%sv%ui32", action->intr_name,
+ LLVMGetVectorSize(LLVMTypeOf(emit_data->args[1])));
+
+ emit_data->output[emit_data->chan] = lp_build_intrinsic(
+ base->gallivm->builder, intr_name, emit_data->dst_type,
+ emit_data->args, emit_data->arg_count);
+}
+
static const struct lp_build_tgsi_action tex_action = {
.fetch_args = tex_fetch_args,
- .emit = lp_build_tgsi_intrinsic,
+ .emit = build_tex_intrinsic,
.intr_name = "llvm.SI.sample."
};
static const struct lp_build_tgsi_action txb_action = {
.fetch_args = tex_fetch_args,
- .emit = lp_build_tgsi_intrinsic,
+ .emit = build_tex_intrinsic,
.intr_name = "llvm.SI.sampleb."
};
static const struct lp_build_tgsi_action txl_action = {
.fetch_args = tex_fetch_args,
- .emit = lp_build_tgsi_intrinsic,
+ .emit = build_tex_intrinsic,
.intr_name = "llvm.SI.samplel."
};