mellinoe / ShaderGen

Proof-of-concept library for generating HLSL, GLSL, and Metal shader code from C#,
MIT License
489 stars 55 forks source link

I can't output some file. #87

Closed Jiuyong closed 5 years ago

Jiuyong commented 5 years ago

when i use it in veldrid-raytracer on window server 2019,it con't output .hlsl.bytes and .450.glsl.spv file. but it can output .glsl .glsle .hlsl .metal file well . and the demo work on OpenGL and Vulkan as fine.

mellinoe commented 5 years ago

My guess is that Windows Server 2019 doesn't have the required Direct3D shader compiler, so that step will be skipped. For SPIR-V compilation to work, you need to install glslangvalidator -- the easiest way is to install the Vulkan SDK.

Jiuyong commented 5 years ago

thank you reply me so quickly! but , it work Direct3D shader compiler well on Windows Server 2019. please see https://github.com/Siyy/BasicComputeShader demo. it can work well on Windows Server 2019 . and i install Vulkan SDK from https://vulkan.lunarg.com/sdk/home#sdk/downloadConfirm/1.1.92.1/windows/VulkanSDK-1.1.92.1-Installer.exe ,but it can't output .450.glsl.spv as before. and it can output .450.glsl well.

mellinoe commented 5 years ago

ShaderGen tries to use fxc.exe, the command-line compiler program. It's possible that the compiler is present but ShaderGen doesn't know how to find it on that OS. glslangvalidator should work as long as it is on the PATH when it runs. I don't have a lot of time to look into that, unfortunately.

Jiuyong commented 5 years ago

YES! YOU ARE RIGHT ! When i installed the Win8 SDK by vs2017, it output the .hlsl.bytes file. and when i restart the windows ,it can output .450.glsl.spv file now. Did it out of fxc.exe possible in the near future instead by D3DCompiler_*.DLL ?

mellinoe commented 5 years ago

Yes, using D3DCompiler.dll (through SharpDX most likely) would be a better long-term solution here. At the moment I am not actively working on this project, so I won't be able to fix things like that. If you submit a small patch for it, I would be happy to review.

Jiuyong commented 5 years ago

May i write commit message in Chinese ?