-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BGFX_DEBUG_TEXT buffer memory corruption #3418
Comments
Are you sure you're seeing anything with D3D11, D3D12, GL? |
@mcourteaux This issue is related to scratch buffer in VK. I made workaround, but it's not real fix: 72f9b8b |
Indeed doesn't seem like this should fix it. I can have a look at this on Monday. |
Those artifacts were due to an unrelated data race in my own code. I was changing buffers while bgfx was uploading them to GPU. Disregard that part. I can confirm that I only observed the current issue in Vulkan. Thank you for your quick help! |
Debugging this issue revealed the problem: I added some tracing, and this is the loop causing the issue:
In words,
The fix is simply moving the reset calls for the scratch buffers to after the flush() calls. I'll PR that, while undoing the workaround. |
Describe the bug
Under certain conditions, debug text overlay corrupts rendering.
To Reproduce
Steps to reproduce the behavior:
27-terrain
Expected behavior
Normally working applications.
Screenshots
Additional context
The bug is reproducible on Linux and Windows. Best visible in Vulkan. Direct3D11, Direct3D12, OpenGL are also affected, but on my machine artifacts are much more subtle.
I suspect use-after-free in the text blitter, but not 100% sure.
bgfx/src/bgfx.cpp
Lines 713 to 714 in abe193a
The text was updated successfully, but these errors were encountered: