AFAICT the hardware doesn't provide any way to retrieve the primitive ID without a geometry shader, so we'd probably need to use a passthrough geometry shader for this. Any volunteers?