[Piglit] [PATCH] glew: add missing BindBufferBase and BindBufferRange for GL 3.0

Paul Berry stereotype441 at gmail.com
Sat Nov 12 08:54:45 PST 2011


OpenGL version 3.0 adds functions BindBufferBase and BindBufferRange
(see OpenGL 3.0 spec, p65):

    void BindBufferRange( enum target, uint index, uint buffer, intptr
                          offset, sizeiptr size );
    void BindBufferBase( enum target, uint index, uint buffer );

However, glew.c was only setting up function pointers for them when
the ARB_uniform_buffer_object extension was present.
ARB_uniform_buffer_object is *not* a required part of GL 3.0.  This
was causing transform feedback piglit tests to fail on implementations
that supported GL 3.0 but did not support ARB_uniform_buffer_object.

I've reported the problem upstream at sourceforge--bug 3436927:

https://sourceforge.net/tracker/?func=detail&aid=3436927&group_id=67586&atid=523274

This patch is a temporary band-aid to make glew.c set up the function
pointers properly, while we wait for an upstream fix.
---
 tests/util/glew.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tests/util/glew.c b/tests/util/glew.c
index 1d638e1..106cf3c 100644
--- a/tests/util/glew.c
+++ b/tests/util/glew.c
@@ -3227,6 +3227,8 @@ static GLboolean _glewInit_GL_VERSION_3_0 (GLEW_CONTEXT_ARG_DEF_INIT)
 
   r = ((glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRender")) == NULL) || r;
   r = ((glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedback")) == NULL) || r;
+  r = ((glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBase")) == NULL) || r;
+  r = ((glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRange")) == NULL) || r;
   r = ((glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocation")) == NULL) || r;
   r = ((glClampColor = (PFNGLCLAMPCOLORPROC)glewGetProcAddress((const GLubyte*)"glClampColor")) == NULL) || r;
   r = ((glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfi")) == NULL) || r;
-- 
1.7.6.4



More information about the Piglit mailing list