zlacker

[return to "Building the DirectX shader compiler better than Microsoft?"]
1. sylwar+sf[view] [source] 2024-02-10 12:41:06
>>emidoo+(OP)
I guess the less troublesome would be something like HLSL/GLSL->SPIR-V<->DXIL, or shaders could be authored directly in SPIR-V.

In vkd3d (from wine), I think you have a DXIL->SPIR-V translater (much more robust than any high level shading language converter since it is a much more simple intermediate language).

That said, apart from this abomination of llvm, is there a HLSL->DXIL compiler written in plain and simple C99 (namely which require NOT gcc or clang to compile)?

◧◩
2. noahwh+Qh[view] [source] 2024-02-10 13:10:14
>>sylwar+sf
"Shaders could be authored directly in SPIRV" oh god please no lmao

Also to answer your question, no. The hlsl to dxil translation is basically owned by microsoft. There's been little effort to move away from that

◧◩◪
3. sylwar+Xp2[view] [source] 2024-02-11 10:42:22
>>noahwh+Qh
I am really serious about direct authoring of shaders using SPIR-V (with probably a little SSA checker on the side). We can reasonably think it will significantly increase the compatibility and bug avoidance of shaders among various drivers (and that is priceless when you think QA of big video games spaning many different drivers).

I am perfectly aware this will require a bit more upfront work to write shaders, but due to their life cycle, it should be benign and we should get all the benefits (not even mentioning to free the SDK dependency from a massive and complex high level shading language compiler).

I am going to give it a try. I need first a SPIR-V assembler, the one from the khronos spriv tools and the one from llvm are c++ diarrhea then a definitive nono, have to write my own. Let's think long run here: we don't have a _REAL_ standard very high level language yet (python? lua? javascript? perl5? ruby? so_many_others?), I'll go rv64 assembly then (I'll write a mini rv64 interpreter for x86_64).

[go to top]