gl_PointCoord
Right now, any attempt to use gl_PointCoord
(GLSL) or PointCoord (SPIR-V) is resulting in an assert in codegen:
ERROR: unknown nir_intrinsic_op load_point_coord
This should be easy to fix. The problem is that the higher level compiler, NIR, is treating point coord as a system value but the lower part of the compiler stack, nv50 codegen, wants it as an input. We have this problem for a few other system values and we already have a lowering pass to convert system values into inputs. It's lower_fragcoord_instr()
in nvk_shader.c. You'll need to add a case for nir_intrinsic_load_point_coord
which turns it into VARYING_SLOT_PNTC
.
You may also need !162 (merged) in order to practically test it.
There are a couple CTS tests for pointcoord:
dEQP-VK.glsl.builtin_var.simple.pointcoord
dEQP-VK.glsl.builtin_var.simple.pointcoord_uniform_frag
dEQP-VK.glsl.builtin_var.simple.pointcoord_uniform_vert
Those are all I could find with pointcoord in the name and they're all the ones I see throwing that assert, too, so it's likely not well covered. Still, hopefully that demo app will be good enough to prove it's working.