[Mesa-dev] [PATCH 04/64] i965/fs: Use a default Y coordinate of 0 for TXF on gen9+

Ian Romanick idr at freedesktop.org
Thu Jun 16 18:45:44 UTC 2016


This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 06/11/2016 09:02 AM, Jason Ekstrand wrote:
> 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.
> 
> Cc: "11.1 11.2 12.0" <mesa-stable at lists.freedesktop.org>
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index 4b29ee5..5d3d4d0 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -4274,6 +4274,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++;
>        }
> 



More information about the mesa-dev mailing list