[Mesa-dev] [PATCH 1/3] i965/vec4: don't load src on emit_send if it is BAD_FILE
Francisco Jerez
currojerez at riseup.net
Sat Mar 5 01:41:33 UTC 2016
Alejandro PiƱeiro <apinheiro at igalia.com> writes:
> This can happens if using emit_untyped_atomic for an atomic dec/inc
> ---
> src/mesa/drivers/dri/i965/brw_vec4_surface_builder.cpp | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4_surface_builder.cpp b/src/mesa/drivers/dri/i965/brw_vec4_surface_builder.cpp
> index 28002c5..ba1e670f 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4_surface_builder.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4_surface_builder.cpp
> @@ -131,9 +131,10 @@ namespace brw {
> bld.MOV(offset(payload, n++),
> offset(retype(addr, BRW_REGISTER_TYPE_UD), i));
>
> - for (unsigned i = 0; i < src_sz; i++)
> - bld.MOV(offset(payload, n++),
> - offset(retype(src, BRW_REGISTER_TYPE_UD), i));
> + if (src.file != BAD_FILE)
> + for (unsigned i = 0; i < src_sz; i++)
> + bld.MOV(offset(payload, n++),
> + offset(retype(src, BRW_REGISTER_TYPE_UD), i));
>
I don't think this is right, the calculated message size will be off if
src is invalid but src_sz is non-zero. In cases where the source is not
present you need to make sure you pass src_sz=0 to emit_send() (e.g. in
emit_untyped_atomic).
Thanks.
> /* Reduce the dynamically uniform surface index to a single
> * scalar.
> --
> 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/20160304/8fc16c87/attachment.sig>
More information about the mesa-dev
mailing list