From 5cb2eee5573b69311da95454be1431e536212fbb Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 17 May 2017 10:51:59 +0200 Subject: tgsi: store the sampler view type directly in the instruction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RadeonSI needs to do a special lowering for Gather4 with integer formats, but with bindless samplers we just can't access the index. Instead, store the return type in the instruction like the target. Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Nicolai Hähnle --- src/gallium/auxiliary/tgsi/tgsi_ureg.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/gallium/auxiliary/tgsi/tgsi_ureg.h') diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h index 6d2f5c0e998..54f95ba5653 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h @@ -555,6 +555,7 @@ ureg_tex_insn(struct ureg_program *ureg, const struct ureg_dst *dst, unsigned nr_dst, unsigned target, + unsigned return_type, const struct tgsi_texture_offset *texoffsets, unsigned nr_offset, const struct ureg_src *src, @@ -596,7 +597,7 @@ ureg_emit_label(struct ureg_program *ureg, void ureg_emit_texture(struct ureg_program *ureg, unsigned insn_token, - unsigned target, unsigned num_offsets); + unsigned target, unsigned return_type, unsigned num_offsets); void ureg_emit_texture_offset(struct ureg_program *ureg, @@ -748,6 +749,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ struct ureg_src src1 ) \ { \ unsigned opcode = TGSI_OPCODE_##op; \ + unsigned return_type = TGSI_RETURN_TYPE_UNKNOWN; \ struct ureg_emit_insn_result insn; \ if (ureg_dst_is_empty(dst)) \ return; \ @@ -756,7 +758,8 @@ static inline void ureg_##op( struct ureg_program *ureg, \ dst.Saturate, \ 1, \ 2); \ - ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ + ureg_emit_texture( ureg, insn.extended_token, target, \ + return_type, 0 ); \ ureg_emit_dst( ureg, dst ); \ ureg_emit_src( ureg, src0 ); \ ureg_emit_src( ureg, src1 ); \ @@ -796,6 +799,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ struct ureg_src src3 ) \ { \ unsigned opcode = TGSI_OPCODE_##op; \ + unsigned return_type = TGSI_RETURN_TYPE_UNKNOWN; \ struct ureg_emit_insn_result insn; \ if (ureg_dst_is_empty(dst)) \ return; \ @@ -804,7 +808,8 @@ static inline void ureg_##op( struct ureg_program *ureg, \ dst.Saturate, \ 1, \ 4); \ - ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ + ureg_emit_texture( ureg, insn.extended_token, target, \ + return_type, 0 ); \ ureg_emit_dst( ureg, dst ); \ ureg_emit_src( ureg, src0 ); \ ureg_emit_src( ureg, src1 ); \ -- cgit v1.2.3