veldrid-spirv icon indicating copy to clipboard operation
veldrid-spirv copied to clipboard

Proposal to support passing target version when cross compiling

Open etinquis opened this issue 3 years ago • 1 comments

  • adds TargetVersion to CrossCompileInfo so that the caller can control the target compilation version (if 0 is passed, the behavior is as before)
  • adds targetVersion param to SpirvCompilation.CompileCompute/CompileVertexFragment
  • adds SpirvCompilation.SetDefaultTargetVersionForCrossCompileTarget(CrossCompileTarget, uint version) to allow caller to set global default to avoid having to pass versions into every Compile call

While working on the PBR sample, I found that I ran into compilation errors due to the default MSL version being too low. This change allows me to set the MSL version as seen here.

etinquis avatar Dec 21 '21 17:12 etinquis

Just wanted to chime in and say that veldrid-spirv translation generates shaders with different versions and causes Error linking GL program: L0001 Shader languages do not match on my Android. This PR may be a "solution" to this problem. My current solution is to just replace the lang version in the generated files to the highest version generated.

TechPizzaDev avatar Jan 16 '22 01:01 TechPizzaDev