summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600
diff options
context:
space:
mode:
authorVadim Girlin <[email protected]>2012-05-25 17:27:23 +0400
committerVadim Girlin <[email protected]>2012-05-25 17:27:23 +0400
commit7fa7c608cb3cb1105587eab793aaf4ff647a565b (patch)
tree411c72b32286bf303c7f136a2980c27409fac7ed /src/gallium/drivers/r600
parent029776753b69dc6054cabd8c2cc07c981ab20616 (diff)
radeon/llvm: fix sampler index in llvm_emit_tex
Sampler index isn't a second source operand for some tgsi texture instructions. Let's assume it's always the last. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50230 Signed-off-by: Vadim Girlin <[email protected]> Reviewed-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r--src/gallium/drivers/r600/r600_llvm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/r600/r600_llvm.c b/src/gallium/drivers/r600/r600_llvm.c
index 2ca838f87fa..5e073e0d3af 100644
--- a/src/gallium/drivers/r600/r600_llvm.c
+++ b/src/gallium/drivers/r600/r600_llvm.c
@@ -144,15 +144,17 @@ static void llvm_emit_tex(
{
struct gallivm_state * gallivm = bld_base->base.gallivm;
LLVMValueRef args[6];
- unsigned c;
+ unsigned c, sampler_src;
assert(emit_data->arg_count + 2 <= Elements(args));
for (c = 0; c < emit_data->arg_count; ++c)
args[c] = emit_data->args[c];
+ sampler_src = emit_data->inst->Instruction.NumSrcRegs-1;
+
args[c++] = lp_build_const_int32(gallivm,
- emit_data->inst->Src[1].Register.Index);
+ emit_data->inst->Src[sampler_src].Register.Index);
args[c++] = lp_build_const_int32(gallivm,
emit_data->inst->Texture.Texture);