r600g/llvm: Fix texelFetchOffset-2D
authorVincent Lejeune <vljn@ovi.com>
Sat, 18 May 2013 20:22:41 +0000 (22:22 +0200)
committerVincent Lejeune <vljn@ovi.com>
Mon, 20 May 2013 18:23:14 +0000 (20:23 +0200)
src/gallium/drivers/r600/r600_llvm.c

index 3d2c492773c86ad06bcb7352d9e8a2b1939ea44f..c1809b30cdd2abb025e316a4d0d15e855a255967 100644 (file)
@@ -460,6 +460,12 @@ static void llvm_emit_tex(
        for (c = 1; c < emit_data->arg_count; ++c)
                args[c] = emit_data->args[c];
 
+       if (emit_data->inst->Instruction.Opcode == TGSI_OPCODE_TXF) {
+               args[1] = LLVMBuildShl(gallivm->builder, args[1], lp_build_const_int32(gallivm, 1), "");
+               args[2] = LLVMBuildShl(gallivm->builder, args[2], lp_build_const_int32(gallivm, 1), "");
+               args[3] = LLVMBuildShl(gallivm->builder, args[3], lp_build_const_int32(gallivm, 1), "");
+       }
+
        sampler_src = emit_data->inst->Instruction.NumSrcRegs-1;
 
        args[c++] = lp_build_const_int32(gallivm,