Open RaZeR-RBI opened 9 months ago
On the mangled names issue - just a speculation, but I'm guessing it could be because of GLSL->SPV compilation methods passing debug output parameter as value of target == CrossCompileTarget.GLSL || target == CrossCompileTarget.ESSL
instead of Debug flag that's passed in with the struct (which explains why I can see 'normal' sources when running under OpenGL).
Maybe it should be exposed as an additional method parameter instead?
When passing a ShaderDescription struct to CreateFromSpirv extension method, Debug flag from passed struct is not used, which makes me unable to view and debug DX11 shaders under RenderDoc.
The relevant lines: https://github.com/veldrid/veldrid-spirv/blob/a872acfa33096cf4fc39feae83472110152b9f7b/src/Veldrid.SPIRV/ResourceFactoryExtensions.cs#L72
https://github.com/veldrid/veldrid-spirv/blob/a872acfa33096cf4fc39feae83472110152b9f7b/src/Veldrid.SPIRV/ResourceFactoryExtensions.cs#L81
https://github.com/veldrid/veldrid-spirv/blob/a872acfa33096cf4fc39feae83472110152b9f7b/src/Veldrid.SPIRV/ResourceFactoryExtensions.cs#L138
When corresponding Debug value is passed to resulting structs, I'm able to see and edit shader sources - although all identifiers are mangled, it's better than nothing.
P.S.: Until it's implemented upstream, I hacked up a version of that extension class that uses the passed flag:
/// Contains extension methods for loading modules from SPIR-V bytecode.
///