SDL_DrawGPUIndexedPrimitives exception

After making a change to my renderer, calling SDL_DrawGPUIndexedPrimitives crashes for 1 of the previously working pipelines.

When debugging, it seems to crash in VULKAN_INTERNAL_BindGraphicsDescriptorSets because the fragmentSamplerCount is 1 and it assigns from array of null fragment samplers even though there shouldn’t be any fragment samplers. How could this be if I didn’t bind any fragment samplers after binding the graphics pipeline? The shaders don’t use samplers either.

Is there any other place that could cause this? because fragment samplers don’t seem to be declared in pipeline creation. The feature I added is a textured drawing pipeline so it might be related to that but couldn’t find what it was in the git diff.

// sdl exception location


// my code

The code crashes in the SDL library, so I would suggest you raise an issue with the developers.

I figured it out fragment sampler count is set when creating shader and I set it to 1 by accident somehow. I just needed to read the SDL code more thoroughly to figure out where it was being set.

Was just in the process of making an issue when I realized.

It was set to 1 for a while but was working when it shouldn’t have until it didn’t.

I think SDL should have detected that itself and returned and error without crashing. It’s still worth raising with the dev team in my opinion.

SDL_DrawGPUIndexedPrimitives doesn’t return any errors and I think they can’t change the api anymore. The error can’t be returned anywhere else because the problem is not binding the fragment sampler just before the draw.

1 Like