On 14/02/18 16:24, Jason Ekstrand wrote:
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.


Ah yes that's how it's done, I thought there was a better way to do this thanks.

Although what do you mean by set it elsewhere? This is where the intrinsic is created and the system variable goes away I don't see how it can be set elsewhere.


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