You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more for users of Sokol. You probably already know, but glGetError() is causes slowdown.
OpenGL operates as a client-server model where commands are issued on the CPU and executed asynchronously on the GPU. When you call glGetError(), it forces a synchronization point between the CPU and GPU. The CPU has to wait for all previous OpenGL commands to be processed and their results made available, potentially stalling the pipeline.
If glGetError() is called frequently, such as once per OpenGL command or per frame, the accumulated cost can become significant, especially if it forces the pipeline to synchronize multiple times per frame.
So if you're not actively debugging (say, during a performance test, or in a production build) you may want to disable the many calls to this function throughout sokol_gfx.h.
In my case I disable the macro, before including any Sokol headers.
#define_SG_GL_CHECK_ERROR() {} // performance optimization, when not debugging
In my case, I measured sg_begin_pass(). Before disabling macro = taking 16ms per frame. After = <1ms per frame.
Important if you want to maintain >=60fps.
The text was updated successfully, but these errors were encountered:
This is more for users of Sokol. You probably already know, but
glGetError()
is causes slowdown.So if you're not actively debugging (say, during a performance test, or in a production build) you may want to disable the many calls to this function throughout
sokol_gfx.h
.In my case I disable the macro, before including any Sokol headers.
In my case, I measured
sg_begin_pass()
. Before disabling macro = taking 16ms per frame. After = <1ms per frame.Important if you want to maintain >=60fps.
The text was updated successfully, but these errors were encountered: