Skip to content

GL_FreeUberShaders doesn't seem work correctly #9

@Aynekko

Description

@Aynekko

if( num_glsl_programs >= (MAX_GLSL_PROGRAMS * 0.75f) )
GL_FreeUberShaders();

This code, supposedly, is freeing shaders while loading a new map, if their count exceeds a defined value (512 but actually 384). The next step is, supposedly, that the shaders will be recompiled again. But instead the game crashes. You can test this code by setting num_glsl_programs >= 5 for example.

If these lines are moved earlier, into HUD_BuildLightmaps for example, the code seems to work without crashing, and shaders will recompile.
However, num_glsl_programs never resets, which doesn't seem right. Resetting it manually after this procedure just breaks everything.

For now, I have increased MAX_GLSL_PROGRAMS in this commit: 187fb09
1024 (actually we are looking at 1024 * 0.9 = 921) is a huge number which is unlikely to be hit during a full playthrough, so it's low priority for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    low priorityA minor issue that we can live with

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions