mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
Merge pull request #1130 from BeamNG/fix_opengl_performance
Remove a get* OpenGL function causing CPU-GPU sync point.
This commit is contained in:
commit
d6beb3594a
1 changed files with 36 additions and 30 deletions
|
|
@ -217,35 +217,41 @@ GFXGLPreserveTexture TORQUE_CONCAT(preserve_, __LINE__) (binding, _GET_TEXTURE_B
|
||||||
GFXGLPreserveInteger TORQUE_CONCAT(preserve_, __LINE__) (GL_READ_FRAMEBUFFER, GL_READ_FRAMEBUFFER_BINDING, (GFXGLPreserveInteger::BindFn)glBindFramebuffer);\
|
GFXGLPreserveInteger TORQUE_CONCAT(preserve_, __LINE__) (GL_READ_FRAMEBUFFER, GL_READ_FRAMEBUFFER_BINDING, (GFXGLPreserveInteger::BindFn)glBindFramebuffer);\
|
||||||
GFXGLPreserveInteger TORQUE_CONCAT(preserve2_, __LINE__) (GL_DRAW_FRAMEBUFFER, GL_DRAW_FRAMEBUFFER_BINDING, (GFXGLPreserveInteger::BindFn)glBindFramebuffer)
|
GFXGLPreserveInteger TORQUE_CONCAT(preserve2_, __LINE__) (GL_DRAW_FRAMEBUFFER, GL_DRAW_FRAMEBUFFER_BINDING, (GFXGLPreserveInteger::BindFn)glBindFramebuffer)
|
||||||
|
|
||||||
// Handy macro for checking the status of a framebuffer. Framebuffers can fail in
|
|
||||||
// all sorts of interesting ways, these are just the most common. Further, no existing GL profiling
|
#if TORQUE_DEBUG
|
||||||
// tool catches framebuffer errors when the framebuffer is created, so we actually need this.
|
|
||||||
#define CHECK_FRAMEBUFFER_STATUS()\
|
// Handy macro for checking the status of a framebuffer. Framebuffers can fail in
|
||||||
{\
|
// all sorts of interesting ways, these are just the most common. Further, no existing GL profiling
|
||||||
GLenum status;\
|
// tool catches framebuffer errors when the framebuffer is created, so we actually need this.
|
||||||
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);\
|
#define CHECK_FRAMEBUFFER_STATUS()\
|
||||||
switch(status) {\
|
{\
|
||||||
case GL_FRAMEBUFFER_COMPLETE:\
|
GLenum status;\
|
||||||
break;\
|
status = glCheckFramebufferStatus(GL_FRAMEBUFFER);\
|
||||||
case GL_FRAMEBUFFER_UNSUPPORTED:\
|
switch(status) {\
|
||||||
AssertFatal(false, "Unsupported FBO");\
|
case GL_FRAMEBUFFER_COMPLETE:\
|
||||||
break;\
|
break;\
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:\
|
case GL_FRAMEBUFFER_UNSUPPORTED:\
|
||||||
AssertFatal(false, "Incomplete FBO Attachment");\
|
AssertFatal(false, "Unsupported FBO");\
|
||||||
break;\
|
break;\
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:\
|
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:\
|
||||||
AssertFatal(false, "Incomplete FBO Missing Attachment");\
|
AssertFatal(false, "Incomplete FBO Attachment");\
|
||||||
break;\
|
break;\
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:\
|
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:\
|
||||||
AssertFatal(false, "Incomplete FBO Draw buffer");\
|
AssertFatal(false, "Incomplete FBO Missing Attachment");\
|
||||||
break;\
|
break;\
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:\
|
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:\
|
||||||
AssertFatal(false, "Incomplete FBO Read buffer");\
|
AssertFatal(false, "Incomplete FBO Draw buffer");\
|
||||||
break;\
|
break;\
|
||||||
default:\
|
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:\
|
||||||
/* programming error; will fail on all hardware */\
|
AssertFatal(false, "Incomplete FBO Read buffer");\
|
||||||
AssertFatal(false, "Something really bad happened with an FBO");\
|
break;\
|
||||||
}\
|
default:\
|
||||||
}
|
/* programming error; will fail on all hardware */\
|
||||||
|
AssertFatal(false, "Something really bad happened with an FBO");\
|
||||||
|
}\
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define CHECK_FRAMEBUFFER_STATUS()
|
||||||
|
#endif //TORQUE_DEBUG
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue