diff options
author | Samuel Pitoiset <[email protected]> | 2017-03-15 13:00:02 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-03-15 14:16:26 +0100 |
commit | 38ee3246d2a93b0b87e5fc9d214d35217d7a1845 (patch) | |
tree | 37455d366eecfcb2e127106730026989b126124c /src/gallium | |
parent | 8a5680f248e7d8362710a91041020c30ee15e2c6 (diff) |
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 <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 4abea854aa6..0a931362cea 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -4234,23 +4234,21 @@ static void tex_fetch_ptrs( { struct si_shader_context *ctx = si_shader_context(bld_base); const struct tgsi_full_instruction *inst = emit_data->inst; + const struct tgsi_full_src_register *reg; unsigned target = inst->Texture.Texture; unsigned sampler_src; - unsigned sampler_index; LLVMValueRef index; sampler_src = emit_data->inst->Instruction.NumSrcRegs - 1; - sampler_index = emit_data->inst->Src[sampler_src].Register.Index; - - if (emit_data->inst->Src[sampler_src].Register.Indirect) { - const struct tgsi_full_src_register *reg = &emit_data->inst->Src[sampler_src]; + reg = &emit_data->inst->Src[sampler_src]; + if (reg->Register.Indirect) { index = get_bounded_indirect_index(ctx, ®->Indirect, reg->Register.Index, SI_NUM_SAMPLERS); } else { - index = LLVMConstInt(ctx->i32, sampler_index, 0); + index = LLVMConstInt(ctx->i32, reg->Register.Index, 0); } if (target == TGSI_TEXTURE_BUFFER) |