diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-03-31 00:27:45 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-03-31 00:27:45 +0300 |
commit | 8b74741b9e1b8ac2cead829a3ca2621bb5950865 (patch) | |
tree | 363d02699e23ef5bedaf36427d43ef0f6a6eeeda | |
parent | ddbde6d1c0cf9a33d284184f7a83431ef831d935 (diff) |
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.
-rw-r--r-- | intern/gawain/gawain/gwn_common.h | 2 | ||||
-rw-r--r-- | intern/gawain/src/gwn_batch.c | 2 | ||||
-rw-r--r-- | intern/gawain/src/gwn_immediate.c | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/intern/gawain/gawain/gwn_common.h b/intern/gawain/gawain/gwn_common.h index e96a3b5c2a2..dc0a52ca096 100644 --- a/intern/gawain/gawain/gwn_common.h +++ b/intern/gawain/gawain/gwn_common.h @@ -11,6 +11,8 @@ #pragma once +#define PROGRAM_NO_OPTI 0 + #if defined(NDEBUG) #define TRUST_NO_ONE 0 #else diff --git a/intern/gawain/src/gwn_batch.c b/intern/gawain/src/gwn_batch.c index 8b16e8e1905..7d455dd4629 100644 --- a/intern/gawain/src/gwn_batch.c +++ b/intern/gawain/src/gwn_batch.c @@ -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; } } diff --git a/intern/gawain/src/gwn_immediate.c b/intern/gawain/src/gwn_immediate.c index 790c7d841bb..0e57aefebe2 100644 --- a/intern/gawain/src/gwn_immediate.c +++ b/intern/gawain/src/gwn_immediate.c @@ -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; } |