| Summary: | [PATCH] D3D9 debug runtime error: Vertex buffer cannot be of zero size | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Cameron Gutman <cameron.gutman> |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | 2.0.10 | ||
| Hardware: | x86 | ||
| OS: | Windows 7 | ||
| Attachments: |
Don't attempt to create zero sized vertex buffer
Don't attempt to create zero sized vertex buffer (v2) |
||
Created attachment 4239 [details]
Don't attempt to create zero sized vertex buffer
Created attachment 4240 [details]
Don't attempt to create zero sized vertex buffer (v2)
Whoops, forgot to zero vertexBufferSize[i] in D3D_Reset(). That's probably the reason for the !vbo check in the first place.
Patch added, thanks! https://hg.libsdl.org/SDL/rev/9b5e16574ea9 |
When calling SDL_RenderPresent() using the D3D9 renderer with the debug D3D9 runtime, and not having created any vertex state, the D3D9 debug runtime throws an error: Direct3D9: (ERROR) :Vertex buffer cannot be of zero size Direct3D9: (ERROR) :Failure trying to create Vertex Buffer Reproducer (assuming m_Renderer is newly created): SDL_SetRenderDrawColor(m_Renderer, 0, 0, 0, SDL_ALPHA_OPAQUE); SDL_RenderClear(m_Renderer); SDL_RenderPresent(m_Renderer); The problem is that D3D_RunCommandQueue() always creates a VBO if one doesn't exist. This is incorrect if there's no vertex data. The attached patch fixes the issue.