tgsi: populate precise

Only implemented for glsl->tgsi. Other converters just set precise to 0.

v2: remove precise paramter from ureg_tex_insn and ureg_memory_insn

Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>

[cherry-picked from d0dfdf704d6ef974a3bbac826cfd7e511e918f4b in mesa]

Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Karol Herbst 6 years ago committed by Dave Airlie
parent 654647cde9
commit 46d2cf85d1
  1. 3
      src/gallium/auxiliary/tgsi/tgsi_build.c
  2. 8
      src/gallium/auxiliary/tgsi/tgsi_ureg.c
  3. 20
      src/gallium/auxiliary/tgsi/tgsi_ureg.h

@ -650,6 +650,7 @@ tgsi_default_instruction( void )
static struct tgsi_instruction static struct tgsi_instruction
tgsi_build_instruction(unsigned opcode, tgsi_build_instruction(unsigned opcode,
unsigned saturate, unsigned saturate,
unsigned precise,
unsigned num_dst_regs, unsigned num_dst_regs,
unsigned num_src_regs, unsigned num_src_regs,
struct tgsi_header *header) struct tgsi_header *header)
@ -664,6 +665,7 @@ tgsi_build_instruction(unsigned opcode,
instruction = tgsi_default_instruction(); instruction = tgsi_default_instruction();
instruction.Opcode = opcode; instruction.Opcode = opcode;
instruction.Saturate = saturate; instruction.Saturate = saturate;
instruction.Precise = precise;
instruction.NumDstRegs = num_dst_regs; instruction.NumDstRegs = num_dst_regs;
instruction.NumSrcRegs = num_src_regs; instruction.NumSrcRegs = num_src_regs;
@ -1057,6 +1059,7 @@ tgsi_build_full_instruction(
*instruction = tgsi_build_instruction(full_inst->Instruction.Opcode, *instruction = tgsi_build_instruction(full_inst->Instruction.Opcode,
full_inst->Instruction.Saturate, full_inst->Instruction.Saturate,
full_inst->Instruction.Precise,
full_inst->Instruction.NumDstRegs, full_inst->Instruction.NumDstRegs,
full_inst->Instruction.NumSrcRegs, full_inst->Instruction.NumSrcRegs,
header); header);

@ -923,6 +923,7 @@ struct ureg_emit_insn_result
ureg_emit_insn(struct ureg_program *ureg, ureg_emit_insn(struct ureg_program *ureg,
unsigned opcode, unsigned opcode,
boolean saturate, boolean saturate,
unsigned precise,
unsigned num_dst, unsigned num_dst,
unsigned num_src ) unsigned num_src )
{ {
@ -936,6 +937,7 @@ ureg_emit_insn(struct ureg_program *ureg,
out[0].insn = tgsi_default_instruction(); out[0].insn = tgsi_default_instruction();
out[0].insn.Opcode = opcode; out[0].insn.Opcode = opcode;
out[0].insn.Saturate = saturate; out[0].insn.Saturate = saturate;
out[0].insn.Precise = precise;
out[0].insn.NumDstRegs = num_dst; out[0].insn.NumDstRegs = num_dst;
out[0].insn.NumSrcRegs = num_src; out[0].insn.NumSrcRegs = num_src;
@ -1038,7 +1040,8 @@ ureg_insn(struct ureg_program *ureg,
const struct ureg_dst *dst, const struct ureg_dst *dst,
unsigned nr_dst, unsigned nr_dst,
const struct ureg_src *src, const struct ureg_src *src,
unsigned nr_src ) unsigned nr_src,
unsigned precise )
{ {
struct ureg_emit_insn_result insn; struct ureg_emit_insn_result insn;
unsigned i; unsigned i;
@ -1053,6 +1056,7 @@ ureg_insn(struct ureg_program *ureg,
insn = ureg_emit_insn(ureg, insn = ureg_emit_insn(ureg,
opcode, opcode,
saturate, saturate,
precise,
nr_dst, nr_dst,
nr_src); nr_src);
@ -1089,6 +1093,7 @@ ureg_tex_insn(struct ureg_program *ureg,
insn = ureg_emit_insn(ureg, insn = ureg_emit_insn(ureg,
opcode, opcode,
saturate, saturate,
0,
nr_dst, nr_dst,
nr_src); nr_src);
@ -1121,6 +1126,7 @@ ureg_label_insn(struct ureg_program *ureg,
opcode, opcode,
FALSE, FALSE,
0, 0,
0,
nr_src); nr_src);
ureg_emit_label( ureg, insn.extended_token, label_token ); ureg_emit_label( ureg, insn.extended_token, label_token );

@ -473,7 +473,8 @@ ureg_insn(struct ureg_program *ureg,
const struct ureg_dst *dst, const struct ureg_dst *dst,
unsigned nr_dst, unsigned nr_dst,
const struct ureg_src *src, const struct ureg_src *src,
unsigned nr_src ); unsigned nr_src,
unsigned precise );
void void
@ -509,6 +510,7 @@ struct ureg_emit_insn_result
ureg_emit_insn(struct ureg_program *ureg, ureg_emit_insn(struct ureg_program *ureg,
unsigned opcode, unsigned opcode,
boolean saturate, boolean saturate,
unsigned precise,
unsigned num_dst, unsigned num_dst,
unsigned num_src ); unsigned num_src );
@ -548,6 +550,7 @@ static inline void ureg_##op( struct ureg_program *ureg ) \
opcode, \ opcode, \
FALSE, \ FALSE, \
0, \ 0, \
0, \
0); \ 0); \
ureg_fixup_insn_size( ureg, insn.insn_token ); \ ureg_fixup_insn_size( ureg, insn.insn_token ); \
} }
@ -562,6 +565,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
opcode, \ opcode, \
FALSE, \ FALSE, \
0, \ 0, \
0, \
1); \ 1); \
ureg_emit_src( ureg, src ); \ ureg_emit_src( ureg, src ); \
ureg_fixup_insn_size( ureg, insn.insn_token ); \ ureg_fixup_insn_size( ureg, insn.insn_token ); \
@ -577,6 +581,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
opcode, \ opcode, \
FALSE, \ FALSE, \
0, \ 0, \
0, \
0); \ 0); \
ureg_emit_label( ureg, insn.extended_token, label_token ); \ ureg_emit_label( ureg, insn.extended_token, label_token ); \
ureg_fixup_insn_size( ureg, insn.insn_token ); \ ureg_fixup_insn_size( ureg, insn.insn_token ); \
@ -593,6 +598,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
opcode, \ opcode, \
FALSE, \ FALSE, \
0, \ 0, \
0, \
1); \ 1); \
ureg_emit_label( ureg, insn.extended_token, label_token ); \ ureg_emit_label( ureg, insn.extended_token, label_token ); \
ureg_emit_src( ureg, src ); \ ureg_emit_src( ureg, src ); \
@ -610,6 +616,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
insn = ureg_emit_insn(ureg, \ insn = ureg_emit_insn(ureg, \
opcode, \ opcode, \
dst.Saturate, \ dst.Saturate, \
0, \
1, \ 1, \
0); \ 0); \
ureg_emit_dst( ureg, dst ); \ ureg_emit_dst( ureg, dst ); \
@ -629,6 +636,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
insn = ureg_emit_insn(ureg, \ insn = ureg_emit_insn(ureg, \
opcode, \ opcode, \
dst.Saturate, \ dst.Saturate, \
0, \
1, \ 1, \
1); \ 1); \
ureg_emit_dst( ureg, dst ); \ ureg_emit_dst( ureg, dst ); \
@ -649,6 +657,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
insn = ureg_emit_insn(ureg, \ insn = ureg_emit_insn(ureg, \
opcode, \ opcode, \
dst.Saturate, \ dst.Saturate, \
0, \
1, \ 1, \
2); \ 2); \
ureg_emit_dst( ureg, dst ); \ ureg_emit_dst( ureg, dst ); \
@ -671,6 +680,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
insn = ureg_emit_insn(ureg, \ insn = ureg_emit_insn(ureg, \
opcode, \ opcode, \
dst.Saturate, \ dst.Saturate, \
0, \
1, \ 1, \
2); \ 2); \
ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \
@ -694,6 +704,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
insn = ureg_emit_insn(ureg, \ insn = ureg_emit_insn(ureg, \
opcode, \ opcode, \
dst.Saturate, \ dst.Saturate, \
0, \
1, \ 1, \
2); \ 2); \
ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \
@ -717,6 +728,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
insn = ureg_emit_insn(ureg, \ insn = ureg_emit_insn(ureg, \
opcode, \ opcode, \
dst.Saturate, \ dst.Saturate, \
0, \
1, \ 1, \
3); \ 3); \
ureg_emit_dst( ureg, dst ); \ ureg_emit_dst( ureg, dst ); \
@ -741,6 +753,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
insn = ureg_emit_insn(ureg, \ insn = ureg_emit_insn(ureg, \
opcode, \ opcode, \
dst.Saturate, \ dst.Saturate, \
0, \
1, \ 1, \
3); \ 3); \
ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \
@ -767,6 +780,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
insn = ureg_emit_insn(ureg, \ insn = ureg_emit_insn(ureg, \
opcode, \ opcode, \
dst.Saturate, \ dst.Saturate, \
0, \
1, \ 1, \
4); \ 4); \
ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \
@ -794,6 +808,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
insn = ureg_emit_insn(ureg, \ insn = ureg_emit_insn(ureg, \
opcode, \ opcode, \
dst.Saturate, \ dst.Saturate, \
0, \
1, \ 1, \
4); \ 4); \
ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \
@ -821,6 +836,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
insn = ureg_emit_insn(ureg, \ insn = ureg_emit_insn(ureg, \
opcode, \ opcode, \
dst.Saturate, \ dst.Saturate, \
0, \
1, \ 1, \
4); \ 4); \
ureg_emit_dst( ureg, dst ); \ ureg_emit_dst( ureg, dst ); \
@ -848,6 +864,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
insn = ureg_emit_insn(ureg, \ insn = ureg_emit_insn(ureg, \
opcode, \ opcode, \
dst.Saturate, \ dst.Saturate, \
0, \
1, \ 1, \
5); \ 5); \
ureg_emit_dst( ureg, dst ); \ ureg_emit_dst( ureg, dst ); \
@ -876,6 +893,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \
insn = ureg_emit_insn(ureg, \ insn = ureg_emit_insn(ureg, \
opcode, \ opcode, \
dst.Saturate, \ dst.Saturate, \
0, \
1, \ 1, \
5); \ 5); \
ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \ ureg_emit_texture( ureg, insn.extended_token, target, 0 ); \

Loading…
Cancel
Save