-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native translation to FXC binaries #4300
Comments
Wine and https://github.com/GPUOpen-Tools/common-src-ShaderUtils/tree/master/DX10 should give you enough information to fully understand DXBC |
Contributions to add such functionalities into rspirv is definitely welcome! :-) Just curious about DXBC vs. DXIL: I'm more familiar with Vulkan/SPIR-V and its tooling than DirectX/DXBC. But I do have some experience with DXIL. (We are developing a SPIR-V codegen in DirectXShaderCompiler: microsoft/DirectXShaderCompiler#216.) AFAICT, DXIL is at a lower level than SPIR-V (DXIL has no requirement for structured control flows; DXIL scalarized all vectors; etc.) So translating from SPIR-V to DXIL should be feasible; although I would expect certain semantic differences will cause problems. I'm not quite clear about the level of abstraction of DXBC though. Compared to translating SPIR-V to DXIL, I think the main advantage of converting to DXBC is that DXBC is widely accepted in drivers right now? Microsoft does have plan to shift to |
This seems out of scope for |
Interestingly, this issue was filed before Javelin existed :) Moving now |
@Kangz pointed out that DXBC binaries need to be signed, and there isn't really a good way today to avoid going through HLSL when targeting DX11. Let's find out if it's necessary. |
FYI, DXBC is not signed, it is just checksummed, and the algorithm can be found here: https://github.com/GPUOpen-Archive/common-src-ShaderUtils/blob/master/DX10/DXBCChecksum.cpp |
This is the same for dxil, just that dxil.dll also validates, not just checksum (iirc the algorithm is the same) |
I think this is out of scope at this point in time, unless someone makes a really good case for it. |
The FXC is not publicly specified, but there is some information about its structure:
http://timjones.io/blog/archive/2015/09/02/parsing-direct3d-shader-bytecode
It would be very nice to be able to generate it natively from SPIR-V. This would greatly improve the performance of (uncached) pipeline creation when working with API abstraction libraries that take SPIR-V input (gfx-rs/gfx#1374). This in turn could give us an edge comparing to NXT and MoltenVK.
The downsides are:
The text was updated successfully, but these errors were encountered: