diff options
author | Karol Herbst <[email protected]> | 2017-06-23 20:30:23 +0200 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2017-07-21 23:45:18 -0400 |
commit | d0dfdf704d6ef974a3bbac826cfd7e511e918f4b (patch) | |
tree | 813dc15519dbb507bf38f588356aa2c7a87a29c9 /src/gallium | |
parent | 28a5e7104e5f0e25940ccc6b6e500edf694af148 (diff) |
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 <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_build.c | 3 | ||||
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_ureg.c | 8 | ||||
-rw-r--r-- | src/gallium/auxiliary/tgsi/tgsi_ureg.h | 14 | ||||
-rw-r--r-- | src/gallium/auxiliary/util/u_simple_shaders.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/nine_shader.c | 6 |
5 files changed, 27 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c index 55e4d064edc..144a0177689 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_build.c +++ b/src/gallium/auxiliary/tgsi/tgsi_build.c @@ -651,6 +651,7 @@ tgsi_default_instruction( void ) static struct tgsi_instruction tgsi_build_instruction(unsigned opcode, unsigned saturate, + unsigned precise, unsigned num_dst_regs, unsigned num_src_regs, struct tgsi_header *header) @@ -665,6 +666,7 @@ tgsi_build_instruction(unsigned opcode, instruction = tgsi_default_instruction(); instruction.Opcode = opcode; instruction.Saturate = saturate; + instruction.Precise = precise; instruction.NumDstRegs = num_dst_regs; instruction.NumSrcRegs = num_src_regs; @@ -1061,6 +1063,7 @@ tgsi_build_full_instruction( *instruction = tgsi_build_instruction(full_inst->Instruction.Opcode, full_inst->Instruction.Saturate, + full_inst->Instruction.Precise, full_inst->Instruction.NumDstRegs, full_inst->Instruction.NumSrcRegs, header); diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index d2a0507d29b..ca31bc4a75a 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -1211,6 +1211,7 @@ struct ureg_emit_insn_result ureg_emit_insn(struct ureg_program *ureg, unsigned opcode, boolean saturate, + unsigned precise, unsigned num_dst, unsigned num_src) { @@ -1224,6 +1225,7 @@ ureg_emit_insn(struct ureg_program *ureg, out[0].insn = tgsi_default_instruction(); out[0].insn.Opcode = opcode; out[0].insn.Saturate = saturate; + out[0].insn.Precise = precise; out[0].insn.NumDstRegs = num_dst; out[0].insn.NumSrcRegs = num_src; @@ -1352,7 +1354,8 @@ ureg_insn(struct ureg_program *ureg, const struct ureg_dst *dst, unsigned nr_dst, const struct ureg_src *src, - unsigned nr_src ) + unsigned nr_src, + unsigned precise ) { struct ureg_emit_insn_result insn; unsigned i; @@ -1367,6 +1370,7 @@ ureg_insn(struct ureg_program *ureg, insn = ureg_emit_insn(ureg, opcode, saturate, + precise, nr_dst, nr_src); @@ -1404,6 +1408,7 @@ ureg_tex_insn(struct ureg_program *ureg, insn = ureg_emit_insn(ureg, opcode, saturate, + 0, nr_dst, nr_src); @@ -1440,6 +1445,7 @@ ureg_memory_insn(struct ureg_program *ureg, insn = ureg_emit_insn(ureg, opcode, FALSE, + 0, nr_dst, nr_src); diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h index 54f95ba5653..ed8c177d514 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h @@ -546,7 +546,8 @@ ureg_insn(struct ureg_program *ureg, const struct ureg_dst *dst, unsigned nr_dst, const struct ureg_src *src, - unsigned nr_src ); + unsigned nr_src, + unsigned precise ); void @@ -586,6 +587,7 @@ struct ureg_emit_insn_result ureg_emit_insn(struct ureg_program *ureg, unsigned opcode, boolean saturate, + unsigned precise, unsigned num_dst, unsigned num_src); @@ -632,6 +634,7 @@ static inline void ureg_##op( struct ureg_program *ureg ) \ opcode, \ FALSE, \ 0, \ + 0, \ 0); \ ureg_fixup_insn_size( ureg, insn.insn_token ); \ } @@ -646,6 +649,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ opcode, \ FALSE, \ 0, \ + 0, \ 1); \ ureg_emit_src( ureg, src ); \ ureg_fixup_insn_size( ureg, insn.insn_token ); \ @@ -661,6 +665,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ opcode, \ FALSE, \ 0, \ + 0, \ 0); \ ureg_emit_label( ureg, insn.extended_token, label_token ); \ ureg_fixup_insn_size( ureg, insn.insn_token ); \ @@ -677,6 +682,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ opcode, \ FALSE, \ 0, \ + 0, \ 1); \ ureg_emit_label( ureg, insn.extended_token, label_token ); \ ureg_emit_src( ureg, src ); \ @@ -694,6 +700,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + 0, \ 1, \ 0); \ ureg_emit_dst( ureg, dst ); \ @@ -713,6 +720,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + 0, \ 1, \ 1); \ ureg_emit_dst( ureg, dst ); \ @@ -733,6 +741,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + 0, \ 1, \ 2); \ ureg_emit_dst( ureg, dst ); \ @@ -756,6 +765,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + 0, \ 1, \ 2); \ ureg_emit_texture( ureg, insn.extended_token, target, \ @@ -780,6 +790,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + 0, \ 1, \ 3); \ ureg_emit_dst( ureg, dst ); \ @@ -806,6 +817,7 @@ static inline void ureg_##op( struct ureg_program *ureg, \ insn = ureg_emit_insn(ureg, \ opcode, \ dst.Saturate, \ + 0, \ 1, \ 4); \ ureg_emit_texture( ureg, insn.extended_token, target, \ diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c b/src/gallium/auxiliary/util/u_simple_shaders.c index 5874d0e9aa4..79331b5638d 100644 --- a/src/gallium/auxiliary/util/u_simple_shaders.c +++ b/src/gallium/auxiliary/util/u_simple_shaders.c @@ -954,7 +954,7 @@ util_make_geometry_passthrough_shader(struct pipe_context *pipe, } /* EMIT IMM[0] */ - ureg_insn(ureg, TGSI_OPCODE_EMIT, NULL, 0, &imm, 1); + ureg_insn(ureg, TGSI_OPCODE_EMIT, NULL, 0, &imm, 1, 0); /* END */ ureg_END(ureg); diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index 40fb6be88f4..f4050908110 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -1879,7 +1879,7 @@ DECL_SPECIAL(IFC) struct ureg_dst tmp = ureg_writemask(tx_scratch(tx), TGSI_WRITEMASK_X); src[0] = tx_src_param(tx, &tx->insn.src[0]); src[1] = tx_src_param(tx, &tx->insn.src[1]); - ureg_insn(tx->ureg, cmp_op, &tmp, 1, src, 2); + ureg_insn(tx->ureg, cmp_op, &tmp, 1, src, 2, 0); ureg_IF(tx->ureg, ureg_scalar(ureg_src(tmp), TGSI_SWIZZLE_X), tx_cond(tx)); return D3D_OK; } @@ -1897,7 +1897,7 @@ DECL_SPECIAL(BREAKC) struct ureg_dst tmp = ureg_writemask(tx_scratch(tx), TGSI_WRITEMASK_X); src[0] = tx_src_param(tx, &tx->insn.src[0]); src[1] = tx_src_param(tx, &tx->insn.src[1]); - ureg_insn(tx->ureg, cmp_op, &tmp, 1, src, 2); + ureg_insn(tx->ureg, cmp_op, &tmp, 1, src, 2, 0); ureg_IF(tx->ureg, ureg_scalar(ureg_src(tmp), TGSI_SWIZZLE_X), tx_cond(tx)); ureg_BRK(tx->ureg); tx_endcond(tx); @@ -3029,7 +3029,7 @@ NineTranslateInstruction_Generic(struct shader_translator *tx) ureg_insn(tx->ureg, tx->insn.info->opcode, dst, tx->insn.ndst, - src, tx->insn.nsrc); + src, tx->insn.nsrc, 0); return D3D_OK; } |