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/mesa/state_tracker | |
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/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atifs_to_tgsi.c | 36 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 6 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_mesa_to_tgsi.c | 6 |
3 files changed, 24 insertions, 24 deletions
diff --git a/src/mesa/state_tracker/st_atifs_to_tgsi.c b/src/mesa/state_tracker/st_atifs_to_tgsi.c index 338ced56edc..13e013cebc7 100644 --- a/src/mesa/state_tracker/st_atifs_to_tgsi.c +++ b/src/mesa/state_tracker/st_atifs_to_tgsi.c @@ -105,18 +105,18 @@ apply_swizzle(struct st_translate *t, imm[0] = src; imm[1] = ureg_imm4f(t->ureg, 1.0f, 1.0f, 0.0f, 0.0f); imm[2] = ureg_imm4f(t->ureg, 0.0f, 0.0f, 1.0f, 1.0f); - ureg_insn(t->ureg, TGSI_OPCODE_MAD, &tmp[0], 1, imm, 3); + ureg_insn(t->ureg, TGSI_OPCODE_MAD, &tmp[0], 1, imm, 3, 0); if (swizzle == GL_SWIZZLE_STR_DR_ATI) { imm[0] = ureg_scalar(src, TGSI_SWIZZLE_Z); } else { imm[0] = ureg_scalar(src, TGSI_SWIZZLE_W); } - ureg_insn(t->ureg, TGSI_OPCODE_RCP, &tmp[1], 1, &imm[0], 1); + ureg_insn(t->ureg, TGSI_OPCODE_RCP, &tmp[1], 1, &imm[0], 1, 0); imm[0] = ureg_src(tmp[0]); imm[1] = ureg_src(tmp[1]); - ureg_insn(t->ureg, TGSI_OPCODE_MUL, &tmp[0], 1, imm, 2); + ureg_insn(t->ureg, TGSI_OPCODE_MUL, &tmp[0], 1, imm, 2, 0); return ureg_src(tmp[0]); } @@ -170,35 +170,35 @@ prepare_argument(struct st_translate *t, const unsigned argId, src = ureg_scalar(src, TGSI_SWIZZLE_W); break; } - ureg_insn(t->ureg, TGSI_OPCODE_MOV, &arg, 1, &src, 1); + ureg_insn(t->ureg, TGSI_OPCODE_MOV, &arg, 1, &src, 1, 0); if (srcReg->argMod & GL_COMP_BIT_ATI) { struct ureg_src modsrc[2]; modsrc[0] = ureg_imm1f(t->ureg, 1.0f); modsrc[1] = ureg_negate(ureg_src(arg)); - ureg_insn(t->ureg, TGSI_OPCODE_ADD, &arg, 1, modsrc, 2); + ureg_insn(t->ureg, TGSI_OPCODE_ADD, &arg, 1, modsrc, 2, 0); } if (srcReg->argMod & GL_BIAS_BIT_ATI) { struct ureg_src modsrc[2]; modsrc[0] = ureg_src(arg); modsrc[1] = ureg_imm1f(t->ureg, -0.5f); - ureg_insn(t->ureg, TGSI_OPCODE_ADD, &arg, 1, modsrc, 2); + ureg_insn(t->ureg, TGSI_OPCODE_ADD, &arg, 1, modsrc, 2, 0); } if (srcReg->argMod & GL_2X_BIT_ATI) { struct ureg_src modsrc[2]; modsrc[0] = ureg_src(arg); modsrc[1] = ureg_src(arg); - ureg_insn(t->ureg, TGSI_OPCODE_ADD, &arg, 1, modsrc, 2); + ureg_insn(t->ureg, TGSI_OPCODE_ADD, &arg, 1, modsrc, 2, 0); } if (srcReg->argMod & GL_NEGATE_BIT_ATI) { struct ureg_src modsrc[2]; modsrc[0] = ureg_src(arg); modsrc[1] = ureg_imm1f(t->ureg, -1.0f); - ureg_insn(t->ureg, TGSI_OPCODE_MUL, &arg, 1, modsrc, 2); + ureg_insn(t->ureg, TGSI_OPCODE_MUL, &arg, 1, modsrc, 2, 0); } return ureg_src(arg); } @@ -217,25 +217,25 @@ emit_special_inst(struct st_translate *t, const struct instruction_desc *desc, tmp[0] = get_temp(t, MAX_NUM_FRAGMENT_REGISTERS_ATI + 2); /* re-purpose a3 */ src[0] = ureg_imm1f(t->ureg, 0.5f); src[1] = ureg_negate(args[2]); - ureg_insn(t->ureg, TGSI_OPCODE_ADD, tmp, 1, src, 2); + ureg_insn(t->ureg, TGSI_OPCODE_ADD, tmp, 1, src, 2, 0); src[0] = ureg_src(tmp[0]); src[1] = args[0]; src[2] = args[1]; - ureg_insn(t->ureg, TGSI_OPCODE_CMP, dst, 1, src, 3); + ureg_insn(t->ureg, TGSI_OPCODE_CMP, dst, 1, src, 3, 0); } else if (!strcmp(desc->name, "CND0")) { src[0] = args[2]; src[1] = args[1]; src[2] = args[0]; - ureg_insn(t->ureg, TGSI_OPCODE_CMP, dst, 1, src, 3); + ureg_insn(t->ureg, TGSI_OPCODE_CMP, dst, 1, src, 3, 0); } else if (!strcmp(desc->name, "DOT2_ADD")) { /* note: DP2A is not implemented in most pipe drivers */ tmp[0] = get_temp(t, MAX_NUM_FRAGMENT_REGISTERS_ATI); /* re-purpose a1 */ src[0] = args[0]; src[1] = args[1]; - ureg_insn(t->ureg, TGSI_OPCODE_DP2, tmp, 1, src, 2); + ureg_insn(t->ureg, TGSI_OPCODE_DP2, tmp, 1, src, 2, 0); src[0] = ureg_src(tmp[0]); src[1] = ureg_scalar(args[2], TGSI_SWIZZLE_Z); - ureg_insn(t->ureg, TGSI_OPCODE_ADD, dst, 1, src, 2); + ureg_insn(t->ureg, TGSI_OPCODE_ADD, dst, 1, src, 2, 0); } } @@ -249,7 +249,7 @@ emit_arith_inst(struct st_translate *t, return; } - ureg_insn(t->ureg, desc->TGSI_opcode, dst, 1, args, argcount); + ureg_insn(t->ureg, desc->TGSI_opcode, dst, 1, args, argcount, 0); } static void @@ -292,7 +292,7 @@ emit_dstmod(struct st_translate *t, if (dstMod & GL_SATURATE_BIT_ATI) { dst = ureg_saturate(dst); } - ureg_insn(t->ureg, TGSI_OPCODE_MUL, &dst, 1, src, 2); + ureg_insn(t->ureg, TGSI_OPCODE_MUL, &dst, 1, src, 2, 0); } /** @@ -336,7 +336,7 @@ compile_setupinst(struct st_translate *t, ureg_tex_insn(t->ureg, TGSI_OPCODE_TEX, dst, 1, TGSI_TEXTURE_2D, TGSI_RETURN_TYPE_FLOAT, NULL, 0, src, 2); } else if (texinst->Opcode == ATI_FRAGMENT_SHADER_PASS_OP) { - ureg_insn(t->ureg, TGSI_OPCODE_MOV, dst, 1, src, 1); + ureg_insn(t->ureg, TGSI_OPCODE_MOV, dst, 1, src, 1, 0); } t->regs_written[t->current_pass][r] = true; @@ -408,11 +408,11 @@ finalize_shader(struct st_translate *t, unsigned numPasses) /* copy the result into the OUT slot */ dst[0] = t->outputs[t->outputMapping[FRAG_RESULT_COLOR]]; src[0] = ureg_src(t->temps[0]); - ureg_insn(t->ureg, TGSI_OPCODE_MOV, dst, 1, src, 1); + ureg_insn(t->ureg, TGSI_OPCODE_MOV, dst, 1, src, 1, 0); } /* signal the end of the program */ - ureg_insn(t->ureg, TGSI_OPCODE_END, dst, 0, src, 0); + ureg_insn(t->ureg, TGSI_OPCODE_END, dst, 0, src, 0, 0); } /** diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 4e9b24f1914..c8f40c147d8 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -5961,7 +5961,7 @@ compile_tgsi_instruction(struct st_translate *t, case TGSI_OPCODE_IF: case TGSI_OPCODE_UIF: assert(num_dst == 0); - ureg_insn(ureg, inst->op, NULL, 0, src, num_src); + ureg_insn(ureg, inst->op, NULL, 0, src, num_src, inst->precise); return; case TGSI_OPCODE_TEX: @@ -6065,14 +6065,14 @@ compile_tgsi_instruction(struct st_translate *t, case TGSI_OPCODE_SCS: dst[0] = ureg_writemask(dst[0], TGSI_WRITEMASK_XY); - ureg_insn(ureg, inst->op, dst, num_dst, src, num_src); + ureg_insn(ureg, inst->op, dst, num_dst, src, num_src, inst->precise); break; default: ureg_insn(ureg, inst->op, dst, num_dst, - src, num_src); + src, num_src, inst->precise); break; } } diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 984ff921300..f6eb5effc66 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -566,7 +566,7 @@ compile_instruction( ureg_insn( ureg, translate_opcode( inst->Opcode ), dst, num_dst, - src, num_src ); + src, num_src, 0 ); break; case OPCODE_XPD: @@ -574,7 +574,7 @@ compile_instruction( ureg_insn( ureg, translate_opcode( inst->Opcode ), dst, num_dst, - src, num_src ); + src, num_src, 0 ); break; case OPCODE_RSQ: @@ -593,7 +593,7 @@ compile_instruction( ureg_insn( ureg, translate_opcode( inst->Opcode ), dst, num_dst, - src, num_src ); + src, num_src, 0); break; } } |