[Mesa-dev] [PATCH 05/24] glapi: Add support for ARB_shader_atomic_counters.

Francisco Jerez currojerez at riseup.net
Sun Sep 15 00:10:31 PDT 2013


Add XML file for the dispatch code generator, update the
dispatch_sanity test and add stub definition for the new entry point.
---
 src/mapi/glapi/gen/ARB_shader_atomic_counters.xml | 47 +++++++++++++++++++++++
 src/mapi/glapi/gen/Makefile.am                    |  1 +
 src/mapi/glapi/gen/gl_API.xml                     |  2 +
 src/mesa/main/tests/dispatch_sanity.cpp           |  2 +-
 src/mesa/main/uniforms.c                          |  6 +++
 src/mesa/main/uniforms.h                          |  3 ++
 6 files changed, 60 insertions(+), 1 deletion(-)
 create mode 100644 src/mapi/glapi/gen/ARB_shader_atomic_counters.xml

diff --git a/src/mapi/glapi/gen/ARB_shader_atomic_counters.xml b/src/mapi/glapi/gen/ARB_shader_atomic_counters.xml
new file mode 100644
index 0000000..f3b74e9
--- /dev/null
+++ b/src/mapi/glapi/gen/ARB_shader_atomic_counters.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<OpenGLAPI>
+
+<category name="GL_ARB_shader_atomic_counters" number="114">
+
+<enum name="ATOMIC_COUNTER_BUFFER" value="0x92C0"/>
+<enum name="ATOMIC_COUNTER_BUFFER_BINDING" value="0x92C1"/>
+<enum name="ATOMIC_COUNTER_BUFFER_START" value="0x92C2"/>
+<enum name="ATOMIC_COUNTER_BUFFER_SIZE" value="0x92C3"/>
+<enum name="ATOMIC_COUNTER_BUFFER_DATA_SIZE" value="0x92C4"/>
+<enum name="ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS" value="0x92C5"/>
+<enum name="ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES" value="0x92C6"/>
+<enum name="ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER" value="0x92C7"/>
+<enum name="ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER" value="0x92C8"/>
+<enum name="ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER" value="0x92C9"/>
+<enum name="ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER" value="0x92CA"/>
+<enum name="ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER" value="0x92CB"/>
+<enum name="MAX_VERTEX_ATOMIC_COUNTER_BUFFERS" value="0x92CC"/>
+<enum name="MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS" value="0x92CD"/>
+<enum name="MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS" value="0x92CE"/>
+<enum name="MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS" value="0x92CF"/>
+<enum name="MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS" value="0x92D0"/>
+<enum name="MAX_COMBINED_ATOMIC_COUNTER_BUFFERS" value="0x92D1"/>
+<enum name="MAX_VERTEX_ATOMIC_COUNTERS" value="0x92D2"/>
+<enum name="MAX_TESS_CONTROL_ATOMIC_COUNTERS" value="0x92D3"/>
+<enum name="MAX_TESS_EVALUATION_ATOMIC_COUNTERS" value="0x92D4"/>
+<enum name="MAX_GEOMETRY_ATOMIC_COUNTERS" value="0x92D5"/>
+<enum name="MAX_FRAGMENT_ATOMIC_COUNTERS" value="0x92D6"/>
+<enum name="MAX_COMBINED_ATOMIC_COUNTERS" value="0x92D7"/>
+<enum name="MAX_ATOMIC_COUNTER_BUFFER_SIZE" value="0x92D8"/>
+<enum name="ACTIVE_ATOMIC_COUNTER_BUFFERS" value="0x92D9"/>
+<enum name="UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX" value="0x92DA"/>
+<enum name="UNSIGNED_INT_ATOMIC_COUNTER" value="0x92DB"/>
+<enum name="MAX_ATOMIC_COUNTER_BUFFER_BINDINGS" value="0x92DC"/>
+
+<function name="GetActiveAtomicCounterBufferiv" offset="assign">
+    <param name="program" type="GLuint" />
+    <param name="bufferIndex" type="GLuint" />
+    <param name="pname" type="GLenum" />
+    <param name="params" type="GLint *" />
+</function>
+
+</category>
+
+</OpenGLAPI>
diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am
index d4fbd35..df96f3c 100644
--- a/src/mapi/glapi/gen/Makefile.am
+++ b/src/mapi/glapi/gen/Makefile.am
@@ -106,6 +106,7 @@ API_XML = \
 	ARB_robustness.xml \
 	ARB_sampler_objects.xml \
 	ARB_seamless_cube_map.xml \
+	ARB_shader_atomic_counters.xml \
 	ARB_sync.xml \
 	ARB_texture_buffer_object.xml \
 	ARB_texture_buffer_range.xml \
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 71aa9a7..bd5bd4a 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -8308,6 +8308,8 @@
   <enum name="MIN_MAP_BUFFER_ALIGNMENT" value="0x90BC" />
 </category>
 
+<xi:include href="ARB_shader_atomic_counters.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
 <xi:include href="ARB_texture_storage.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 
 <!-- ARB extension #118 -->
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index bea6e96..5d416f7 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -827,7 +827,7 @@ const struct function gl_core_functions_possible[] = {
    { "glDrawTransformFeedbackInstanced", 43, -1 },
    { "glDrawTransformFeedbackStreamInstanced", 43, -1 },
 // { "glGetInternalformativ", 43, -1 },                 // XXX: Add to xml
-// { "glGetActiveAtomicCounterBufferiv", 43, -1 },      // XXX: Add to xml
+   { "glGetActiveAtomicCounterBufferiv", 43, -1 },
 // { "glBindImageTexture", 43, -1 },                    // XXX: Add to xml
 // { "glMemoryBarrier", 43, -1 },                       // XXX: Add to xml
    { "glTexStorage1D", 43, -1 },
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 1e6f7f4..07e7ea3 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -844,3 +844,9 @@ _mesa_get_uniform_name(const struct gl_uniform_storage *uni,
       *length += i;
    }
 }
+
+void GLAPIENTRY
+_mesa_GetActiveAtomicCounterBufferiv(GLuint program, GLuint bufferIndex,
+                                     GLenum pname, GLint *params)
+{
+}
diff --git a/src/mesa/main/uniforms.h b/src/mesa/main/uniforms.h
index 9223917..f7cac63 100644
--- a/src/mesa/main/uniforms.h
+++ b/src/mesa/main/uniforms.h
@@ -142,6 +142,9 @@ _mesa_UniformBlockBinding(GLuint program,
 			  GLuint uniformBlockIndex,
 			  GLuint uniformBlockBinding);
 void GLAPIENTRY
+_mesa_GetActiveAtomicCounterBufferiv(GLuint program, GLuint bufferIndex,
+                                     GLenum pname, GLint *params);
+void GLAPIENTRY
 _mesa_GetActiveUniformBlockiv(GLuint program,
 			      GLuint uniformBlockIndex,
 			      GLenum pname,
-- 
1.8.3.4



More information about the mesa-dev mailing list