[Mesa-dev] [PATCH 05/19] glapi: Add infrastructure for ARB_multi_bind

Fredrik Höglund fredrik at kde.org
Mon Apr 21 14:57:43 PDT 2014


---

v2: - Space between type and * in ARB_multi_bind.xml
    - Fix a comment in gl_API.xml

 src/mapi/glapi/gen/ARB_multi_bind.xml   | 53 +++++++++++++++++++++++++++++++++
 src/mapi/glapi/gen/Makefile.am          |  1 +
 src/mapi/glapi/gen/gl_API.xml           |  4 +++
 src/mesa/main/bufferobj.c               | 13 ++++++++
 src/mesa/main/bufferobj.h               |  7 +++++
 src/mesa/main/samplerobj.c              |  6 ++++
 src/mesa/main/samplerobj.h              |  2 ++
 src/mesa/main/shaderimage.c             |  5 ++++
 src/mesa/main/shaderimage.h             |  3 ++
 src/mesa/main/tests/dispatch_sanity.cpp |  8 +++++
 src/mesa/main/texobj.c                  |  6 ++++
 src/mesa/main/texobj.h                  |  4 +++
 src/mesa/main/varray.c                  |  7 +++++
 src/mesa/main/varray.h                  |  4 +++
 14 files changed, 123 insertions(+)
 create mode 100644 src/mapi/glapi/gen/ARB_multi_bind.xml

diff --git a/src/mapi/glapi/gen/ARB_multi_bind.xml b/src/mapi/glapi/gen/ARB_multi_bind.xml
new file mode 100644
index 0000000..4f2f2a2
--- /dev/null
+++ b/src/mapi/glapi/gen/ARB_multi_bind.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<!-- Note: no GLX protocol info yet. -->
+
+<OpenGLAPI>
+
+<category name="GL_ARB_multi_bind" number="147">
+
+    <function name="BindBuffersBase" offset="assign">
+        <param name="target" type="GLenum"/>
+        <param name="first" type="GLuint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="buffers" type="const GLuint *"/>
+    </function>
+
+    <function name="BindBuffersRange" offset="assign">
+        <param name="target" type="GLenum"/>
+        <param name="first" type="GLuint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="buffers" type="const GLuint *"/>
+        <param name="offsets" type="const GLintptr *"/>
+        <param name="sizes" type="const GLsizeiptr *"/>
+    </function>
+
+    <function name="BindTextures" offset="assign">
+        <param name="first" type="GLuint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="textures" type="const GLuint *"/>
+    </function>
+
+    <function name="BindSamplers" offset="assign">
+        <param name="first" type="GLuint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="samplers" type="const GLuint *"/>
+    </function>
+
+    <function name="BindImageTextures" offset="assign">
+        <param name="first" type="GLuint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="textures" type="const GLuint *"/>
+    </function>
+
+    <function name="BindVertexBuffers" offset="assign">
+        <param name="first" type="GLuint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="buffers" type="const GLuint *"/>
+        <param name="offsets" type="const GLintptr *"/>
+        <param name="strides" type="const GLsizei *"/>
+    </function>
+
+</category>
+</OpenGLAPI>
diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am
index 6b932e7..35cf924 100644
--- a/src/mapi/glapi/gen/Makefile.am
+++ b/src/mapi/glapi/gen/Makefile.am
@@ -133,6 +133,7 @@ API_XML = \
 	ARB_internalformat_query.xml \
 	ARB_invalidate_subdata.xml \
 	ARB_map_buffer_range.xml \
+	ARB_multi_bind.xml \
 	ARB_robustness.xml \
 	ARB_sample_shading.xml \
 	ARB_sampler_objects.xml \
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 9200cd6..4664039 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -8341,6 +8341,10 @@
     </function>
 </category>
 
+<!-- ARB extensions #145...#146 -->
+
+<xi:include href="ARB_multi_bind.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
 <!-- Non-ARB extensions sorted by extension number. -->
 
 <category name="GL_EXT_blend_color" number="2">
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 36acd64..65fa740 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -2771,6 +2771,19 @@ _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer)
 }
 
 void GLAPIENTRY
+_mesa_BindBuffersRange(GLenum target, GLuint first, GLsizei count,
+                       const GLuint *buffers,
+                       const GLintptr *offsets, const GLsizeiptr *sizes)
+{
+}
+
+void GLAPIENTRY
+_mesa_BindBuffersBase(GLenum target, GLuint first, GLsizei count,
+                      const GLuint *buffers)
+{
+}
+
+void GLAPIENTRY
 _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
                               GLsizeiptr length)
 {
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index c08c4fd..e1b2a56 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -210,6 +210,13 @@ void GLAPIENTRY
 _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer);
 
 void GLAPIENTRY
+_mesa_BindBuffersRange(GLenum target, GLuint first, GLsizei count,
+                       const GLuint *buffers,
+                       const GLintptr *offsets, const GLsizeiptr *sizes);
+void GLAPIENTRY
+_mesa_BindBuffersBase(GLenum target, GLuint first, GLsizei count,
+                      const GLuint *buffers);
+void GLAPIENTRY
 _mesa_InvalidateBufferSubData(GLuint buffer, GLintptr offset,
                               GLsizeiptr length);
 
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index 4900d52..5757240 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -285,6 +285,12 @@ _mesa_BindSampler(GLuint unit, GLuint sampler)
 }
 
 
