anv: using SPIR-V PrimitiveId in TCS leads to GPU hang
I've got a fur rendering test program that's failing on Intel (Tiger Lake Gen12, at least). The TCS uses the PrimitiveID builtin which should be "the index of the patch within the current set of rendering primitives that corresponds to the shader invocation" per the Vulkan spec.
The GPU times out when trying to read that builtin in an SpvOpImageFetch instruction. Actually, it seems that any instruction which tries to read PrimitiveID is causing a GPU timeout.
I poked around and found that if I flip the value of the eight_patch boolean at brw_fs_nir.cpp:2837 the hang goes away, but the rendering is wrong. I don't know if that's a clue.