[Mesa-dev] [PATCH 12/20] i965/fs: Handle explicit flag sources in flags_read()
Francisco Jerez
currojerez at riseup.net
Sat Jul 15 00:52:23 UTC 2017
Matt Turner <mattst88 at gmail.com> writes:
> The implementations of the ARB_shader_ballot intrinsics will explicitly
> read the flag as a source register.
> ---
> src/intel/compiler/brw_fs.cpp | 18 ++++++++++++++----
> 1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
> index 97908a4563..de3aafafb1 100644
> --- a/src/intel/compiler/brw_fs.cpp
> +++ b/src/intel/compiler/brw_fs.cpp
> @@ -862,9 +862,6 @@ namespace {
> unsigned
> fs_inst::flags_read(const gen_device_info *devinfo) const
> {
> - /* XXX - This doesn't consider explicit uses of the flag register as source
> - * region.
> - */
> if (predicate == BRW_PREDICATE_ALIGN1_ANYV ||
> predicate == BRW_PREDICATE_ALIGN1_ALLV) {
> /* The vertical predication modes combine corresponding bits from
> @@ -875,7 +872,20 @@ fs_inst::flags_read(const gen_device_info *devinfo) const
> } else if (predicate) {
> return flag_mask(this);
> } else {
> - return 0;
> + unsigned mask = 0;
> + for (int i = 0; i < sources; i++) {
> + if (src[i].file == ARF) {
> + if (src[i].nr == BRW_ARF_FLAG + 0 && src[i].subnr == 0)
> + mask |= 0b0001;
> + if (src[i].nr == BRW_ARF_FLAG + 0 && src[i].subnr == 1)
> + mask |= 0b0010;
> + if (src[i].nr == BRW_ARF_FLAG + 1 && src[i].subnr == 0)
> + mask |= 0b0100;
> + if (src[i].nr == BRW_ARF_FLAG + 1 && src[i].subnr == 1)
> + mask |= 0b1000;
> + }
> + }
> + return mask;
This has the same problems as PATCH 5. The solution I suggested there
should work here too.
> }
> }
>
> --
> 2.13.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/20170714/0967fcab/attachment.sig>
More information about the mesa-dev
mailing list