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
While testing our Wii U port of TheXTech engine (https://github.com/TheXTech/TheXTech), my collaborator @Wohlstand found that the engine crashed when SDL_SetWindowSize is called to resize the window during initialization. We debugged this further and found it was related to similar crashes when the game's render texture is recreated.
For some reason (I couldn't find the root cause), it seems to be entirely unsafe to delete a texture that was used as a render target in the current frame. Perhaps the result is inadequate GPU synchronization, but I don't know.
This affects cases where the user writes code like SDL_RenderSetTarget(renderer, NULL); SDL_RenderDeleteTexture(old_target);, but it also affects seemingly unrelated routines like SDL_WindowResize(window, ...);, which recreate the render target internally. The result is a system hang or an emulator crash.
Our workaround was to disable calls to SDL_WindowResize (which weren't meaningful) on Wii U, and to delete the second-most recent render target (rather than the most recent one) on Wii U. Both of these represent target-specific code which is generally undesirable in our low-maintenance SDL2 ports of the engine.
How can the issue be reproduced?
The easiest way to reproduce this crash is to attempt to resize the SDL window during any code using the renderer. Finding the principles underlying a fix for that crash would likely make fixing the render target deletion crash very easy.
Environment?
I'm using Fedora, but this also affects our CI builds which pull from your Docker image. I really don't think that the environment is related.
Additional context?
N/A
The text was updated successfully, but these errors were encountered:
Bug Report
What's the issue you encountered?
While testing our Wii U port of TheXTech engine (https://github.com/TheXTech/TheXTech), my collaborator @Wohlstand found that the engine crashed when
SDL_SetWindowSize
is called to resize the window during initialization. We debugged this further and found it was related to similar crashes when the game's render texture is recreated.For some reason (I couldn't find the root cause), it seems to be entirely unsafe to delete a texture that was used as a render target in the current frame. Perhaps the result is inadequate GPU synchronization, but I don't know.
This affects cases where the user writes code like
SDL_RenderSetTarget(renderer, NULL); SDL_RenderDeleteTexture(old_target);
, but it also affects seemingly unrelated routines likeSDL_WindowResize(window, ...);
, which recreate the render target internally. The result is a system hang or an emulator crash.Our workaround was to disable calls to
SDL_WindowResize
(which weren't meaningful) on Wii U, and to delete the second-most recent render target (rather than the most recent one) on Wii U. Both of these represent target-specific code which is generally undesirable in our low-maintenance SDL2 ports of the engine.How can the issue be reproduced?
The easiest way to reproduce this crash is to attempt to resize the SDL window during any code using the renderer. Finding the principles underlying a fix for that crash would likely make fixing the render target deletion crash very easy.
Environment?
I'm using Fedora, but this also affects our CI builds which pull from your Docker image. I really don't think that the environment is related.
Additional context?
N/A
The text was updated successfully, but these errors were encountered: