mesa: add support for glCompressedTextureSubImage2DEXT()
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 3 Sep 2018 00:27:38 +0000 (10:27 +1000)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 28 Jun 2019 19:41:20 +0000 (15:41 -0400)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/mapi/glapi/gen/EXT_direct_state_access.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 53c6aa7d5634588ce7e76bb13acd34f3b00461bc..1eef0e3c39ba93d230331fa86f783380daf7ef3f 100644 (file)
    <function name="MatrixMultTransposedEXT" offset="assign">
       <param name="matrixMode" type="GLenum" />
       <param name="m" type="const GLdouble *" />
+    </function>
+
+   <function name="CompressedTextureSubImage2DEXT">
+      <param name="texture" type="GLuint" />
+      <param name="target" type="GLenum" />
+      <param name="level" type="GLint" />
+      <param name="xoffset" type="GLint" />
+      <param name="yoffset" type="GLint" />
+      <param name="width" type="GLsizei" />
+      <param name="height" type="GLsizei" />
+      <param name="format" type="GLenum" />
+      <param name="imageSize" type="GLsizei" />
+      <param name="data" type="const GLvoid *" />
    </function>
 
    <!-- OpenGL 1.5 -->
index e7b1e12650887fadac9e9eaad923584ff1b1f738..b938942ec89be8c69fa80336344d04446e44b3bc 100644 (file)
@@ -1479,6 +1479,7 @@ offsets = {
     "NamedBufferStorageEXT": 1443,
     "MapNamedBufferRangeEXT": 1444,
     "TextureSubImage2DEXT": 1445,
+    "CompressedTextureSubImage2DEXT": 1446,
 }
 
 functions = [
index fa41aa66e38dc314afbdc4fcac80bc79b9f60c28..8cb63da17b26b7198a8640903583366d6ba6a257 100644 (file)
@@ -1111,7 +1111,7 @@ const struct function common_desktop_functions_possible[] = {
    //{ "glCompressedTextureImage2DEXT", 13, -1 },
    //{ "glCompressedTextureImage3DEXT", 13, -1 },
    //{ "glCompressedTextureSubImage1DEXT", 13, -1 },
-   //{ "glCompressedTextureSubImage2DEXT", 13, -1 },
+   { "glCompressedTextureSubImage2DEXT", 13, -1 },
    //{ "glCompressedTextureSubImage3DEXT", 13, -1 },
    //{ "glGetCompressedTextureImageEXT", 13, -1 },
    //{ "glCompressedMultiTexImage1DEXT", 13, -1 },
index 8508fbb711ee01ac8e646b801c4e0b84c26e628c..253183da815c06c919a6e543318e77a84646eb1c 100644 (file)
@@ -5043,8 +5043,8 @@ compressed_tex_sub_image(unsigned dim, GLenum target, GLuint texture,
                          GLint level, GLint xoffset, GLint yoffset,
                          GLint zoffset, GLsizei width, GLsizei height,
                          GLsizei depth, GLenum format, GLsizei imageSize,
-                         const GLvoid *data, bool dsa, bool no_error,
-                         const char *caller)
+                         const GLvoid *data, bool dsa, bool ext_dsa,
+                         bool no_error, const char *caller)
 {
    struct gl_texture_object *texObj = NULL;
    struct gl_texture_image *texImage;
@@ -5054,13 +5054,20 @@ compressed_tex_sub_image(unsigned dim, GLenum target, GLuint texture,
    if (dsa) {
       if (no_error) {
          texObj = _mesa_lookup_texture(ctx, texture);
+         target = texObj->Target;
       } else {
-         texObj = _mesa_lookup_texture_err(ctx, texture, caller);
-         if (!texObj)
-            return;
-      }
+         if (!ext_dsa) {
+            texObj = _mesa_lookup_texture_err(ctx, texture, caller);
+            if (!texObj)
+               return;
 
-      target = texObj->Target;
+            target = texObj->Target;
+         } else {
+            texObj = lookup_texture_ext_dsa(ctx, target, texture, caller);
+            if (!texObj)
+               return;
+         }
+      }
    }
 
    if (!no_error &&
@@ -5131,12 +5138,12 @@ compressed_tex_sub_image_error(unsigned dim, GLenum target, GLuint texture,
                                GLint level, GLint xoffset, GLint yoffset,
                                GLint zoffset, GLsizei width, GLsizei height,
                                GLsizei depth, GLenum format, GLsizei imageSize,
-                               const GLvoid *data, bool dsa,
+                               const GLvoid *data, bool dsa, bool ext_dsa,
                                const char *caller)
 {
    compressed_tex_sub_image(dim, target, texture, level, xoffset, yoffset,
                             zoffset, width, height, depth, format, imageSize,
-                            data, dsa, false, caller);
+                            data, dsa, ext_dsa, false, caller);
 }
 
 static void
@@ -5144,12 +5151,12 @@ compressed_tex_sub_image_no_error(unsigned dim, GLenum target, GLuint texture,
                                   GLint level, GLint xoffset, GLint yoffset,
                                   GLint zoffset, GLsizei width, GLsizei height,
                                   GLsizei depth, GLenum format, GLsizei imageSize,
-                                  const GLvoid *data, bool dsa,
+                                  const GLvoid *data, bool dsa, bool ext_dsa,
                                   const char *caller)
 {
    compressed_tex_sub_image(dim, target, texture, level, xoffset, yoffset,
                             zoffset, width, height, depth, format, imageSize,
-                            data, dsa, true, caller);
+                            data, dsa, ext_dsa, true, caller);
 }
 
 void GLAPIENTRY
@@ -5160,7 +5167,7 @@ _mesa_CompressedTexSubImage1D_no_error(GLenum target, GLint level,
 {
    compressed_tex_sub_image_no_error(1, target, 0, level, xoffset, 0, 0, width,
                                      1, 1, format, imageSize, data, false,
-                                     "glCompressedTexSubImage1D");
+                                     false, "glCompressedTexSubImage1D");
 }
 
 
@@ -5170,7 +5177,7 @@ _mesa_CompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset,
                               GLsizei imageSize, const GLvoid *data)
 {
    compressed_tex_sub_image_error(1, target, 0, level, xoffset, 0, 0, width, 1,
-                                  1, format, imageSize, data, false,
+                                  1, format, imageSize, data, false, false,
                                   "glCompressedTexSubImage1D");
 }
 
