[Mesa-dev] [PATCH 1/2] nir: retain pixel_center_integer information when lowering gl_FragCoord

Jason Ekstrand jason at jlekstrand.net
Wed Feb 14 05:24:31 UTC 2018


First off, you should add an index to the intrinsic if you're going to do
this and it should probably be set elsewhere.  Otherwise, it becomes this
magic secret radeonsi thing.

Second, do you really want this on the intrinsic or would it be better as
part of shader_info?  It's always been weird to me that it's a layout
qualifier on gl_FragCoord.  In SPIR-V, it comes in as an execution mode
which is a very global thing.

On Tue, Feb 13, 2018 at 9:02 PM, Timothy Arceri <tarceri at itsqueeze.com>
wrote:

> radeonsi needs to gather this information.
> ---
>  src/compiler/nir/nir_lower_system_values.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/compiler/nir/nir_lower_system_values.c
> b/src/compiler/nir/nir_lower_system_values.c
> index 3594f4ae5c..f8d8463f7f 100644
> --- a/src/compiler/nir/nir_lower_system_values.c
> +++ b/src/compiler/nir/nir_lower_system_values.c
> @@ -133,6 +133,15 @@ convert_block(nir_block *block, nir_builder *b)
>           break;
>        }
>
> +      case SYSTEM_VALUE_FRAG_COORD: {
> +         nir_intrinsic_op sysval_op =
> +            nir_intrinsic_from_system_value(var->data.location);
> +         int idx = 0;
> +         if (var->data.pixel_center_integer) {
> +            idx = 1;
> +         }
> +         sysval = nir_load_system_value(b, sysval_op, idx);
> +      }
>        default:
>           break;
>        }
> --
> 2.14.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180213/652760eb/attachment.html>


More information about the mesa-dev mailing list