-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add HLSL compilation support #2
base: master
Are you sure you want to change the base?
Conversation
It didn't work, hence veldrid/veldrid-spirv#2
It didn't work, hence veldrid/veldrid-spirv#2
This is a cool feature, I didn't realize that shaderc already supported HLSL compilation. There's a few compilation errors in the current branch, but I was able to fix those locally and test it out. The tests are passing, but I haven't tested any of the output in Veldrid or anything like that. In order to merge this, we will need a few things:
|
@mellinoe I've resolved your first point. I'll work to add tests to cover point 2. Regarding your fourth point, I'm a little lost about how I should map the
Regarding your point about testing the output in Veldrid, how should I go about doing that? Do you expect some kind of test rendering in the Tests project? Or is a separate proof-of-concept example project adequate? |
Vulkan descriptor sets map pretty much 1-to-1 with Veldrid ResourceSets and ResourceLayouts. If a SPIR-V resource is has
Eventually, that's something that should definitely be tested in this repo, but currently there aren't any tests of that sort. At the very least we would need to do some basic validation that it works. IMO, the easiest way to test it out would be to just replace one of the shaders in NeoDemo with an HLSL variant. Everything in that project already runs through Veldrid.Spirv. |
@mellinoe Is there anything else I should do to move along this PR? |
@chances I took another look and compared this with a local branch I have for HLSL support. It looks good to me, and I will likely merge this in sometime soon unless I discover any big issues. The one thing missing that I may need to merge in from my version of this is support for different entry points. How is the current code working, given that you don't pass the entry point around anywhere? This doesn't come up for GLSL at all because "main" is the only valid entry function name. In HLSL it's much more customary to use real, descriptive function names. |
@mellinoe Regarding your question about how this is working with named entry points: I'm not sure yet if a shader compiled this way works because I've been working around this by precompiling my shaders to spirv with What more is needed than setting the entry in a |
@mellinoe Any news on this? |
@mellinoe Please don't forget this PR. HLSL support would be such a awesome addition for this library and Veldrid in general. |
@mellinoe Any update you can give regarding my question in this comment? I'd like to get this PR merged. |
Fix index out of range with version replace
Adds a configurable
SourceLanguage
enum to make use oflibshaderc
'sSetSourceLanguage(shaderc_source_language lang)
when compiling HLSL shaders.