[Mesa-dev] [PATCH 31/40] mesa: Add ARB_viewport_array plumbing

Ian Romanick idr at freedesktop.org
Fri Jan 10 17:40:32 PST 2014


From: Courtney Goeltzenleuchter <courtney at LunarG.com>

Define API connections to extension entry points added in previous
commits. Update entry points to use floating point arguments as
required by the extension.
Add get tokens for ARB_viewport_array state.

v2: Include review feedback.

v3 (idr): Fix 'make check'.  Add missing Get infrastructure (some was
culled from other pathces).
---
 src/mapi/glapi/gen/ARB_viewport_array.xml | 79 +++++++++++++++++++++++++++++++
 src/mapi/glapi/gen/Makefile.am            |  1 +
 src/mapi/glapi/gen/gl_API.xml             |  2 +-
 src/mesa/main/get.c                       |  1 +
 src/mesa/main/get_hash_params.py          |  9 +++-
 src/mesa/main/tests/dispatch_sanity.cpp   | 20 ++++----
 6 files changed, 100 insertions(+), 12 deletions(-)
 create mode 100644 src/mapi/glapi/gen/ARB_viewport_array.xml

diff --git a/src/mapi/glapi/gen/ARB_viewport_array.xml b/src/mapi/glapi/gen/ARB_viewport_array.xml
new file mode 100644
index 0000000..e1c6c2d
--- /dev/null
+++ b/src/mapi/glapi/gen/ARB_viewport_array.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<!-- Note: no GLX protocol info yet. -->
+
+<OpenGLAPI>
+
+<category name="GL_ARB_viewport_array" number="100">
+
+    <enum name="MAX_VIEWPORTS" value="0x825B"/>
+    <enum name="VIEWPORT_SUBPIXEL_BITS" value="0x825C"/>
+    <enum name="VIEWPORT_BOUNDS_RANGE" value="0x825D"/>
+    <enum name="LAYER_PROVOKING_VERTEX" value="0x825E"/>
+    <enum name="VIEWPORT_INDEX_PROVOKING_VERTEX" value="0x825F"/>
+    <enum name="SCISSOR_BOX" value="0x0C10"/>
+    <enum name="VIEWPORT" value="0x0BA2"/>
+    <enum name="DEPTH_RANGE" value="0x0B70"/>
+    <enum name="SCISSOR_TEST" value="0x0C11"/>
+    <enum name="FIRST_VERTEX_CONVENTION" value="0x8E4D"/>
+    <enum name="LAST_VERTEX_CONVENTION" value="0x8E4E"/>
+    <enum name="PROVOKING_VERTEX" value="0x8E4F"/>
+    <enum name="UNDEFINED_VERTEX" value="0x8260"/>
+
+    <function name="ViewportArrayv" offset="assign">
+        <param name="first" type="GLuint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="v" type="const GLfloat *"/>
+    </function>
+    <function name="ViewportIndexedf" offset="assign">
+        <param name="index" type="GLuint"/>
+        <param name="x" type="GLfloat"/>
+        <param name="y" type="GLfloat"/>
+        <param name="w" type="GLfloat"/>
+        <param name="h" type="GLfloat"/>
+    </function>
+    <function name="ViewportIndexedfv" offset="assign">
+        <param name="index" type="GLuint"/>
+        <param name="v" type="const GLfloat *"/>
+    </function>
+    <function name="ScissorArrayv" offset="assign">
+        <param name="first" type="GLuint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="v" type="const int *"/>
+    </function>
+    <function name="ScissorIndexed" offset="assign">
+        <param name="index" type="GLuint"/>
+        <param name="left" type="GLint"/>
+        <param name="bottom" type="GLint"/>
+        <param name="width" type="GLsizei"/>
+        <param name="height" type="GLsizei"/>
+    </function>
+    <function name="ScissorIndexedv" offset="assign">
+        <param name="index" type="GLuint"/>
+        <param name="v" type="const GLint *"/>
+    </function>
+    <function name="DepthRangeArrayv" offset="assign">
+        <param name="first" type="GLuint"/>
+        <param name="count" type="GLsizei"/>
+        <param name="v" type="const GLclampd *"/>
+    </function>
+    <function name="DepthRangeIndexed" offset="assign">
+        <param name="index" type="GLuint"/>
+        <param name="n" type="GLclampd"/>
+        <param name="f" type="GLclampd"/>
+    </function>
+    <function name="GetFloati_v" offset="assign">
+        <param name="target" type="GLenum"/>
+        <param name="index" type="GLuint"/>
+        <param name="data" type="GLfloat *"/>
+    </function>
+    <function name="GetDoublei_v" offset="assign">
+        <param name="target" type="GLenum"/>
+        <param name="index" type="GLuint"/>
+        <param name="data" type="GLdouble *"/>
+    </function>
+
+</category>
+
+</OpenGLAPI>
diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am
index 65bd913..6063610 100644
--- a/src/mapi/glapi/gen/Makefile.am
+++ b/src/mapi/glapi/gen/Makefile.am
@@ -128,6 +128,7 @@ API_XML = \
 	ARB_texture_view.xml \
 	ARB_vertex_array_object.xml \
 	ARB_vertex_attrib_binding.xml \
