feat: Added compute shader support for vulkan#2685
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.
Kryptos-FR
left a comment
There was a problem hiding this comment.
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.
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 ...
There was a problem hiding this comment.
Let's keep an eye on this one in the future.
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. |
|
Thanks for the contrib and sorry for the delay! |

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