You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you bind a vertex buffer in METAL, sometimes with multiple buffers the render encoder fails because of uninitialised memory.
Error happens at SDL_gpu_metal.mm. Where it binds, the line
Can you try this scenario with the latest SDL3 code, and if it persists, provide a code sample that repros the uninitialized memory error? Looking at the logic I'm not seeing a reason we need to zero-initialize the full array, and I'm concerned that that solution might be working around a more fundamental problem with how we're binding resources.
the error is because when i bind to slot 1 (not 0) looking at the memory before passing in buffer offsets [0] is garbage and [1] the value. metal seems to still complain.
the other thing, in bind vertex buffers, the logic about that part is also that firstBinding plus i is only needed for bufferOffsets and not on metalBuffer[..], that only needs to be [i] . i’m not sure why maybe metal API has something wrong with it. setVertexBuffers in its render encoder errors. when changed, it works with no errors.
When you bind a vertex buffer in METAL, sometimes with multiple buffers the render encoder fails because of uninitialised memory.
Error happens at SDL_gpu_metal.mm. Where it binds, the line
NSUInteger bufferOffsets[MAX_VERTEX_BUFFERS];
needs to be changed to
NSUInteger bufferOffsets[MAX_VERTEX_BUFFERS] = {0};
Which works, due to metal complaining about uninitialised memory. This is when binding vertex buffers at vertex buffer slots > 0. Happened on slot 1.
The text was updated successfully, but these errors were encountered: