mesa: add EXT_dsa glCompressedTexture(Sub)Image1D/2D/3D functions
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 6 May 2019 09:25:04 +0000 (11:25 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 19 Aug 2019 22:49:57 +0000 (18:49 -0400)
Reviewed-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/texgetimage.c
src/mesa/main/texgetimage.h
src/mesa/main/teximage.c
src/mesa/main/teximage.h

index 155b2ade145cf63686811e5cfc402fb0387b10f5..108bbad875799c8111cebb709c608365ab87eafa 100644 (file)
       <param name="m" type="const GLdouble *" />
     </function>
 
+   <function name="CompressedTextureImage1DEXT">
+      <param name="texture" type="GLuint" />
+      <param name="target" type="GLenum" />
+      <param name="level" type="GLint" />
+      <param name="internalFormat" type="GLenum" />
+      <param name="width" type="GLsizei" />
+      <param name="border" type="GLsizei" />
+      <param name="imageSize" type="GLsizei" />
+      <param name="data" type="const GLvoid *" />
+   </function>
+
+   <function name="CompressedTextureImage2DEXT">
+      <param name="texture" type="GLuint" />
+      <param name="target" type="GLenum" />
+      <param name="level" type="GLint" />
+      <param name="internalFormat" type="GLenum" />
+      <param name="width" type="GLsizei" />
+      <param name="height" type="GLsizei" />
+      <param name="border" type="GLsizei" />
+      <param name="imageSize" type="GLsizei" />
+      <param name="data" type="const GLvoid *" />
+   </function>
+
+   <function name="CompressedTextureImage3DEXT">
+      <param name="texture" type="GLuint" />
+      <param name="target" type="GLenum" />
+      <param name="level" type="GLint" />
+      <param name="internalFormat" type="GLenum" />
+      <param name="width" type="GLsizei" />
+      <param name="height" type="GLsizei" />
+      <param name="depth" type="GLsizei" />
+      <param name="border" type="GLsizei" />
+      <param name="imageSize" type="GLsizei" />
+      <param name="data" type="const GLvoid *" />
+   </function>
+
+   <function name="CompressedTextureSubImage1DEXT">
+      <param name="texture" type="GLuint" />
+      <param name="target" type="GLenum" />
+      <param name="level" type="GLint" />
+      <param name="xoffset" type="GLint" />
+      <param name="width" type="GLsizei" />
+      <param name="format" type="GLenum" />
+      <param name="imageSize" type="GLsizei" />
+      <param name="data" type="const GLvoid *" />
+   </function>
+
    <function name="CompressedTextureSubImage2DEXT">
       <param name="texture" type="GLuint" />
       <param name="target" type="GLenum" />
       <param name="data" type="const GLvoid *" />
    </function>
 
+   <function name="CompressedTextureSubImage3DEXT">
+      <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="zoffset" type="GLint" />
+      <param name="width" type="GLsizei" />
+      <param name="height" type="GLsizei" />
+      <param name="depth" type="GLsizei" />
+      <param name="format" type="GLenum" />
+      <param name="imageSize" type="GLsizei" />
+      <param name="data" type="const GLvoid *" />
+   </function>
+
+   <function name="GetCompressedTextureImageEXT">
+      <param name="texture" type="GLuint" />
+      <param name="target" type="GLenum" />
+      <param name="level" type="GLint" />
+      <param name="img" type="GLvoid *" />
+   </function>
+
    <!-- OpenGL 1.5 -->
 
    <function name="NamedBufferDataEXT">
index 231563fd622d5aa8e17fc4e47b088974d9bd09ae..c9b59988864b3fd9e8b76fa85a7123d87858c29d 100644 (file)
@@ -1489,69 +1489,75 @@ offsets = {
     "CopyTextureSubImage1DEXT": 1453,
     "CopyTextureSubImage2DEXT": 1454,
     "CopyTextureSubImage3DEXT": 1455,
-    "CompressedTextureSubImage2DEXT": 1456,
-    "MapNamedBufferEXT": 1457,
-    "GetTextureParameterivEXT": 1458,
-    "GetTextureParameterfvEXT": 1459,
-    "TextureParameteriEXT": 1460,
-    "TextureParameterivEXT": 1461,
-    "TextureParameterfEXT": 1462,
-    "TextureParameterfvEXT": 1463,
-    "GetTextureImageEXT": 1464,
-    "GetTextureLevelParameterivEXT": 1465,
-    "GetTextureLevelParameterfvEXT": 1466,
-    "GetNamedBufferSubDataEXT": 1467,
-    "GetNamedBufferPointervEXT": 1468,
-    "GetNamedBufferParameterivEXT": 1469,
-    "FlushMappedNamedBufferRangeEXT": 1470,
-    "FramebufferDrawBufferEXT": 1471,
-    "FramebufferDrawBuffersEXT": 1472,
-    "FramebufferReadBufferEXT": 1473,
-    "GetFramebufferParameterivEXT": 1474,
-    "CheckNamedFramebufferStatusEXT": 1475,
-    "NamedFramebufferTexture1DEXT": 1476,
-    "NamedFramebufferTexture2DEXT": 1477,
-    "NamedFramebufferTexture3DEXT": 1478,
-    "NamedFramebufferRenderbufferEXT": 1479,
-    "GetNamedFramebufferAttachmentParameterivEXT": 1480,
-    "EnableClientStateiEXT": 1481,
-    "DisableClientStateiEXT": 1482,
-    "GetPointerIndexedvEXT": 1483,
-    "MultiTexEnviEXT": 1484,
-    "MultiTexEnvivEXT": 1485,
-    "MultiTexEnvfEXT": 1486,
-    "MultiTexEnvfvEXT": 1487,
-    "GetMultiTexEnvivEXT": 1488,
-    "GetMultiTexEnvfvEXT": 1489,
-    "MultiTexParameteriEXT": 1490,
-    "MultiTexParameterivEXT": 1491,
-    "MultiTexParameterfEXT": 1492,
-    "MultiTexParameterfvEXT": 1493,
-    "GetMultiTexImageEXT": 1494,
-    "MultiTexImage1DEXT": 1495,
-    "MultiTexImage2DEXT": 1496,
-    "MultiTexImage3DEXT": 1497,
-    "MultiTexSubImage1DEXT": 1498,
-    "MultiTexSubImage2DEXT": 1499,
-    "MultiTexSubImage3DEXT": 1500,
-    "GetMultiTexParameterivEXT": 1501,
-    "GetMultiTexParameterfvEXT": 1502,
-    "CopyMultiTexImage1DEXT": 1503,
-    "CopyMultiTexImage2DEXT": 1504,
-    "CopyMultiTexSubImage1DEXT": 1505,
-    "CopyMultiTexSubImage2DEXT": 1506,
-    "CopyMultiTexSubImage3DEXT": 1507,
-    "MultiTexGendEXT": 1508,
-    "MultiTexGendvEXT": 1509,
-    "MultiTexGenfEXT": 1510,
-    "MultiTexGenfvEXT": 1511,
-    "MultiTexGeniEXT": 1512,
-    "MultiTexGenivEXT": 1513,
-    "GetMultiTexGendvEXT": 1514,
-    "GetMultiTexGenfvEXT": 1515,
-    "GetMultiTexGenivEXT": 1516,
-    "MultiTexCoordPointerEXT": 1517,
-    "BindImageTextureEXT": 1518,
+    "MapNamedBufferEXT": 1456,
+    "GetTextureParameterivEXT": 1457,
+    "GetTextureParameterfvEXT": 1458,
+    "TextureParameteriEXT": 1459,
+    "TextureParameterivEXT": 1460,
+    "TextureParameterfEXT": 1461,
+    "TextureParameterfvEXT": 1462,
+    "GetTextureImageEXT": 1463,
+    "GetTextureLevelParameterivEXT": 1464,
+    "GetTextureLevelParameterfvEXT": 1465,
+    "GetNamedBufferSubDataEXT": 1466,
+    "GetNamedBufferPointervEXT": 1467,
+    "GetNamedBufferParameterivEXT": 1468,
+    "FlushMappedNamedBufferRangeEXT": 1469,
+    "FramebufferDrawBufferEXT": 1470,
+    "FramebufferDrawBuffersEXT": 1471,
+    "FramebufferReadBufferEXT": 1472,
+    "GetFramebufferParameterivEXT": 1473,
+    "CheckNamedFramebufferStatusEXT": 1474,
+    "NamedFramebufferTexture1DEXT": 1475,
+    "NamedFramebufferTexture2DEXT": 1476,
+    "NamedFramebufferTexture3DEXT": 1477,
+    "NamedFramebufferRenderbufferEXT": 1478,
+    "GetNamedFramebufferAttachmentParameterivEXT": 1479,
+    "EnableClientStateiEXT": 1480,
+    "DisableClientStateiEXT": 1481,
+    "GetPointerIndexedvEXT": 1482,
+    "MultiTexEnviEXT": 1483,
+    "MultiTexEnvivEXT": 1484,
+    "MultiTexEnvfEXT": 1485,
+    "MultiTexEnvfvEXT": 1486,
+    "GetMultiTexEnvivEXT": 1487,
+    "GetMultiTexEnvfvEXT": 1488,
+    "MultiTexParameteriEXT": 1489,
+    "MultiTexParameterivEXT": 1490,
+    "MultiTexParameterfEXT": 1491,
+    "MultiTexParameterfvEXT": 1492,
+    "GetMultiTexImageEXT": 1493,
+    "MultiTexImage1DEXT": 1494,
+    "MultiTexImage2DEXT": 1495,
+    "MultiTexImage3DEXT": 1496,
+    "MultiTexSubImage1DEXT": 1497,
+    "MultiTexSubImage2DEXT": 1498,
+    "MultiTexSubImage3DEXT": 1499,
+    "GetMultiTexParameterivEXT": 1500,
+    "GetMultiTexParameterfvEXT": 1501,
+    "CopyMultiTexImage1DEXT": 1502,
+    "CopyMultiTexImage2DEXT": 1503,
+    "CopyMultiTexSubImage1DEXT": 1504,
+    "CopyMultiTexSubImage2DEXT": 1505,
+    "CopyMultiTexSubImage3DEXT": 1506,
+    "MultiTexGendEXT": 1507,
+    "MultiTexGendvEXT": 1508,
+    "MultiTexGenfEXT": 1509,
+    "MultiTexGenfvEXT": 1510,
+    "MultiTexGeniEXT": 1511,
+    "MultiTexGenivEXT": 1512,
+    "GetMultiTexGendvEXT": 1513,
+    "GetMultiTexGenfvEXT": 1514,
+    "GetMultiTexGenivEXT": 1515,
+    "MultiTexCoordPointerEXT": 1516,
+    "BindImageTextureEXT": 1517,
+    "CompressedTextureImage1DEXT": 1518,
+    "CompressedTextureImage2DEXT": 1519,
+    "CompressedTextureImage3DEXT": 1520,
+    "CompressedTextureSubImage1DEXT": 1521,
+    "CompressedTextureSubImage2DEXT": 1522,
+    "CompressedTextureSubImage3DEXT": 1523,
+    "GetCompressedTextureImageEXT": 1524,
 }
 
 functions = [
index 2542f15b056fe06912f5aac27a80f60308afb711..6b478fded885df7f182a5a16f139dae292564816 100644 (file)
@@ -1106,13 +1106,13 @@ const struct function common_desktop_functions_possible[] = {
    //{ "glGetNamedProgramivEXT", 10, -1 },
    //{ "glGetNamedProgramStringEXT", 10, -1 },
    /* GL_EXT_direct_state_access - GL 1.3 */
-   //{ "glCompressedTextureImage1DEXT", 13, -1 },
-   //{ "glCompressedTextureImage2DEXT", 13, -1 },
-   //{ "glCompressedTextureImage3DEXT", 13, -1 },
-   //{ "glCompressedTextureSubImage1DEXT", 13, -1 },
+   { "glCompressedTextureImage1DEXT", 13, -1 },
+   { "glCompressedTextureImage2DEXT", 13, -1 },
+   { "glCompressedTextureImage3DEXT", 13, -1 },
+   { "glCompressedTextureSubImage1DEXT", 13, -1 },
    { "glCompressedTextureSubImage2DEXT", 13, -1 },
-   //{ "glCompressedTextureSubImage3DEXT", 13, -1 },
-   //{ "glGetCompressedTextureImageEXT", 13, -1 },
+   { "glCompressedTextureSubImage3DEXT", 13, -1 },
+   { "glGetCompressedTextureImageEXT", 13, -1 },
    //{ "glCompressedMultiTexImage1DEXT", 13, -1 },
    //{ "glCompressedMultiTexImage2DEXT", 13, -1 },
    //{ "glCompressedMultiTexImage3DEXT", 13, -1 },
index 0e475e53893731d718081e5a1d1dafc3d9a381c4..749d0b2131310c01e8772006ca98284a7fd04e7e 100644 (file)
@@ -1884,6 +1884,32 @@ _mesa_GetCompressedTexImage(GLenum target, GLint level, GLvoid *pixels)
 }
 
 
+void GLAPIENTRY
+_mesa_GetCompressedTextureImageEXT(GLuint texture, GLenum target, GLint level,
+                                   GLvoid *pixels)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_texture_object*  texObj;
+   GLsizei width, height, depth;
+   static const char *caller = "glGetCompressedTextureImageEXT";
+
+   texObj = _mesa_lookup_or_create_texture(ctx, target, texture,
+                                           false, true, caller);
+   get_texture_image_dims(texObj, texObj->Target, level,
+                          &width, &height, &depth);
+
+   if (getcompressedteximage_error_check(ctx, texObj, texObj->Target, level,
+                                         0, 0, 0, width, height, depth,
+                                         INT_MAX, pixels, caller)) {
+      return;
+   }
+
+   get_compressed_texture_image(ctx, texObj, texObj->Target, level,
+                                0, 0, 0, width, height, depth,
+                                pixels, caller);
+}
+
+
 void GLAPIENTRY
 _mesa_GetCompressedTextureImage(GLuint texture, GLint level,
                                 GLsizei bufSize, GLvoid *pixels)
index 9a27aacc0404a0abcd64d978da3992df9ba309c1..da87cbeea9ea4a425e943b375728fd0ccc36a00c 100644 (file)
@@ -88,6 +88,10 @@ extern void GLAPIENTRY
 _mesa_GetCompressedTextureImage(GLuint texture, GLint level, GLsizei bufSize,
                                 GLvoid *pixels);
 
+extern void GLAPIENTRY
+_mesa_GetCompressedTextureImageEXT(GLuint texture, GLenum target, GLint level,
+                                   GLvoid *pixels);
+
 extern void APIENTRY
 _mesa_GetCompressedTextureSubImage(GLuint texture, GLint level,
                                    GLint xoffset, GLint yoffset,
index 8a36247c5a1cb50e6f09671a88094f5f5e02f89a..875d2226ad99cfadd677b9ed3de8a9cc24d9836c 100644 (file)
@@ -5358,6 +5358,24 @@ _mesa_CompressedTexImage1D(GLenum target, GLint level,
 }
 
 
+void GLAPIENTRY
+_mesa_CompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level,
+                                  GLenum internalFormat, GLsizei width,
+                                  GLint border, GLsizei imageSize,
+                                  const GLvoid *pixels)
+{
+   struct gl_texture_object*  texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_lookup_or_create_texture(ctx, target, texture, false, true,
+                                           "glCompressedTextureImage1DEXT");
+   if (!texObj)
+      return;
+   teximage(ctx, GL_TRUE, 1, texObj, target, level, internalFormat,
+            width, 1, 1, border, GL_NONE, GL_NONE, imageSize, pixels, false);
+}
+
+
 void GLAPIENTRY
 _mesa_CompressedTexImage2D(GLenum target, GLint level,
                               GLenum internalFormat, GLsizei width,
@@ -5370,6 +5388,24 @@ _mesa_CompressedTexImage2D(GLenum target, GLint level,
 }
 
 
+void GLAPIENTRY
+_mesa_CompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level,
+                                  GLenum internalFormat, GLsizei width,
+                                  GLsizei height, GLint border, GLsizei imageSize,
+                                  const GLvoid *pixels)
+{
+   struct gl_texture_object*  texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_lookup_or_create_texture(ctx, target, texture, false, true,
+                                           "glCompressedTextureImage2DEXT");
+   if (!texObj)
+      return;
+   teximage(ctx, GL_TRUE, 2, texObj, target, level, internalFormat,
+            width, height, 1, border, GL_NONE, GL_NONE, imageSize, pixels, false);
+}
+
+
 void GLAPIENTRY
 _mesa_CompressedTexImage3D(GLenum target, GLint level,
                               GLenum internalFormat, GLsizei width,
@@ -5382,6 +5418,25 @@ _mesa_CompressedTexImage3D(GLenum target, GLint level,
 }
 
 
+void GLAPIENTRY
+_mesa_CompressedTextureImage3DEXT(GLuint texture, GLenum target, GLint level,
+                                  GLenum internalFormat, GLsizei width,
+                                  GLsizei height, GLsizei depth, GLint border,
+                                  GLsizei imageSize, const GLvoid *pixels)
+{
+   struct gl_texture_object*  texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_lookup_or_create_texture(ctx, target, texture, false, true,
+                                           "glCompressedTextureImage3DEXT");
+   if (!texObj)
+      return;
+   teximage(ctx, GL_TRUE, 3, texObj, target, level, internalFormat,
+            width, height, depth, border, GL_NONE, GL_NONE, imageSize, pixels, false);
+}
+
+
+
 void GLAPIENTRY
 _mesa_CompressedTexImage1D_no_error(GLenum target, GLint level,
                                     GLenum internalFormat, GLsizei width,
@@ -5626,6 +5681,20 @@ _mesa_CompressedTextureSubImage1D(GLuint texture, GLint level, GLint xoffset,
 }
 
 
+void GLAPIENTRY
+_mesa_CompressedTextureSubImage1DEXT(GLuint texture, GLenum target,
+                                     GLint level, GLint xoffset,
+                                     GLsizei width, GLenum format,
+                                     GLsizei imageSize, const GLvoid *data)
+{
+   compressed_tex_sub_image(1, target, texture, level, xoffset, 0,
+                            0, width, 1, 1, format, imageSize,
+                            data,
+                            TEX_MODE_EXT_DSA_TEXTURE,
+                            "glCompressedTextureSubImage1DEXT");
+}
+
+
 void GLAPIENTRY
 _mesa_CompressedTexSubImage2D_no_error(GLenum target, GLint level,
                                        GLint xoffset, GLint yoffset,
@@ -5755,6 +5824,22 @@ _mesa_CompressedTextureSubImage3D(GLuint texture, GLint level, GLint xoffset,
 }
 
 
+void GLAPIENTRY
+_mesa_CompressedTextureSubImage3DEXT(GLuint texture, GLenum target,
+                                     GLint level, GLint xoffset,
+                                     GLint yoffset, GLint zoffset,
+                                     GLsizei width, GLsizei height,
+                                     GLsizei depth, GLenum format,
+                                     GLsizei imageSize, const GLvoid *data)
+{
+   compressed_tex_sub_image(3, target, texture, level, xoffset, yoffset,
+                            zoffset, width, height, depth, format,
+                            imageSize, data,
+                            TEX_MODE_EXT_DSA_TEXTURE,
+                            "glCompressedTextureSubImage3DEXT");
+}
+
+
 mesa_format
 _mesa_get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
 {
index 891fa16565c2b79312db1775eaf5b604be2bf6d9..b0211870e71a8c790d45eecb306db3533e830d35 100644 (file)
@@ -595,18 +595,36 @@ _mesa_CompressedTexImage1D(GLenum target, GLint level,
                               GLint border, GLsizei imageSize,
                               const GLvoid *data);
 
+extern void GLAPIENTRY
+_mesa_CompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level,
+                                  GLenum internalFormat, GLsizei width,
+                                  GLint border, GLsizei imageSize,
+                                  const GLvoid *pixels);
+
 extern void GLAPIENTRY
 _mesa_CompressedTexImage2D(GLenum target, GLint level,
                               GLenum internalformat, GLsizei width,
                               GLsizei height, GLint border, GLsizei imageSize,
                               const GLvoid *data);
 
+extern void GLAPIENTRY
+_mesa_CompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level,
+                                  GLenum internalFormat, GLsizei width,
+                                  GLsizei height, GLint border, GLsizei imageSize,
+                                  const GLvoid *pixels);
+
 extern void GLAPIENTRY
 _mesa_CompressedTexImage3D(GLenum target, GLint level,
                               GLenum internalformat, GLsizei width,
                               GLsizei height, GLsizei depth, GLint border,
                               GLsizei imageSize, const GLvoid *data);
 
+extern void GLAPIENTRY
+_mesa_CompressedTextureImage3DEXT(GLuint texture, GLenum target, GLint level,
+                                  GLenum internalFormat, GLsizei width,
+                                  GLsizei height, GLsizei depth, GLint border,
+                                  GLsizei imageSize, const GLvoid *pixels);
+
 extern void GLAPIENTRY
 _mesa_CompressedTexImage1D_no_error(GLenum target, GLint level,
                                     GLenum internalformat, GLsizei width,
@@ -646,6 +664,11 @@ _mesa_CompressedTextureSubImage1D(GLuint texture, GLint level, GLint xoffset,
                                   GLsizei width, GLenum format,
                                   GLsizei imageSize, const GLvoid *data);
 
+extern void GLAPIENTRY
+_mesa_CompressedTextureSubImage1DEXT(GLuint texture, GLenum target, 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,
@@ -653,6 +676,14 @@ _mesa_CompressedTextureSubImage2DEXT(GLuint texture, GLenum target,
                                      GLsizei height, GLenum format,
                                      GLsizei imageSize, const GLvoid *data);
 
+extern void GLAPIENTRY
+_mesa_CompressedTextureSubImage3DEXT(GLuint texture, GLenum target,
+                                     GLint level, GLint xoffset,
+                                     GLint yoffset, GLint zoffset,
+                                     GLsizei width, GLsizei height, GLsizei depth,
+                                     GLenum format, GLsizei imageSize,
+                                     const GLvoid *data);
+
 extern void GLAPIENTRY
 _mesa_CompressedTexSubImage2D_no_error(GLenum target, GLint level,
                                        GLint xoffset, GLint yoffset,