[Mesa-dev] [PATCH 40/59] i965/fs: fix regs_read() for uniforms

Francisco Jerez currojerez at riseup.net
Tue May 3 22:56:08 UTC 2016


Samuel Iglesias Gonsálvez <siglesias at igalia.com> writes:

> From: Connor Abbott <connor.w.abbott at intel.com>
>
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index ac170d5..729c7a0 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -889,7 +889,7 @@ fs_inst::regs_read(int arg) const
>        return 0;
>     case UNIFORM:
>     case IMM:
> -      return 1;
> +      return DIV_ROUND_UP(type_sz(src[arg].type), 4);

This seems wrong to me, regs_read(i) returns the amount of data read by
source i of the instruction in 32B units, and this makes it behave
inconsistently for uniforms and immediates -- Please don't, this can
potentially break assumptions throughout the back-end anywhere
regs_read() is used, reg_offset being inconsistent between uniforms and
VGRFs is already enough of a hassle...

>     case ARF:
>     case FIXED_GRF:
>     case VGRF:
> -- 
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160503/13f139fb/attachment.sig>


More information about the mesa-dev mailing list