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 <tarc...@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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to