glapi: add ARB_texture_multisample
authorChris Forbes <chrisf@ijw.co.nz>
Sat, 24 Nov 2012 00:08:45 +0000 (13:08 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Fri, 1 Mar 2013 22:33:20 +0000 (11:33 +1300)
Adds new enums, dispatch machinery, and stubs for the 4 new entrypoints.

V2: - Drop placeholder
    - Align enum values
    - Remove explicit exec=mesa; it *is* the dispatch flavor we want,
      but it's also the default. I misunderstood how this worked before;
      after actually reading the generator it makes good sense.

V3: - Squash in stubs for new entrypoints, and dispatch_sanity tweaks,
      so we don't get build breakage between those patches.

V4: - Fix various remaining whitespace issues

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
[1/3 V2] Reviewed-by: Matt Turner <mattst88@gmail.com>
[V3] Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mapi/glapi/gen/ARB_texture_multisample.xml [new file with mode: 0644]
src/mapi/glapi/gen/gl_API.xml
src/mesa/main/multisample.c
src/mesa/main/multisample.h
src/mesa/main/tests/dispatch_sanity.cpp
src/mesa/main/teximage.c
src/mesa/main/teximage.h

diff --git a/src/mapi/glapi/gen/ARB_texture_multisample.xml b/src/mapi/glapi/gen/ARB_texture_multisample.xml
new file mode 100644 (file)
index 0000000..f0dd4f5
--- /dev/null
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
+
+<!-- Note: no GLX protocol info yet. -->
+
+<OpenGLAPI>
+
+<category name="GL_ARB_texture_multisample" number="67">
+
+   <enum name="SAMPLE_POSITION"                             value="0x8E50"/>
+   <enum name="SAMPLE_MASK"                                 value="0x8E51"/>
+   <enum name="SAMPLE_MASK_VALUE"                           value="0x8E52"/>
+
+   <enum name="TEXTURE_2D_MULTISAMPLE"                      value="0x9100"/>
+   <enum name="PROXY_TEXTURE_2D_MULTISAMPLE"                value="0x9101"/>
+   <enum name="TEXTURE_2D_MULTISAMPLE_ARRAY"                value="0x9102"/>
+   <enum name="PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY"          value="0x9103"/>
+
+   <enum name="MAX_SAMPLE_MASK_WORDS"                       value="0x8E59"/>
+   <enum name="MAX_COLOR_TEXTURE_SAMPLES"                   value="0x910E"/>
+   <enum name="MAX_DEPTH_TEXTURE_SAMPLES"                   value="0x910F"/>
+   <enum name="MAX_INTEGER_SAMPLES"                         value="0x9110"/>
+
+   <enum name="TEXTURE_BINDING_2D_MULTISAMPLE"              value="0x9104"/>
+   <enum name="TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY"        value="0x9105"/>
+
+   <enum name="TEXTURE_SAMPLES"                             value="0x9106"/>
+   <enum name="TEXTURE_FIXED_SAMPLE_LOCATIONS"              value="0x9107"/>
+
+   <enum name="SAMPLER_2D_MULTISAMPLE"                      value="0x9108"/>
+   <enum name="INT_SAMPLER_2D_MULTISAMPLE"                  value="0x9109"/>
+   <enum name="UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE"         value="0x910A"/>
+   <enum name="SAMPLER_2D_MULTISAMPLE_ARRAY"                value="0x910B"/>
+   <enum name="INT_SAMPLER_2D_MULTISAMPLE_ARRAY"            value="0x910C"/>
+   <enum name="UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY"   value="0x910D"/>
+
+   <function name="TexImage2DMultisample" offset="assign">
+      <param name="target" type="GLenum"/>
+      <param name="samples" type="GLsizei"/>
+      <param name="internalformat" type="GLint"/>
+      <param name="width" type="GLsizei"/>
+      <param name="height" type="GLsizei"/>
+      <param name="fixedsamplelocations" type="GLboolean"/>
+   </function>
+
+   <function name="TexImage3DMultisample" offset="assign">
+      <param name="target" type="GLenum"/>
+      <param name="samples" type="GLsizei"/>
+      <param name="internalformat" type="GLint"/>
+      <param name="width" type="GLsizei"/>
+      <param name="height" type="GLsizei"/>
+      <param name="depth" type="GLsizei"/>
+      <param name="fixedsamplelocations" type="GLboolean"/>
+   </function>
+
+   <function name="GetMultisamplefv" offset="assign">
+      <param name="pname" type="GLenum"/>
+      <param name="index" type="GLuint"/>
+      <param name="val" type="GLfloat *"/>
+   </function>
+
+   <function name="SampleMaski" offset="assign">
+      <param name="index" type="GLuint"/>
+      <param name="mask" type="GLbitfield"/>
+   </function>
+
+</category>
+
+</OpenGLAPI>
index 4cbd72462b4b223214f3c3b084ef304b62a5ad62..75957dc7dbdedc5bcda1ed3cafa766a3e8f3d8ff 100644 (file)
 
 <xi:include href="ARB_sync.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
 
-<!-- 67. GL_ARB_texture_multisample -->
+<xi:include href="ARB_texture_multisample.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
 <!-- 68. GL_ARB_vertex_array_bgra -->
 
 <xi:include href="ARB_draw_buffers_blend.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
index f792ad01e74f3b48df5e9daaf4e5e24383291ed1..0687cd042d7354ca51bf3d9ba18f0fe89b19d18c 100644 (file)
@@ -60,3 +60,18 @@ _mesa_init_multisample(struct gl_context *ctx)
    ctx->Multisample.SampleCoverageValue = 1.0;
    ctx->Multisample.SampleCoverageInvert = GL_FALSE;
 }
