StackOverflow on running compute shader
See original GitHub issueI’m playing around with benchmarking architectural changes for my C# particle engine, and for kicks I decided to see what timing a compute shader implementation would look like. So I created the following code as a best guess from the current docs:
However, when this runs I get:
Stack overflow.
at TerraFX.Interop.IDxcCompiler.Compile(TerraFX.Interop.IDxcBlob*, UInt16*, UInt16*, UInt16*, UInt16**, UInt32, TerraFX.Interop.DxcDefine*, UInt32, TerraFX.Interop.IDxcIncludeHandler*, TerraFX.Interop.IDxcOperationResult**)
at ComputeSharp.Shaders.Translation.ShaderCompiler.CompileShader(System.ReadOnlySpan`1<Char>)
at ComputeSharp.Shaders.ShaderRunner`1[[ParticleBenchmark.Shader, ParticleBenchmark, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].LoadShader(Int32, Int32, Int32, ParticleBenchmark.Shader ByRef, ComputeSharp.Shaders.Translation.Models.CachedShader`1<ParticleBenchmark.Shader> ByRef)
at ComputeSharp.Shaders.ShaderRunner`1[[ParticleBenchmark.Shader, ParticleBenchmark, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].Run(ComputeSharp.GraphicsDevice, Int32, Int32, Int32, Int32, Int32, Int32, ParticleBenchmark.Shader ByRef)
at ComputeSharp.Shaders.ShaderRunner`1[[ParticleBenchmark.Shader, ParticleBenchmark, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].Run(ComputeSharp.GraphicsDevice, Int32, Int32, Int32, ParticleBenchmark.Shader ByRef)
at ComputeSharp.GraphicsDeviceExtensions.For[[ParticleBenchmark.Shader, ParticleBenchmark, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]](ComputeSharp.GraphicsDevice, Int32, ParticleBenchmark.Shader ByRef)
at ParticleBenchmark.ComputeShaderParticles+Emitter.Update(Single)
at ParticleBenchmark.Program.Main(System.String[])
I’m not really sure what to look at here to address this. This is using the 2.0.0-alpha.2
nuget package, which seems recent. Any ideas on what I"m doing wrong?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Compute shaders in Kha
I am reworking an old voxels module for an opensource game engine, and am unable to get the compute shaders to work;.
Read more >directx11 - Looking for an advice on how to possibly boost ...
So I moved to a compute shader to achieve this goal (DX11 CS5). I have found that I'm limited to R32_UINT for read/write...
Read more >unity - Noise in compute shader related to threadsPerGroup
Please help me to understand how to minimize noise while maximizing game performance at the same time, without relying on the threadsPerGroup , ......
Read more >What exactly are compute shaders? [closed]
A shader takes inputs (from the GPU memory) and computes outputs (to the GPU memory). For example, a vertex shader takes the vertices...
Read more >What a very bad day at work taught me about building ...
What a very bad day at work taught me about building Stack Overflow's community. Hi, my name is Sara Chipps, first time Stack...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Aha that worked! I only used byte for those anyway for memory considerations, not because I necessarily need the values clamped (its rare it’ll go over 20, let alone 255).
I tried that but it didn’t generate any constructors for me. I wasn’t sure at if I had to call the constructor first to generate it or what (and how it matched things up) so I just removed it and went with a manual constructor.
Thanks for the swift reply 😃
If you see the red squiggles, that’s just because the tooling isn’t still perfect in Visual Studio yet (still in preview). If you try using the constructor anyway and build and run, it should actually work fine even if IntelliSense thinks the constructor doesn’t exist 🙂