|
|
|
|
|
by rossy
2611 days ago
|
|
Take another look at SPIRV-Cross. It's a C++ library that can convert SPIR-V to HLSL, MSL or legacy GLSL/ESSL. I'm not too familiar with Rust or gfx, but it seems like the dx11, dx12, metal and gl backends reference the spirv_cross crate, so that's probably what it's using. To try to answer your original question, I've never used gfx, but we use SPIRV-Cross in mpv to translate video processing shaders written in GLSL to HLSL for Direct3D 11, and it works quite well. Modern GLSL and HLSL seem to be pretty similar, apart from using different coordinate systems. Most HLSL concepts directly map to a GLSL concept (eg. GLSL UBOs become HLSL cbuffers, etc.) Shader translation with SPIRV-Cross definitely isn't the slowest part of our shader compilation pipeline, either. D3DCompile is much slower. |
|