Skip to content
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

Assertion `SDL_ThreadID() == g_render_thread_id' failed. #30

Closed
vinhig opened this issue Feb 8, 2022 · 2 comments
Closed

Assertion `SDL_ThreadID() == g_render_thread_id' failed. #30

vinhig opened this issue Feb 8, 2022 · 2 comments

Comments

@vinhig
Copy link

vinhig commented Feb 8, 2022

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.

@ylme
Copy link

ylme commented May 14, 2022

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 */

@eduard-permyakov
Copy link
Owner

Fixed in the latest build. Thanks for the diagnosis @ylme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants