Post AcLW1BDC8k3nDBj0yG by mrf@mastodon.gamedev.place
(DIR) More posts by mrf@mastodon.gamedev.place
(DIR) Post #AcLW1BDC8k3nDBj0yG by mrf@mastodon.gamedev.place
2023-11-30T21:33:20Z
0 likes, 0 repeats
I don't know how exactly Unity is translating HLSL to GLSL when compiling for Vulkan, but this error really puzzles me... did anyone encounter anything like this?I'm passing SV_PrimitiveID to GS and then writing it into emitted vertices... it stays unsigned everywhere
(DIR) Post #AcLW1CSpU6A15y30ym by VileLasagna@mastodon.gamedev.place
2023-11-30T21:34:15Z
0 likes, 0 repeats
@mrf IS it translating to GLSL? HLSL can be compiled straight to Spir-V which would be my first guess of what's happening
(DIR) Post #AcLW1KGiT1DzIiRSD2 by mrf@mastodon.gamedev.place
2023-11-30T22:22:27Z
0 likes, 0 repeats
@VileLasagna It looks like it does. And I'm not sure where can I even look at this intermediate source. These line numbers are not pointing to my source :D
(DIR) Post #AcLW1QBGUCQfdXwBXs by thendrix@social.hendrixgames.com
2023-11-30T22:30:17.838744Z
0 likes, 0 repeats
It’s been a long time since I’ve used unity, but it used to spit out generated source for debugging at least on console platforms. I have no idea how they implement vulkan. Also ShaderLab preprocessor is mixed in there with any other code like HLSL/‘Cg’ before it gets to dxc/glslang/shaderc/etc.
(DIR) Post #AcarIMDqMYVXI6hV8C by mrf@mastodon.gamedev.place
2023-12-08T08:08:09Z
1 likes, 0 repeats
So in the end, the problem was just me trying to use the SV_PrimitiveID semantic to pass the ID from GS to PS... Vulkan didn't get it. Since the passed ID is not a system value anymore. I just changed it to TEXCOORD, and it worked.