+void GLAPIENTRY
+_mesa_BindSamplers(GLuint first, GLsizei count, const GLuint *samplers)
+{
+}
+
+
 /**
  * Check if a coordinate wrap mode is legal.
  * \return GL_TRUE if legal, GL_FALSE otherwise
diff --git a/src/mesa/main/samplerobj.h b/src/mesa/main/samplerobj.h
index c72b1cd..7d80b38 100644
--- a/src/mesa/main/samplerobj.h
+++ b/src/mesa/main/samplerobj.h
@@ -81,6 +81,8 @@ _mesa_IsSampler(GLuint sampler);
 void GLAPIENTRY
 _mesa_BindSampler(GLuint unit, GLuint sampler);
 void GLAPIENTRY
+_mesa_BindSamplers(GLuint first, GLsizei count, const GLuint *samplers);
+void GLAPIENTRY
 _mesa_SamplerParameteri(GLuint sampler, GLenum pname, GLint param);
 void GLAPIENTRY
 _mesa_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param);
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index d1e752d..f77f2c6 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -479,6 +479,11 @@ _mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level,
 }
 
 void GLAPIENTRY
+_mesa_BindImageTextures(GLuint first, GLsizei count, const GLuint *textures)
+{
+}
+
+void GLAPIENTRY
 _mesa_MemoryBarrier(GLbitfield barriers)
 {
    GET_CURRENT_CONTEXT(ctx);
diff --git a/src/mesa/main/shaderimage.h b/src/mesa/main/shaderimage.h
index aaecc5d..733ac77 100644
--- a/src/mesa/main/shaderimage.h
+++ b/src/mesa/main/shaderimage.h
@@ -46,6 +46,9 @@ _mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level,
                        GLenum format);
 
 void GLAPIENTRY
+_mesa_BindImageTextures(GLuint first, GLsizei count, const GLuint *textures);
+
+void GLAPIENTRY
 _mesa_MemoryBarrier(GLbitfield barriers);
 
 #endif
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 8ff975f..b777352 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -882,6 +882,14 @@ const struct function gl_core_functions_possible[] = {
    /* GL_ARB_internalformat_query */
    { "glGetInternalformativ", 30, -1 },
 
+   /* GL_ARB_multi_bind */
+   { "glBindBuffersBase", 44, -1 },
+   { "glBindBuffersRange", 44, -1 },
+   { "glBindTextures", 44, -1 },
+   { "glBindSamplers", 44, -1 },
+   { "glBindImageTextures", 44, -1 },
+   { "glBindVertexBuffers", 44, -1 },
+
    /* GL_KHR_debug/GL_ARB_debug_output */
    { "glPushDebugGroup", 11, -1 },
    { "glPopDebugGroup", 11, -1 },
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 7e43472..724bf5f 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -1371,6 +1371,12 @@ _mesa_BindTexture( GLenum target, GLuint texName )
 }
 
 
+void GLAPIENTRY
+_mesa_BindTextures(GLuint first, GLsizei count, const GLuint *textures)
+{
+}
+
+
 /**
  * Set texture priorities.
  * 
diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h
index a9de73f..25394b6 100644
--- a/src/mesa/main/texobj.h
+++ b/src/mesa/main/texobj.h
@@ -177,6 +177,10 @@ _mesa_BindTexture( GLenum target, GLuint texture );
 
 
 extern void GLAPIENTRY
+_mesa_BindTextures( GLuint first, GLsizei count, const GLuint *textures );
+
+
+extern void GLAPIENTRY
 _mesa_PrioritizeTextures( GLsizei n, const GLuint *textures,
                           const GLclampf *priorities );
 
diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
index 66a3ef1..2f2b23f 100644
--- a/src/mesa/main/varray.c
+++ b/src/mesa/main/varray.c
@@ -1446,6 +1446,13 @@ _mesa_BindVertexBuffer(GLuint bindingIndex, GLuint buffer, GLintptr offset,
 
 
 void GLAPIENTRY
+_mesa_BindVertexBuffers(GLuint first, GLsizei count, const GLuint *buffers,
+                        const GLintptr *offsets, const GLsizei *strides)
+{
+}
+
+
+void GLAPIENTRY
 _mesa_VertexAttribFormat(GLuint attribIndex, GLint size, GLenum type,
                          GLboolean normalized, GLuint relativeOffset)
 {
diff --git a/src/mesa/main/varray.h b/src/mesa/main/varray.h
index bc820ed..76e9574 100644
--- a/src/mesa/main/varray.h
+++ b/src/mesa/main/varray.h
@@ -291,6 +291,10 @@ _mesa_BindVertexBuffer(GLuint bindingIndex, GLuint buffer, GLintptr offset,
                        GLsizei stride);
 
 extern void GLAPIENTRY
+_mesa_BindVertexBuffers(GLuint first, GLsizei count, const GLuint *buffers,
+                        const GLintptr *offsets, const GLsizei *strides);
+
+extern void GLAPIENTRY
 _mesa_VertexAttribFormat(GLuint attribIndex, GLint size, GLenum type,
                          GLboolean normalized, GLuint relativeOffset);
 
-- 
1.8.5.3



More information about the mesa-dev mailing list