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
Help needed: Problems with compute shaders #63
Comments
The OpenGL problem is caused by the
This part of ShaderGen isn't terribly well-documented. If you don't do anything special, then all of the resources you define will go into set 0. To override that, you have to put a Note that the D3D11 backend doesn't care about ResourceSet's per-se. Everything gets translated into a flat binding scheme there, so as long as the resources are in order, then things will work out. I'm not sure why the particles are moving too fast there -- that's potentially a different problem. |
Thanks, I’ll try that out tomorrow, I managed to figure most stuff out myself from diving through the code, but I ran out of time and I just don’t have enough shader experience. If I get it working would you like me to fork Veldrid-Samples and create a Pull Request with the updated shader for ComputeParticles, as it would be nice to have a complete example with Compute Shaders? I understand the benefit of not all the shaders using ShaderGen in the samples. I also converted the shaders to embedded resources as you did in the other ShaderGen projects. |
I think I would prefer to keep things as-is over in Veldrid-Samples, but I appreciate the offer. I've had feedback that people would rather see the shader code explicitly in the repo rather than have another tool introduced to them. I would like if at least the "basic" examples are using regular shader code, even if it takes longer to write. I'll go ahead and fix the |
Thanks, adding the explicit ResourceSet attributes to the shaders fixed both the zoomies and the Vulkan crash.
Understood!
Great, thanks! What's the NuGet pre-release strategy, is it done automatically on pull request acceptance? |
Yep, new versions are automatically pushed to myget when a commit happens. I think that I fixed the #versino issue in this commit. |
I couldn't see any update when using the NuGet browser, so I went and checked the myget feed directly here and noticed that the build names are not correctly formatted, and so don't sort as you would expect. Although the latest by date is:
it appears a long way down the list, with
appearing first, and so being the 'latest' by NuGet naming convention. As such Visual Studio won't show any update being available (it takes the first item in the feed as the latest). To fix you need to use the correct semantic version (see (here)[https://docs.microsoft.com/en-us/nuget/reference/package-versioning]). Part of the issue is that the builds are currently outputting 1.2.0-beta2, which technically preceed 1.2.0-g due to suffices being sorted alphabetically. You can supply build metadata in Semantic version 2, but technically it should be preceeded with a '+' not a '-' to indicate it is build metadata. Also, you should avoid on 'official' releases as it isn't supported by older NuGet clients. e.g. (in descending order)
Hope that helps. |
Yeah, browsing in the VS UI won't work very well -- personally I just always manually edit package references and have less issues that way. I would like to improve the CI auto-versioning, but I haven't looked into the specifics of it. Right now, the versioning is just handled by this package, and I haven't tried to customize it very much. Perhaps there's a way that we can get it to spit out something like
Sure -- the git tag is just there for the rolling builds from CI. I'm not sure if the GitVersioning library lets you change the delimiter there. I think I'm just using the default. |
@mellinoe - I did a quick read through of the Nerdbank.GitVersioning Nuget and I think you may be using it wrong. The 3rd, 'patch' value is supposed to be set automatically by Nerdbank to the Git Height, so that it gives the expected package ordering. However, yours is always hard coded '0'. This seems to be because this line in should read: according to the specified file format. I recommend you correct to "1.3-beta" to start numbering correctly. |
This appears to be corrected in 71806a5. |
I've been trying to get the Particle Compute shader example working using ShaderGen, and I'm not pretty much stuck. If managed to find my way around a lot of idiosyncracies but I could do with some help if anyone has time?
I've managed to create the code shown in #62 (and I won't reproduce here as it's quite large), and, so long as I split the class files into their own files (see #62), the Compute, Vertex and Fragment shaders all compile without error.
When using
GraphicsBackend.Direct3D11
the particles zoom around the screen much faster than before (possibly the cause of the next issues), but clearly the shaders are doing something.When changing to
GraphicsBackend.OpenGL
, the shaders 'load' but I get the following error:When I get to the first
GraphicsDevice.SwapBuffers(MainSwapchain);
call inDraw
. (see here)From what I can gather this is probably due to the following section of the
330.glsl
shader, being invalid syntax:This is generated from the following field in the Vertex/Fragment shader file:
public StructuredBuffer<ParticleInfo> Particles;
When changing to `GraphicsBackend.Vulkan', I get a different error:
When I get to the first
GraphicsDevice.SwapBuffers(MainSwapchain);
call inDraw
(see here).This might be related to whatever's causing the particles to zoom around on Direct3D11, which is possibly due to preceeding two lines no longer pointing to the correct places in the output shaders:
(also here)
For completeness, below are the generated Vertex shaders:
OpenGL
Vulkan
Direct3D:
The text was updated successfully, but these errors were encountered: