#Weird shader errors

26 messages · Page 1 of 1 (latest)

whole jasper
#

I am making this compute shader for marching cubes that runs fine except one line triggers a error: process didn't exit successfully: `target\debug\bevy_dig.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION) error and i'm not sure why or what I could do to fix it.

neon escarp
#

Maybe it was the shader compiler that got crashed?

whole jasper
neon escarp
# whole jasper I'm not sure what you mean

I mean, I don't understand how both compile and runtime checked wgsl shader could trigger an access violation.
So, I suspect it is a compiler bug.
Did you try running naga your_shader.wgsl?

whole jasper
neon escarp
#

Then maybe lack of VRAM or driver bug

whole jasper
#

I doubt it, and idk how I would check for either tbh

plucky snow
#

@whole jasper you got multiple GPUs in your system? Like a discreet one and one dedicated ?

whole jasper
plucky snow
#

have you got a repo?

#

did you presize your data buffer?

whole jasper
#

It's so weird that it's specifically these lines that make it crash:

if (cornerIndex < 0 || cornerIndex > 7) {
    continue;
}
            let point = coordinates[cornerIndex];

I have no problem accessing coordinates with constants, but when it comes to accessing it with cornerIndex it loses it's mind, even though it's protected by the if clause

proper sapphire
#

Is that the shader code or the rust code

whole jasper
#

shader code

proper sapphire
#

Hm

#

That without context doesn't say much

whole jasper
#

There is the whole code up at the top

proper sapphire
#

Right

whole jasper
#

I could make a repo also if people are interested

#

Another weird thing is that when I leave the let point = coordinates[cornerIndex]; the shader runs for a few frames, the retun buffer returns completely untouched, even though I add stuff to it before the crashing code is reached

whole jasper
#

Another weird thing (this one might be normal), is that even when the shader works fine, for the first few readbacks, the return buffer is completely untouched, like the shader didn't even run.

whole jasper
#

I found some workaround in the meantime

plucky snow
#

I will take a look when I next get to a rig