+	ARB_viewport_array.xml \
 	AMD_draw_buffers_blend.xml \
 	AMD_performance_monitor.xml \
 	ARB_vertex_type_2_10_10_10_rev.xml \
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 697b2ec..0c1e445 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -9924,7 +9924,7 @@
 </category>
 
 <!-- Extension number 99 is not listed in the extension registry. -->
-<!-- Extension number 100 is a GLU extension. -->
+<xi:include href="ARB_viewport_array.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 
 <!-- Shouldn't this be EXT_fragment_lighting? -->
 <category name="GL_SGIX_fragment_lighting" number="102">
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 811e283..1928307 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -385,6 +385,7 @@ EXTRA_EXT(ARB_texture_multisample);
 EXTRA_EXT(ARB_texture_gather);
 EXTRA_EXT(ARB_shader_atomic_counters);
 EXTRA_EXT(ARB_draw_indirect);
+EXTRA_EXT(ARB_viewport_array);
 
 static const int
 extra_ARB_color_buffer_float_or_glcore[] = {
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 412a951..06ad959 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -44,7 +44,7 @@ descriptor=[
   [ "SUBPIXEL_BITS", "CONTEXT_INT(Const.SubPixelBits), NO_EXTRA" ],
   [ "TEXTURE_BINDING_2D", "LOC_CUSTOM, TYPE_INT, TEXTURE_2D_INDEX, NO_EXTRA" ],
   [ "UNPACK_ALIGNMENT", "CONTEXT_INT(Unpack.Alignment), NO_EXTRA" ],
-  [ "VIEWPORT", "LOC_CUSTOM, TYPE_INT_4, 0, NO_EXTRA" ],
+  [ "VIEWPORT", "LOC_CUSTOM, TYPE_FLOAT_4, 0, NO_EXTRA" ],
 
 # GL_ARB_multitexture
   [ "ACTIVE_TEXTURE", "LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA" ],
@@ -750,6 +750,13 @@ descriptor=[
   [ "TEXTURE_BUFFER_OFFSET_ALIGNMENT", "CONTEXT_INT(Const.TextureBufferOffsetAlignment), extra_ARB_texture_buffer_range" ],
 # GL_ARB_draw_indirect
   [ "DRAW_INDIRECT_BUFFER_BINDING", "LOC_CUSTOM, TYPE_INT, 0, extra_ARB_draw_indirect" ],
+
+# GL_ARB_viewport_array
+  [ "MAX_VIEWPORTS", "CONTEXT_INT(Const.MaxViewports), extra_ARB_viewport_array" ],
+  [ "VIEWPORT_SUBPIXEL_BITS", "CONTEXT_INT(Const.ViewportSubpixelBits), extra_ARB_viewport_array" ],
+  [ "VIEWPORT_BOUNDS_RANGE", "CONTEXT_FLOAT2(Const.ViewportBounds), extra_ARB_viewport_array" ],
+  [ "LAYER_PROVOKING_VERTEX", "CONTEXT_ENUM(Light.ProvokingVertex), extra_ARB_viewport_array" ],
+  [ "VIEWPORT_INDEX_PROVOKING_VERTEX", "CONTEXT_ENUM(Light.ProvokingVertex), extra_ARB_viewport_array" ],
 ]}
 
 ]
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 227a4fd..544b02e 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -786,16 +786,16 @@ const struct function gl_core_functions_possible[] = {
 // { "glVertexAttribL4dv", 43, -1 },                    // XXX: Add to xml
 // { "glVertexAttribLPointer", 43, -1 },                // XXX: Add to xml
 // { "glGetVertexAttribLdv", 43, -1 },                  // XXX: Add to xml
-// { "glViewportArrayv", 43, -1 },                      // XXX: Add to xml
-// { "glViewportIndexedf", 43, -1 },                    // XXX: Add to xml
-// { "glViewportIndexedfv", 43, -1 },                   // XXX: Add to xml
-// { "glScissorArrayv", 43, -1 },                       // XXX: Add to xml
-// { "glScissorIndexed", 43, -1 },                      // XXX: Add to xml
-// { "glScissorIndexedv", 43, -1 },                     // XXX: Add to xml
-// { "glDepthRangeArrayv", 43, -1 },                    // XXX: Add to xml
-// { "glDepthRangeIndexed", 43, -1 },                   // XXX: Add to xml
-// { "glGetFloati_v", 43, -1 },                         // XXX: Add to xml
-// { "glGetDoublei_v", 43, -1 },                        // XXX: Add to xml
+   { "glViewportArrayv", 43, -1 },
+   { "glViewportIndexedf", 43, -1 },
+   { "glViewportIndexedfv", 43, -1 },
+   { "glScissorArrayv", 43, -1 },
+   { "glScissorIndexed", 43, -1 },
+   { "glScissorIndexedv", 43, -1 },
+   { "glDepthRangeArrayv", 43, -1 },
+   { "glDepthRangeIndexed", 43, -1 },
+   { "glGetFloati_v", 43, -1 },
+   { "glGetDoublei_v", 43, -1 },
 // { "glCreateSyncFromCLeventARB", 43, -1 },            // XXX: Add to xml
    { "glDebugMessageControlARB", 43, -1 },
    { "glDebugMessageInsertARB", 43, -1 },
-- 
1.8.1.4



More information about the mesa-dev mailing list