Module: Mesa Branch: master Commit: 29af29b8dca1c468294205a126c49084c7dcecf2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=29af29b8dca1c468294205a126c49084c7dcecf2
Author: Chia-I Wu <olva...@gmail.com> Date: Thu Jul 11 06:39:05 2013 +0800 ilo: correctly initialize undefined registers in fs Initialize all 4 channels of undefined registers (that is, TEMPs that are used before being assigned) in FS. --- src/gallium/drivers/ilo/shader/toy_tgsi.c | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/ilo/shader/toy_tgsi.c b/src/gallium/drivers/ilo/shader/toy_tgsi.c index ad6161d..bf61cbb 100644 --- a/src/gallium/drivers/ilo/shader/toy_tgsi.c +++ b/src/gallium/drivers/ilo/shader/toy_tgsi.c @@ -2136,11 +2136,21 @@ ra_get_src(struct toy_tgsi *tgsi, struct toy_dst dst = tdst_from(src); dst.writemask = TOY_WRITEMASK_XYZW; - /* - * Always initialize registers. Otherwise, if the random value - * ends up in a VUE, FS may fail to interpolate correctly. - */ - tc_MOV(tgsi->tc, dst, tsrc_type(tsrc_imm_d(0), type)); + /* always initialize registers before use */ + if (tgsi->aos) { + tc_MOV(tgsi->tc, dst, tsrc_type(tsrc_imm_d(0), type)); + } + else { + struct toy_dst tdst[4]; + int i; + + tdst_transpose(dst, tdst); + + for (i = 0; i < 4; i++) { + tc_MOV(tgsi->tc, tdst[i], + tsrc_type(tsrc_imm_d(0), type)); + } + } } break; default: _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit