GWN: Perf: Bypass glUseProgram(0)

I left a flag to quickly debug if something is wrong.
But now that everything uses shader, it seems to be alright since a shader
is always set active before drawing.
This commit is contained in:
Clément Foucault 2018-03-30 23:27:45 +02:00
parent ddbde6d1c0
commit 8b74741b9e
Notes: blender-bot 2023-02-14 11:29:52 +01:00
Referenced by issue #55802, Segmentation fault crash starting Blender 2.8 under Linux
3 changed files with 6 additions and 1 deletions

View File

@ -11,6 +11,8 @@
#pragma once
#define PROGRAM_NO_OPTI 0
#if defined(NDEBUG)
#define TRUST_NO_ONE 0
#else

View File

@ -418,7 +418,9 @@ void GWN_batch_program_use_end(Gwn_Batch* batch)
{
if (batch->program_in_use)
{
#if PROGRAM_NO_OPTI
glUseProgram(0);
#endif
batch->program_in_use = false;
}
}

View File

@ -140,8 +140,9 @@ void immUnbindProgram(void)
#if TRUST_NO_ONE
assert(imm.bound_program != 0);
#endif
#if PROGRAM_NO_OPTI
glUseProgram(0);
#endif
imm.bound_program = 0;
}