radeonsi: clean up tex_fetch_ptrs()
Will also help when the src sampler register will be TGSI_FILE_CONSTANT for bindless. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
8a5680f248
commit
38ee3246d2
|
@ -4234,23 +4234,21 @@ static void tex_fetch_ptrs(
|
||||||
{
|
{
|
||||||
struct si_shader_context *ctx = si_shader_context(bld_base);
|
struct si_shader_context *ctx = si_shader_context(bld_base);
|
||||||
const struct tgsi_full_instruction *inst = emit_data->inst;
|
const struct tgsi_full_instruction *inst = emit_data->inst;
|
||||||
|
const struct tgsi_full_src_register *reg;
|
||||||
unsigned target = inst->Texture.Texture;
|
unsigned target = inst->Texture.Texture;
|
||||||
unsigned sampler_src;
|
unsigned sampler_src;
|
||||||
unsigned sampler_index;
|
|
||||||
LLVMValueRef index;
|
LLVMValueRef index;
|
||||||
|
|
||||||
sampler_src = emit_data->inst->Instruction.NumSrcRegs - 1;
|
sampler_src = emit_data->inst->Instruction.NumSrcRegs - 1;
|
||||||
sampler_index = emit_data->inst->Src[sampler_src].Register.Index;
|
reg = &emit_data->inst->Src[sampler_src];
|
||||||
|
|
||||||
if (emit_data->inst->Src[sampler_src].Register.Indirect) {
|
|
||||||
const struct tgsi_full_src_register *reg = &emit_data->inst->Src[sampler_src];
|
|
||||||
|
|
||||||
|
if (reg->Register.Indirect) {
|
||||||
index = get_bounded_indirect_index(ctx,
|
index = get_bounded_indirect_index(ctx,
|
||||||
®->Indirect,
|
®->Indirect,
|
||||||
reg->Register.Index,
|
reg->Register.Index,
|
||||||
SI_NUM_SAMPLERS);
|
SI_NUM_SAMPLERS);
|
||||||
} else {
|
} else {
|
||||||
index = LLVMConstInt(ctx->i32, sampler_index, 0);
|
index = LLVMConstInt(ctx->i32, reg->Register.Index, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target == TGSI_TEXTURE_BUFFER)
|
if (target == TGSI_TEXTURE_BUFFER)
|
||||||
|
|
Loading…
Reference in New Issue