mesa: implement ARB_texture_storage_multisample + EXT_dsa functions
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Wed, 6 Nov 2019 14:42:10 +0000 (15:42 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Tue, 19 Nov 2019 07:49:45 +0000 (08:49 +0100)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
docs/features.txt
src/mapi/glapi/gen/ARB_texture_storage_multisample.xml
src/mapi/glapi/gen/static_data.py
src/mesa/main/tests/dispatch_sanity.cpp
src/mesa/main/teximage.c
src/mesa/main/teximage.h

index 0e2aaeb3bad0b994a9669bf82fc5426876e11c80..1661e41492d52066074bd7f9a173828b296540d1 100644 (file)
@@ -386,7 +386,7 @@ GL_EXT_direct_state_access additions from other extensions (complete list):
   GL_ARB_sparse_buffer                                  not started
   GL_ARB_texture_buffer_range                           DONE
   GL_ARB_texture_storage                                DONE
-  GL_ARB_texture_storage_multisample                    not started
+  GL_ARB_texture_storage_multisample                    DONE
   GL_ARB_vertex_attrib_64bit                            DONE
   GL_ARB_vertex_attrib_binding                          DONE
   GL_EXT_buffer_storage                                 DONE
index d1dd2f9b4157c3181c87a598930c9e2564371eb2..7785484330a455b28c7355340ed19c636fb7b071 100644 (file)
       <param name="fixedsamplelocations" type="GLboolean"/>
    </function>
 
+   <function name="TextureStorage2DMultisampleEXT">
+      <param name="texture" type="GLuint"/>
+      <param name="target" type="GLenum"/>
+      <param name="samples" type="GLsizei"/>
+      <param name="internalformat" type="GLenum"/>
+      <param name="width" type="GLsizei"/>
+      <param name="height" type="GLsizei"/>
+      <param name="fixedsamplelocations" type="GLboolean"/>
+   </function>
+
+   <function name="TextureStorage3DMultisampleEXT">
+      <param name="texture" type="GLuint"/>
+      <param name="target" type="GLenum"/>
+      <param name="samples" type="GLsizei"/>
+      <param name="internalformat" type="GLenum"/>
+      <param name="width" type="GLsizei"/>
+      <param name="height" type="GLsizei"/>
+      <param name="depth" type="GLsizei"/>
+      <param name="fixedsamplelocations" type="GLboolean"/>
+   </function>
+
 </category>
 
 </OpenGLAPI>
index 98690b1487302a67b5e2282f3a88dce88697367f..7bc95ae383e5d906bb0d385d71bdc41d06cf15c7 100644 (file)
@@ -1623,6 +1623,8 @@ offsets = {
     "VertexArrayVertexAttribLOffsetEXT": 1587,
     "VertexArrayVertexAttribDivisorEXT": 1588,
     "TextureBufferRangeEXT": 1589,
+    "TextureStorage2DMultisampleEXT": 1590,
+    "TextureStorage3DMultisampleEXT": 1591,
 }
 
 functions = [
index f42d4f4b2221e3efaeb8a3fb3a8ca4b1b0a09df9..fdd647a3d1e56a84d528a7b83aafadb9c5a02b91 100644 (file)
@@ -897,8 +897,8 @@ const struct function common_desktop_functions_possible[] = {
    { "glTextureBufferRangeEXT", 43, -1 },
    { "glTexStorage2DMultisample", 43, -1 },
    { "glTexStorage3DMultisample", 43, -1 },
-// { "glTextureStorage2DMultisampleEXT", 43, -1 },      // XXX: Add to xml
-// { "glTextureStorage3DMultisampleEXT", 43, -1 },      // XXX: Add to xml
+   { "glTextureStorage2DMultisampleEXT", 43, -1 },
+   { "glTextureStorage3DMultisampleEXT", 43, -1 },
 
    { "glViewportArrayv", 43, -1 },
    { "glViewportIndexedf", 43, -1 },
index bea5c9ae356440091eb0dd15ad8b446a257c86b7..251cc08ecc5645590e16609829e06d16e639da03 100644 (file)
@@ -6930,6 +6930,52 @@ _mesa_TextureStorage3DMultisample(GLuint texture, GLsizei samples,
                              "glTextureStorage3DMultisample");
 }
 
+void GLAPIENTRY
+_mesa_TextureStorage2DMultisampleEXT(GLuint texture, GLenum target, GLsizei samples,
+                                     GLenum internalformat, GLsizei width,
+                                     GLsizei height,
+                                     GLboolean fixedsamplelocations)
+{
+   struct gl_texture_object *texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = lookup_texture_ext_dsa(ctx, target, texture,
+                                   "glTextureStorage2DMultisampleEXT");
+   if (!texObj)
+      return;
+
+   if (!valid_texstorage_ms_parameters(width, height, 1, 2))
+      return;
+
+   texture_image_multisample(ctx, 2, texObj, NULL, texObj->Target,
+                             samples, internalformat, width, height, 1,
+                             fixedsamplelocations, GL_TRUE, 0,
+                             "glTextureStorage2DMultisampleEXT");
+}
+
+void GLAPIENTRY
+_mesa_TextureStorage3DMultisampleEXT(GLuint texture, GLenum target, GLsizei samples,
+                                     GLenum internalformat, GLsizei width,
+                                     GLsizei height, GLsizei depth,
+                                     GLboolean fixedsamplelocations)
+{
+   struct gl_texture_object *texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = lookup_texture_ext_dsa(ctx, target, texture,
+                                   "glTextureStorage3DMultisampleEXT");
+   if (!texObj)
+      return;
+
+   if (!valid_texstorage_ms_parameters(width, height, depth, 3))
+      return;
+
+   texture_image_multisample(ctx, 3, texObj, NULL, texObj->Target, samples,
+                             internalformat, width, height, depth,
+                             fixedsamplelocations, GL_TRUE, 0,
+                             "glTextureStorage3DMultisampleEXT");
+}
+
 void
 _mesa_texture_storage_ms_memory(struct gl_context *ctx, GLuint dims,
                                 struct gl_texture_object *texObj,
index 66db78df4f924f19532db02f2cd4ac47ddcd5383..bd835883774caf2cadd62632cf4c4b5cdd84f5f6 100644 (file)
@@ -837,6 +837,18 @@ _mesa_TextureStorage3DMultisample(GLuint texture, GLsizei samples,
                                   GLenum internalformat, GLsizei width,
                                   GLsizei height, GLsizei depth,
                                   GLboolean fixedsamplelocations);
+
+extern void GLAPIENTRY
+_mesa_TextureStorage2DMultisampleEXT(GLuint texture, GLenum target, GLsizei samples,
+                                     GLenum internalformat, GLsizei width,
+                                     GLsizei height, GLboolean fixedsamplelocations);
+
+extern void GLAPIENTRY
+_mesa_TextureStorage3DMultisampleEXT(GLuint texture, GLenum target, GLsizei samples,
+                                     GLenum internalformat, GLsizei width,
+                                     GLsizei height, GLsizei depth,
+                                     GLboolean fixedsamplelocations);
+
 /*@}*/
 
 #ifdef __cplusplus