From: Jason Ekstrand Date: Tue, 7 Jun 2016 02:15:39 +0000 (-0700) Subject: i965/fs: Use a default Y coordinate of 0 for TXF on gen9+ X-Git-Tag: upstream/17.1.0~8610 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0195299c868ec99bc6c595c641da81bb2632252e;p=platform%2Fupstream%2Fmesa.git i965/fs: Use a default Y coordinate of 0 for TXF on gen9+ Previously, we were incrementing length but not actually putting anything in the Y coordinate. This meant that 1-D TXF operations had a garbage array index. If the surface is emitted as 1-D non-array, the coordinate gets discarded and it works fine. If it happens to be bound as an array surface, it may count as an out-of-bounds array access and you get zero. Reviewed-by: Ian Romanick Cc: "11.1 11.2 12.0" --- diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 09b0431..17673f8 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -4264,6 +4264,8 @@ lower_sampler_logical_send_gen7(const fs_builder &bld, fs_inst *inst, opcode op, if (coord_components >= 2) { bld.MOV(retype(sources[length], BRW_REGISTER_TYPE_D), offset(coordinate, bld, 1)); + } else { + sources[length] = brw_imm_d(0); } length++; }