+
+
+void GLAPIENTRY
+_mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val)
+{
+   assert(!"Not implemented");
+   // TODO: make this work
+}
+
+void GLAPIENTRY
+_mesa_SampleMaski(GLuint index, GLbitfield mask)
+{
+   assert(!"Not implemented");
+   // TODO: make this work
+}
index 30726c34cf1e4be9ba0fdedb9ebed68016e06ee5..9e6b8e0d3f836723720cb300e99299b59feb43ae 100644 (file)
@@ -38,4 +38,10 @@ extern void
 _mesa_init_multisample(struct gl_context *ctx);
 
 
+extern void GLAPIENTRY
+_mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat* val);
+
+extern void GLAPIENTRY
+_mesa_SampleMaski(GLuint index, GLbitfield mask);
+
 #endif
index bf6b297e13952b0bf613afbe77dc2eb116dd0131..3431dedc105db8599f4e54ad09b2eec5868dd222 100644 (file)
@@ -602,10 +602,10 @@ const struct function gl_core_functions_possible[] = {
    { "glWaitSync", 43, -1 },
    { "glGetInteger64v", 43, -1 },
    { "glGetSynciv", 43, -1 },
-// { "glTexImage2DMultisample", 43, -1 },               // XXX: Add to xml
-// { "glTexImage3DMultisample", 43, -1 },               // XXX: Add to xml
-// { "glGetMultisamplefv", 43, -1 },                    // XXX: Add to xml
-// { "glSampleMaski", 43, -1 },                         // XXX: Add to xml
+   { "glTexImage2DMultisample", 43, -1 },
+   { "glTexImage3DMultisample", 43, -1 },
+   { "glGetMultisamplefv", 43, -1 },
+   { "glSampleMaski", 43, -1 },
    { "glBlendEquationiARB", 43, -1 },
    { "glBlendEquationSeparateiARB", 43, -1 },
    { "glBlendFunciARB", 43, -1 },
index f0de0fb4935622d27379cdd08fc1e6bf503ee847..d40d58eecc2c273667f724182c10de2645cc6b3c 100644 (file)
@@ -4102,3 +4102,24 @@ _mesa_TexBufferRange(GLenum target, GLenum internalFormat, GLuint buffer,
 
    texbufferrange(ctx, target, internalFormat, bufObj, offset, size);
 }
+
+
+/** GL_ARB_texture_multisample */
+void GLAPIENTRY
+_mesa_TexImage2DMultisample(GLenum target, GLsizei samples,
+                            GLint internalformat, GLsizei width,
+                            GLsizei height, GLboolean fixedsamplelocations)
+{
+   assert(!"Not implemented");
+   /* allocate a single 2d multisample texture */
+}
+
+void GLAPIENTRY
+_mesa_TexImage3DMultisample(GLenum target, GLsizei samples,
+                            GLint internalformat, GLsizei width,
+                            GLsizei height, GLsizei depth,
+                            GLboolean fixedsamplelocations)
+{
+   assert(!"Not implemented");
+   /* allocate an array of 2d multisample textures */
+}
index 7124cac5214e88afdca4e0e95e910cfc398f312e..744c47a8af6e3d3887b0491c5d03c0ab61a1f2af 100644 (file)
@@ -294,6 +294,17 @@ _mesa_TexBufferRange(GLenum target, GLenum internalFormat, GLuint buffer,
                      GLintptr offset, GLsizeiptr size);
 
 
+extern void GLAPIENTRY
+_mesa_TexImage2DMultisample(GLenum target, GLsizei samples,
+                            GLint internalformat, GLsizei width,
+                            GLsizei height, GLboolean fixedsamplelocations);
+
+extern void GLAPIENTRY
+_mesa_TexImage3DMultisample(GLenum target, GLsizei samples,
+                            GLint internalformat, GLsizei width,
+                            GLsizei height, GLsizei depth,
+                            GLboolean fixedsamplelocations);
+
 /*@}*/
 
 #ifdef __cplusplus