Skip to content

Commit

Permalink
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
  • Loading branch information
jerstlouis committed Nov 5, 2022
1 parent 4abfbe4 commit 1edefd5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion ecere/ecere.epj
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@
"Name" : "Emscripten",
"Options" : {
"Warnings" : "Normal",
"Debug" : true,
"Optimization" : "Speed",
"PreprocessorDefinitions" : [
"ETC2_COMPRESS",
Expand Down
5 changes: 5 additions & 0 deletions ecere/src/gfx/drivers/gl3/glab.ec
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1edefd5

Please sign in to comment.