[Mesa-dev] [PATCH] i965/fs: Don't offset uniform registers in half().
Jason Ekstrand
jason at jlekstrand.net
Tue Dec 2 22:11:52 PST 2014
On Dec 2, 2014 9:19 PM, "Matt Turner" <mattst88 at gmail.com> wrote:
>
> Half gives you the second half of a SIMD16 register, but if the register
> is a uniform it would incorrectly give you the next register.
I'm curious as to where this came up. To my knowledge, the only time that's
used, we know it's not a uniform. Am I missing something?
In any case, that seems like the right way to handle uniforms. We could
also do that for immediates.
Assuming it has a point,
Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>
> ---
> src/mesa/drivers/dri/i965/brw_fs.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.h
b/src/mesa/drivers/dri/i965/brw_fs.h
> index 6a7fbe4..71b82ae 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.h
> +++ b/src/mesa/drivers/dri/i965/brw_fs.h
> @@ -210,6 +210,10 @@ static inline fs_reg
> half(fs_reg reg, unsigned idx)
> {
> assert(idx < 2);
> +
> + if (reg.file == UNIFORM)
> + return reg;
> +
> assert(idx == 0 || (reg.file != HW_REG && reg.file != IMM));
> assert(reg.width == 16);
> reg.width = 8;
> --
> 2.0.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141202/fe1a01d8/attachment.html>
More information about the mesa-dev
mailing list