Closed creikey closed 1 year ago
Yeah, unfortunately that's a bit of a problem in this case because these warnings are coming out of the D3D shader compiler which consumes the HLSL code generated by SPIRVCross.
The error/warning mapping only works for the first compile pass which compiles the input GLSL to SPIRV, but for any followup compile passes (in the D3D or Metal shader compilers) the line numbers are off, because they refer to the intermediate HLSL code.
Until recently the intermediate source code used to contain #line
statements, but those were ignored by the D3D compiler anyway, and there were also so 'inprecise' that they were mostly useless even in Metal (where the line mapping via #line
worked).
So for this specific case unfortunately there's no solution.
PS: to not leave you hanging dry completely: the generated HLSL shader code is included in the header output as comment block above the shader blob array, so there's where you would need to look up the error manually. Currently that's the only way.
PS: nice screenshot by the way, looks awesome :)
What technique do you use for the shadows (assuming they are realtime)
PS: nice screenshot by the way, looks awesome :)
What technique do you use for the shadows (assuming they are realtime)
The same one in the sokol example! I contracted somebody else to implement them nice actually so I don't know the details off the top of my head
Thanks for the tip about the hlsl being in the header! I didn't think of that
I've been using the wonderful sokol gfx and app headers to make this game:![image](https://github.com/floooh/sokol-tools/assets/28424206/aeee661a-2a41-42d1-b55f-6bd51a64a7e6)
And have been using
SOKOL_GLCORE33
backend, but now I want to make sure directx is still an option on desktop, and running with D3D11, I get this in the runtime console:However, at these line numbers in the shader ( https://github.com/creikey/rpgpt/blob/8369c62f26cc8949a46fb153aa19c7227dcda1c2/threedee.glsl#L34 for line 34 ) this seems to not be what the error message is talking about. How can I map from these runtime (I'm assuming HLSL translated) shader errors to where in the glsl the problem is?