[Mesa-dev] [PATCH 3/3] mesa: don't error check the default buffer object
Timothy Arceri
tarceri at itsqueeze.com
Wed Jul 26 01:11:02 UTC 2017
An allocation check is already done when the buffer is created at
context creation.
---
src/mesa/main/bufferobj.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index cb666dc..b02d011 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -4047,6 +4047,12 @@ bind_buffer_range(GLenum target, GLuint index, GLuint buffer, GLintptr offset,
if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
&bufObj, "glBindBufferRange"))
return;
+
+ if (!no_error && !bufObj) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBindBufferRange(invalid buffer=%u)", buffer);
+ return;
+ }
}
if (no_error) {
@@ -4069,12 +4075,6 @@ bind_buffer_range(GLenum target, GLuint index, GLuint buffer, GLintptr offset,
unreachable("invalid BindBufferRange target with KHR_no_error");
}
} else {
- if (!bufObj) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBindBufferRange(invalid buffer=%u)", buffer);
- return;
- }
-
if (buffer != 0) {
if (size <= 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glBindBufferRange(size=%d)",
@@ -4145,12 +4145,12 @@ _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer)
if (!_mesa_handle_bind_buffer_gen(ctx, buffer,
&bufObj, "glBindBufferBase"))
return;
- }
- if (!bufObj) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glBindBufferBase(invalid buffer=%u)", buffer);
- return;
+ if (!bufObj) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBindBufferBase(invalid buffer=%u)", buffer);
+ return;
+ }
}
/* Note that there's some oddness in the GL 3.1-GL 3.3 specifications with
--
2.9.4
More information about the mesa-dev
mailing list