[Mesa-dev] [PATCH v2 00/31] Nir support for Nouveau
Kenneth Graunke
kenneth at whitecape.org
Sat Jan 6 00:34:53 UTC 2018
On Thursday, January 4, 2018 11:56:44 AM PST Jason Ekstrand wrote:
> On January 4, 2018 12:51:15 Karol Herbst <kherbst at redhat.com> wrote:
>
> > On Thu, Jan 4, 2018 at 7:06 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> >> On Thu, Jan 4, 2018 at 10:01 AM, Karol Herbst <kherbst at redhat.com> wrote:
> >>> significant changes to last series:
> >>> * arb_gpu_shader5 interpolateat* (those nir ops don't map well to nvir)
> >>> no good plan on how to properly implement those
> >>
> >> What's the issue? They should map as well as the TGSI ones. (Since the
> >> TGSI ones are just the GLSL ones.)
> >>
> >
> > it is a bit ugly, because usually all inputs vars are lowered away, so
> > that they are inputs. So they need special handling;
> >
> > lowered (input is centroid):
> > vec1 32 ssa_25 = intrinsic load_input (ssa_24) () (0, 0) /* base=0 */
> > /* component=0 */ /* packed:centroid_qualified */
> > vec1 32 ssa_27 = intrinsic load_input (ssa_26) () (0, 1) /* base=0 */
> > /* component=1 */ /* packed:centroid_qualified */
> >
> > not lowered:
> > decl_var INTERP_MODE_NONE vec2 in at unqualified-temp
> > vec2 32 ssa_11 = intrinsic interp_var_at_centroid () (in at unqualified-temp) ()
> >
> > I kind of wished I could have a load_input intrinsic with a flag or
> > load_input_at_centroid, so that I end up with the same code in the
> > end.
>
> In i965, we use the NIR explicit input interpolation intrinsics. I'm on my
> phone so I can't give more details easily.
Setting nir_shader_compiler_options::use_interpolated_input_intrinsics
will eliminate the need to look at variables. Instead, you'll get these
intrinsics:
- load_input (for flat shaded inputs)
- load_interpolated_input (for non-flat shaded inputs)
- load_barycentric_pixel
- load_barycentric_centroid
- load_barycentric_sample
- load_barycentric_at_sample (+ sample ID source)
- load_barycentric_at_offset (+ offset.xy source)
The load_interpolated_input intrinsic takes an extra source, which
should always be one of the load_barycentric_* intrinsics. That way,
from the intrinsic, you can see exactly how to interpolate it.
I highly recommend using these. They're much nicer to work with.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180105/e44fc190/attachment.sig>
More information about the mesa-dev
mailing list