microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Other
3.04k stars 679 forks source link

Support SPIRV -> DXIL #4969

Closed iwubcode closed 1 year ago

iwubcode commented 1 year ago

Apologies if I missed this, I looked around and didn't see this already.

Would like to request converting from SPIRV -> DXIL . From what I understand there is already functionality that supports the opposite.

Currently working on a project that takes GLSL and converts to SPIRV then generates HLSL off of that so that it can then compile that HLSL into formats that DX11 and DX12 can leverage. This happens in realtime due to how our software works. It would be much more efficient to go directly from SPIRV to DXIL but no systems seem to support this (we currently use SPIRV-Cross).

Keenuts commented 1 year ago

Hello!

This won't be the goal of this compiler, since we really focus on HLSL -> some IR translation, but you might want to look into mesa, apparently they have a SPIRV->DXIL library which receives patches, just unsure of the support level:

iwubcode commented 1 year ago

@Keenuts - thank you. Can this be raised internally that there is at least some interest to do this work? The Godot game engine used Mesa https://github.com/godotengine/godot/pull/70315 and they said that was better than the alternative (Spirv-cross) but it still uses an intermediate layer "NIR".

Given that SPIRV and DXIL are the two main modern solutions, surely other teams are also running into this hurdle. But seems like there isn't much interest from projects that work on this sort of work (see https://github.com/HansKristian-Work/dxil-spirv/issues/103 ).

I will look into Mesa as an option. Thank you for your time!

Keenuts commented 1 year ago

Hello again! Not speaking for Microsoft, but AFAIK, from our team point-of-view, we have no immediate interest in building/maintaining a new tool to do this at the moment, sorry 😊