permafrost-engine
permafrost-engine copied to clipboard
Assertion `SDL_ThreadID() == g_render_thread_id' failed.
Platform
Latest arch linux
Steps to reproduce
rm -r deps/SDL2
git clone --depth 1 https://github.com/libsdl-org/SDL/ deps/SDL2
(related to #29)
make deps -j16
make pf -j16
make run
Expected behavior Game should run correctly
Actual behavior Splash image with some armed dudes shows up, then the game crashes with
pf: src/render/gl_shader.c:670: _Bool R_GL_Shader_InitAll(const char *): Assertion `SDL_ThreadID() == g_render_thread_id' failed.
Some investigation
At gl_shader.c:670, g_render_thread_id
equals 0 and SDL_ThreadID()
equals 139936868296256.
the render thread run before set g_render_thread_id = SDL_GetThreadID(s_render_thread);
in the main thread. So for temp fix you can set g_render_thread_id
in the render thread.
static int render(void *data)
{
+ g_render_thread_id = SDL_ThreadID();
struct render_sync_state *rstate = data;
SDL_Window *window = rstate->arg->in_window; /* cache window ptr */
Fixed in the latest build. Thanks for the diagnosis @ylme