@@ -5181,8 +5188,9 @@ _mesa_CompressedTextureSubImage1D_no_error(GLuint texture, GLint level,
                                            GLenum format, GLsizei imageSize,
                                            const GLvoid *data)
 {
-   compressed_tex_sub_image_no_error(1, 0, texture, level, xoffset, 0, 0, width,
-                                     1, 1, format, imageSize, data, true,
+   compressed_tex_sub_image_no_error(1, 0, texture, level, xoffset, 0, 0,
+                                     width, 1, 1, format, imageSize, data,
+                                     true, false,
                                      "glCompressedTextureSubImage1D");
 }
 
@@ -5193,10 +5201,11 @@ _mesa_CompressedTextureSubImage1D(GLuint texture, GLint level, GLint xoffset,
                                   GLsizei imageSize, const GLvoid *data)
 {
    compressed_tex_sub_image_error(1, 0, texture, level, xoffset, 0, 0, width,
-                                  1, 1, format, imageSize, data, true,
+                                  1, 1, format, imageSize, data, true, false,
                                   "glCompressedTextureSubImage1D");
 }
 
+
 void GLAPIENTRY
 _mesa_CompressedTexSubImage2D_no_error(GLenum target, GLint level,
                                        GLint xoffset, GLint yoffset,
@@ -5206,7 +5215,8 @@ _mesa_CompressedTexSubImage2D_no_error(GLenum target, GLint level,
 {
    compressed_tex_sub_image_no_error(2, target, 0, level, xoffset, yoffset, 0,
                                      width, height, 1, format, imageSize, data,
-                                     false, "glCompressedTexSubImage2D");
+                                     false, false,
+                                     "glCompressedTexSubImage2D");
 }
 
 
@@ -5218,7 +5228,22 @@ _mesa_CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset,
 {
    compressed_tex_sub_image_error(2, target, 0, level, xoffset, yoffset, 0,
                                   width, height, 1, format, imageSize, data,
-                                  false, "glCompressedTexSubImage2D");
+                                  false, false,
+                                  "glCompressedTexSubImage2D");
+}
+
+
+void GLAPIENTRY
+_mesa_CompressedTextureSubImage2DEXT(GLuint texture, GLenum target,
+                                     GLint level, GLint xoffset,
+                                     GLint yoffset, GLsizei width,
+                                     GLsizei height, GLenum format,
+                                     GLsizei imageSize, const GLvoid *data)
+{
+   compressed_tex_sub_image_error(2, target, texture, level, xoffset, yoffset,
+                                  0, width, height, 1, format, imageSize,
+                                  data, true, true,
+                                  "glCompressedTextureSubImage2DEXT");
 }
 
 
@@ -5231,7 +5256,8 @@ _mesa_CompressedTextureSubImage2D_no_error(GLuint texture, GLint level,
 {
    compressed_tex_sub_image_no_error(2, 0, texture, level, xoffset, yoffset, 0,
                                      width, height, 1, format, imageSize, data,
-                                     true, "glCompressedTextureSubImage2D");
+                                     true, false,
+                                     "glCompressedTextureSubImage2D");
 }
 
 
@@ -5244,7 +5270,8 @@ _mesa_CompressedTextureSubImage2D(GLuint texture, GLint level, GLint xoffset,
 {
    compressed_tex_sub_image_error(2, 0, texture, level, xoffset, yoffset, 0,
                                   width, height, 1, format, imageSize, data,
-                                  true, "glCompressedTextureSubImage2D");
+                                  true, false,
+                                  "glCompressedTextureSubImage2D");
 }
 
 void GLAPIENTRY
@@ -5257,7 +5284,7 @@ _mesa_CompressedTexSubImage3D_no_error(GLenum target, GLint level,
 {
    compressed_tex_sub_image_no_error(3, target, 0, level, xoffset, yoffset,
                                      zoffset, width, height, depth, format,
-                                     imageSize, data, false,
+                                     imageSize, data, false, false,
                                      "glCompressedTexSubImage3D");
 }
 
@@ -5269,7 +5296,7 @@ _mesa_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset,
 {
    compressed_tex_sub_image_error(3, target, 0, level, xoffset, yoffset,
                                   zoffset, width, height, depth, format,
-                                  imageSize, data, false,
+                                  imageSize, data, false, false,
                                   "glCompressedTexSubImage3D");
 }
 
@@ -5283,7 +5310,7 @@ _mesa_CompressedTextureSubImage3D_no_error(GLuint texture, GLint level,
 {
    compressed_tex_sub_image_no_error(3, 0, texture, level, xoffset, yoffset,
                                      zoffset, width, height, depth, format,
-                                     imageSize, data, true,
+                                     imageSize, data, true,  false,
                                      "glCompressedTextureSubImage3D");
 }
 
@@ -5296,7 +5323,7 @@ _mesa_CompressedTextureSubImage3D(GLuint texture, GLint level, GLint xoffset,
 {
    compressed_tex_sub_image_error(3, 0, texture, level, xoffset, yoffset,
                                   zoffset, width, height, depth, format,
-                                  imageSize, data, true,
+                                  imageSize, data, true, false,
                                   "glCompressedTextureSubImage3D");
 }
 
index 494b167e2d51f2291160e9d8fae27dd0bfe12ef1..b480ec5f448446a159aae9ef53f142bc21dbac36 100644 (file)
@@ -532,6 +532,13 @@ _mesa_CompressedTextureSubImage1D(GLuint texture, GLint level, GLint xoffset,
                                   GLsizei width, GLenum format,
                                   GLsizei imageSize, const GLvoid *data);
 
+void GLAPIENTRY
+_mesa_CompressedTextureSubImage2DEXT(GLuint texture, GLenum target,
+                                     GLint level, GLint xoffset,
+                                     GLint yoffset, GLsizei width,
+                                     GLsizei height, GLenum format,
+                                     GLsizei imageSize, const GLvoid *data);
+
 extern void GLAPIENTRY
 _mesa_CompressedTexSubImage2D_no_error(GLenum target, GLint level,
                                        GLint xoffset, GLint yoffset,