Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ecere/gfx/drivers/GL/GLAB: Avoid expensive call to glCheckFramebuffer…
Browse files Browse the repository at this point in the history
…Status() for WebGL

- ecere.epj: Disable _DEBUG flag for Emscripten
jerstlouis committed Nov 6, 2022
1 parent 4abfbe4 commit 875e38f
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions ecere/ecere.epj
Original file line number Diff line number Diff line change
@@ -478,16 +478,13 @@
"Name" : "Emscripten",
"Options" : {
"Warnings" : "Normal",
"Debug" : true,
"Optimization" : "Speed",
"PreprocessorDefinitions" : [
"ETC2_COMPRESS",
"ECERE_STATIC",
"NOBLENDING",
"ECERE_NOSSL",
"ECERE_YESNET",
"ECERE_NOCURL",
"_DEBUG",
"_GLES3"
],
"TargetType" : "StaticLibrary",
5 changes: 5 additions & 0 deletions ecere/src/gfx/drivers/gl3/glab.ec
Original file line number Diff line number Diff line change
@@ -925,8 +925,13 @@ public struct GLFB
this.h = height;

{
#if !defined(_DEBUG) && defined(__EMSCRIPTEN__)
// Expensive check in WebGL?
result = true;
#else
int status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
result = status == GL_FRAMEBUFFER_COMPLETE;
#endif

#ifdef _DEBUG
if(!result)

0 comments on commit 875e38f

Please sign in to comment.