Am 19/12/2015 um 05:43 schrieb Dave Airlie: > From: Dave Airlie <airl...@redhat.com> > > This is just a precursor patch to a fix for doubles with > tessellation that I've written. > > We need to descend into output arrays in that case and > mark dst's as double. > > Signed-off-by: Dave Airlie <airl...@redhat.com> > --- > src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp > b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp > index 89ad6cd..4cad237 100644 > --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp > +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp > @@ -555,6 +555,7 @@ glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, > unsigned op, > { > glsl_to_tgsi_instruction *inst = new(mem_ctx) glsl_to_tgsi_instruction(); > int num_reladdr = 0, i, j; > + bool dst_is_double[2]; > > op = get_opcode(ir, op, dst, src0, src1); > > @@ -658,7 +659,13 @@ glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, > unsigned op, > * GLSL [0].z -> TGSI [1].xy > * GLSL [0].w -> TGSI [1].zw > */ > - if (inst->dst[0].type == GLSL_TYPE_DOUBLE || inst->dst[1].type == > GLSL_TYPE_DOUBLE || > + for (j = 0; j < 2; j++) { > + dst_is_double[j] = false; Could you either use an initializer above or an else clause here? -Michael > + if (inst->dst[j].type == GLSL_TYPE_DOUBLE) > + dst_is_double[j] = true; > + } > + > + if (dst_is_double[0] || dst_is_double[1] || > inst->src[0].type == GLSL_TYPE_DOUBLE) { > glsl_to_tgsi_instruction *dinst = NULL; > int initial_src_swz[4], initial_src_idx[4]; > @@ -699,7 +706,7 @@ glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, > unsigned op, > > /* modify the destination if we are splitting */ > for (j = 0; j < 2; j++) { > - if (dinst->dst[j].type == GLSL_TYPE_DOUBLE) { > + if (dst_is_double[j]) { > dinst->dst[j].writemask = (i & 1) ? WRITEMASK_ZW : > WRITEMASK_XY; > dinst->dst[j].index = initial_dst_idx[j]; > if (i > 1) > @@ -732,7 +739,7 @@ glsl_to_tgsi_visitor::emit_asm(ir_instruction *ir, > unsigned op, > - F2D is a float src0, DLDEXP is integer src1 */ > if (op == TGSI_OPCODE_F2D || > op == TGSI_OPCODE_DLDEXP || > - (op == TGSI_OPCODE_UCMP && dinst->dst[0].type == > GLSL_TYPE_DOUBLE)) { > + (op == TGSI_OPCODE_UCMP && dst_is_double[0])) { > dinst->src[j].swizzle = MAKE_SWIZZLE4(swz, swz, swz, swz); > } > } > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 1/9] st/glsl_to_tgsi: store if dst is double in array
Michael Schellenberger Costa Sat, 19 Dec 2015 19:12:07 -0800
- [Mesa-dev] st/glsl_to_tgsi fp64 fixes. Dave Airlie
- [Mesa-dev] [PATCH 9/9] st/glsl_to_tgsi: ... Dave Airlie
- [Mesa-dev] [PATCH 5/9] st/glsl_to_tgsi: ... Dave Airlie
- [Mesa-dev] [PATCH 1/9] st/glsl_to_tgsi: ... Dave Airlie
- Re: [Mesa-dev] [PATCH 1/9] st/glsl_t... Michael Schellenberger Costa
- [Mesa-dev] [PATCH 2/9] st/glsl_to_tgsi: ... Dave Airlie
- [Mesa-dev] [PATCH 3/9] st/glsl_to_tgsi: ... Dave Airlie
- [Mesa-dev] [PATCH 4/9] st/glsl_to_tgsi: ... Dave Airlie
- [Mesa-dev] [PATCH 6/9] st/glsl_to_tgsi: ... Dave Airlie
- [Mesa-dev] [PATCH 7/9] st/glsl_to_tgsi: ... Dave Airlie
- [Mesa-dev] [PATCH 8/9] st/glsl_to_tgsi: ... Dave Airlie