diff options
author | Eric Anholt <[email protected]> | 2012-06-18 16:20:11 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2012-06-21 10:58:18 -0700 |
commit | cb9f35d16f9337b34ebfe412b060ff9cad933d79 (patch) | |
tree | 9305ba7f6429fa937194227782547180a1513930 /src/mesa/main/bufferobj.c | |
parent | d103fead197c684c8396183d81bb846213afe81a (diff) |
mesa: Add a comment explaining my thoughts on glBindBufferBase().
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/bufferobj.c')
-rw-r--r-- | src/mesa/main/bufferobj.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index d0d98027aad..5f724ace30c 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -2138,6 +2138,32 @@ _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer) return; } + /* Note that there's some oddness in the GL 3.1-GL 3.3 specifications with + * regards to BindBufferBase. It says (GL 3.1 core spec, page 63): + * + * "BindBufferBase is equivalent to calling BindBufferRange with offset + * zero and size equal to the size of buffer." + * + * but it says for glGetIntegeri_v (GL 3.1 core spec, page 230): + * + * "If the parameter (starting offset or size) was not specified when the + * buffer object was bound, zero is returned." + * + * What happens if the size of the buffer changes? Does the size of the + * buffer at the moment glBindBufferBase was called still play a role, like + * the first quote would imply, or is the size meaningless in the + * glBindBufferBase case like the second quote would suggest? The GL 4.1 + * core spec page 45 says: + * + * "It is equivalent to calling BindBufferRange with offset zero, while + * size is determined by the size of the bound buffer at the time the + * binding is used." + * + * My interpretation is that the GL 4.1 spec was a clarification of the + * behavior, not a change. In particular, this choice will only make + * rendering work in cases where it would have had undefined results. + */ + switch (target) { case GL_TRANSFORM_FEEDBACK_BUFFER: _mesa_bind_buffer_base_transform_feedback(ctx, index, bufObj); |