-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: Added compute shader support for vulkan #2685
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
base: master
Are you sure you want to change the base?
Conversation
I have only tested with a simple compute shader so far but seems to work fine. Sample code, note that the sprite rendering can cause some validation errors if done after the forward renderer, there are no validation errors if the sprite rendering is removed, but then I have to validate the output in renderdoc :D
Shader:
|
1355baa
to
0ed1529
Compare
Got my FFT shaders to work, it seems to work pretty well now. Note the commits from #2684 are currently included. I got rid of the NoSampler sampler hack and am using I also noticed that the resource barrier api is a bit lacking as it wouldn't insert a barrier as my texture was already in
|
Vulkan graphics backend has been modified to support compute shaders, additional modifications were also made to the shader compiler so that correct glsl compute shaders can be generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't really review the graphics code as that is not my area of expertise. With that said, I have a few minor remarks.
sources/shared/Stride.NuGetResolver.Targets/Stride.NuGetResolver.Targets.projitems
Outdated
Show resolved
Hide resolved
// Maybe it just works if removed? | ||
//if (mapMode == MapMode.WriteDiscard) | ||
//{ | ||
// throw new InvalidOperationException("Can't use WriteDiscard on Graphics API that doesn't support renaming"); | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to work, but there are probably scenarios that still fail, but I think it should be fine for now. To be fair I was certain I had removed this and not just commented it out but I guess it came back during all my rebases and cherry-picks ...
Thanks for taking a look, a bit sloppy of me to leave those behind ... 😁 |
Is this good to merge? This should fix some cross platform issues as well which would be a nice win. |
PR Details
Vulkan graphics backend has been modified to support compute shaders, the shader compiler has also been modified to support computer shader generation for GLSL.
Potential breaking changes
Shadercompiler: Enabled GL_EXT_samplerless_texture_functions for all GLSL shaders and removed the old "NoSampler" code, this greatly simplies the code gen and should work on most devices.
CommandList: Removed
if (mapMode == MapMode.WriteDiscard)
exception, I had some trouble getting my streaming terrain to work when the check was present. It seems to mostly work as it should but there are probably some scenarios where this will cause an issue, ofc it would have crashed in the previous version so I consider this to be an improvement.Notable changes
ShaderCompiler
Types of changes
Checklist