Skip to content

nir: Add pixel_coord, frag_coord_zw intrinsics

Alyssa Rosenzweig requested to merge alyssa/mesa:nir/pixel-coord into main

On some architectures, gl_FragCoord.xy is available as an integer but gl_FragCoord.zw requires interpolation. Add dedicated intrinsics and lower gl_FragCoord in NIR. This lets us share some code between Bifrost and AGX.


I wanted load_pixel_coord to write a lowering on Asahi. Once I added the intrinsic in, reworking everything to use it made sense.

Merge request reports