[Mesa-dev] [PATCH 1/2] r600/llvm: Fix texbuf for pre EG gen
Tom Stellard
tom at stellard.net
Tue Oct 22 00:48:36 CEST 2013
On Mon, Oct 21, 2013 at 10:02:12PM +0200, Vincent Lejeune wrote:
Can you add an explanation to the commit messages for both patches about
what was wrong with the old code?
Thanks,
Tom
> ---
> src/gallium/drivers/r600/r600_llvm.c | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/src/gallium/drivers/r600/r600_llvm.c b/src/gallium/drivers/r600/r600_llvm.c
> index 34dd3ad..d7fa5f8 100644
> --- a/src/gallium/drivers/r600/r600_llvm.c
> +++ b/src/gallium/drivers/r600/r600_llvm.c
> @@ -427,6 +427,35 @@ static void llvm_emit_tex(
> emit_data->output[0] = build_intrinsic(gallivm->builder,
> "llvm.R600.load.texbuf",
> emit_data->dst_type, args, 2, LLVMReadNoneAttribute);
> + if (ctx->chip_class >= EVERGREEN)
> + return;
> + ctx->uses_tex_buffers = true;
> + LLVMDumpValue(emit_data->output[0]);
> + emit_data->output[0] = LLVMBuildBitCast(gallivm->builder,
> + emit_data->output[0], LLVMVectorType(bld_base->base.int_elem_type, 4),
> + "");
> + LLVMValueRef Mask = llvm_load_const_buffer(bld_base,
> + lp_build_const_int32(gallivm, 0),
> + LLVM_R600_BUFFER_INFO_CONST_BUFFER);
> + Mask = LLVMBuildBitCast(gallivm->builder, Mask,
> + LLVMVectorType(bld_base->base.int_elem_type, 4), "");
> + emit_data->output[0] = lp_build_emit_llvm_binary(bld_base, TGSI_OPCODE_AND,
> + emit_data->output[0],
> + Mask);
> + LLVMValueRef WComponent = LLVMBuildExtractElement(gallivm->builder,
> + emit_data->output[0], lp_build_const_int32(gallivm, 3), "");
> + Mask = llvm_load_const_buffer(bld_base, lp_build_const_int32(gallivm, 1),
> + LLVM_R600_BUFFER_INFO_CONST_BUFFER);
> + Mask = LLVMBuildExtractElement(gallivm->builder, Mask,
> + lp_build_const_int32(gallivm, 0), "");
> + Mask = LLVMBuildBitCast(gallivm->builder, Mask,
> + bld_base->base.int_elem_type, "");
> + WComponent = lp_build_emit_llvm_binary(bld_base, TGSI_OPCODE_OR,
> + WComponent, Mask);
> + emit_data->output[0] = LLVMBuildInsertElement(gallivm->builder,
> + emit_data->output[0], WComponent, lp_build_const_int32(gallivm, 3), "");
> + emit_data->output[0] = LLVMBuildBitCast(gallivm->builder,
> + emit_data->output[0], LLVMVectorType(bld_base->base.elem_type, 4), "");
> }
> return;
> default:
> --
> 1.8.3.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list