summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client/gles2_implementation.h
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer/client/gles2_implementation.h')
-rw-r--r--gpu/command_buffer/client/gles2_implementation.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index 0791558..75dba70 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -49,6 +49,14 @@
#define GPU_CLIENT_DCHECK_CODE_BLOCK(code)
#endif
+#if defined(GPU_CLIENT_DEBUG)
+ // Set to 1 to have the client fail when a GL error is generated.
+ // This helps find bugs in the renderer since the debugger stops on the error.
+# if 0
+# define GL_CLIENT_FAIL_GL_ERRORS
+# endif
+#endif
+
// Check that destination pointers point to initialized memory.
// When the context is lost, calling GL function has no effect so if destination
// pointers point to initialized memory it can often lead to crash bugs. eg.
@@ -475,6 +483,14 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
const std::string& GetLogPrefix() const;
+#if defined(GL_CLIENT_FAIL_GL_ERRORS)
+ void CheckGLError();
+ void FailGLError(GLenum error);
+#else
+ void CheckGLError() { }
+ void FailGLError(GLenum /* error */) { }
+#endif
+
GLES2Util util_;
GLES2CmdHelper* helper_;
TransferBufferInterface* transfer_buffer_;