mesa: add EXT_dsa + EXT_texture_integer functions
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 9 Sep 2019 14:44:11 +0000 (16:44 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 18 Oct 2019 08:26:26 +0000 (10:26 +0200)
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/dlist.c
src/mesa/main/tests/dispatch_sanity.cpp
src/mesa/main/texparam.c
src/mesa/main/texparam.h

index 6a26a43dba26968c55a54240789a2b948860975a..1a987e3cd0acfa82992b858cc92d54ff670d3a9f 100644 (file)
       <param name="internalformat" type="GLenum" />
       <param name="buffer" type="GLuint" />
    </function>
+
+   <!-- EXT_texture_integer -->
+   <function name="TextureParameterIivEXT">
+      <param name="texture" type="GLuint" />
+      <param name="target" type="GLenum" />
+      <param name="pname" type="GLenum" />
+      <param name="params" type="const GLint*" />
+   </function>
+
+   <function name="TextureParameterIuivEXT">
+      <param name="texture" type="GLuint" />
+      <param name="target" type="GLenum" />
+      <param name="pname" type="GLenum" />
+      <param name="params" type="const GLuint*" />
+   </function>
+
+   <function name="GetTextureParameterIivEXT">
+      <param name="texture" type="GLuint" />
+      <param name="target" type="GLenum" />
+      <param name="pname" type="GLenum" />
+      <param name="params" type="GLint*" />
+   </function>
+
+   <function name="GetTextureParameterIuivEXT">
+      <param name="texture" type="GLuint" />
+      <param name="target" type="GLenum" />
+      <param name="pname" type="GLenum" />
+      <param name="params" type="GLuint*" />
+   </function>
+
+   <function name="MultiTexParameterIivEXT">
+      <param name="texunit" type="GLenum" />
+      <param name="target" type="GLenum" />
+      <param name="pname" type="GLenum" />
+      <param name="params" type="const GLint*" />
+   </function>
+
+   <function name="MultiTexParameterIuivEXT">
+      <param name="texunit" type="GLenum" />
+      <param name="target" type="GLenum" />
+      <param name="pname" type="GLenum" />
+      <param name="params" type="const GLuint*" />
+   </function>
+
+   <function name="GetMultiTexParameterIivEXT">
+      <param name="texunit" type="GLenum" />
+      <param name="target" type="GLenum" />
+      <param name="pname" type="GLenum" />
+      <param name="params" type="GLint*" />
+   </function>
+
+   <function name="GetMultiTexParameterIuivEXT">
+      <param name="texunit" type="GLenum" />
+      <param name="target" type="GLenum" />
+      <param name="pname" type="GLenum" />
+      <param name="params" type="GLuint*" />
+   </function>
 </category>
 </OpenGLAPI>
index ae041817bb3fa088f0497f69d586826c33da2e61..938acbc0191ddde406fd1fedda3a57b023a6785a 100644 (file)
@@ -1584,6 +1584,14 @@ offsets = {
     "GetNamedProgramivEXT": 1548,
     "TextureBufferEXT": 1549,
     "MultiTexBufferEXT": 1550,
+    "TextureParameterIivEXT": 1551,
+    "TextureParameterIuivEXT": 1552,
+    "GetTextureParameterIivEXT": 1553,
+    "GetTextureParameterIuivEXT": 1554,
+    "MultiTexParameterIivEXT": 1555,
+    "MultiTexParameterIuivEXT": 1556,
+    "GetMultiTexParameterIivEXT": 1557,
+    "GetMultiTexParameterIuivEXT": 1558,
 }
 
 functions = [
index 843446b78b1ce0b58557c6fb3c560b2abc962c32..5d73a4c670c08a1b725dc9d156a4ac18b8eafe07 100644 (file)
@@ -570,6 +570,8 @@ typedef enum
    OPCODE_MATRIX_POP,
    OPCODE_TEXTUREPARAMETER_F,
    OPCODE_TEXTUREPARAMETER_I,
+   OPCODE_TEXTUREPARAMETER_II,
+   OPCODE_TEXTUREPARAMETER_IUI,
    OPCODE_TEXTURE_IMAGE1D,
    OPCODE_TEXTURE_IMAGE2D,
    OPCODE_TEXTURE_IMAGE3D,
@@ -584,6 +586,8 @@ typedef enum
    OPCODE_BIND_MULTITEXTURE,
    OPCODE_MULTITEXPARAMETER_F,
    OPCODE_MULTITEXPARAMETER_I,
+   OPCODE_MULTITEXPARAMETER_II,
+   OPCODE_MULTITEXPARAMETER_IUI,
    OPCODE_MULTITEX_IMAGE1D,
    OPCODE_MULTITEX_IMAGE2D,
    OPCODE_MULTITEX_IMAGE3D,
@@ -9616,6 +9620,49 @@ save_TextureParameteriEXT(GLuint texture, GLenum target, GLenum pname, GLint par
    save_TextureParameterivEXT(texture, target, pname, fparam);
 }
 
+static void GLAPIENTRY
+save_TextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname, const GLint* params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_TEXTUREPARAMETER_II, 7);
+   if (n) {
+      n[1].ui = texture;
+      n[2].e = target;
+      n[3].e = pname;
+      n[4].i = params[0];
+      n[5].i = params[1];
+      n[6].i = params[2];
+      n[7].i = params[3];
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_TextureParameterIivEXT(ctx->Exec, (texture, target, pname, params));
+   }
+}
+
+static void GLAPIENTRY
+save_TextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname, const GLuint* params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_TEXTUREPARAMETER_IUI, 7);
+   if (n) {
+      n[1].ui = texture;
+      n[2].e = target;
+      n[3].e = pname;
+      n[4].ui = params[0];
+      n[5].ui = params[1];
+      n[6].ui = params[2];
+      n[7].ui = params[3];
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_TextureParameterIuivEXT(ctx->Exec, (texture, target, pname, params));
+   }
+}
+
+
 static void GLAPIENTRY
 save_TextureImage1DEXT(GLuint texture, GLenum target,
                        GLint level, GLint components,
@@ -10037,6 +10084,48 @@ save_MultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, const G
    }
 }
 
+static void GLAPIENTRY
+save_MultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_MULTITEXPARAMETER_II, 7);
+   if (n) {
+      n[1].e = texunit;
+      n[2].e = target;
+      n[3].e = pname;
+      n[4].i = params[0];
+      n[5].i = params[1];
+      n[6].i = params[2];
+      n[7].i = params[3];
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_MultiTexParameterIivEXT(ctx->Exec, (texunit, target, pname, params));
+   }
+}
+
+static void GLAPIENTRY
+save_MultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname, const GLuint *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   Node *n;
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+   n = alloc_instruction(ctx, OPCODE_MULTITEXPARAMETER_IUI, 7);
+   if (n) {
+      n[1].e = texunit;
+      n[2].e = target;
+      n[3].e = pname;
+      n[4].ui = params[0];
+      n[5].ui = params[1];
+      n[6].ui = params[2];
+      n[7].ui = params[3];
+   }
+   if (ctx->ExecuteFlag) {
+      CALL_MultiTexParameterIuivEXT(ctx->Exec, (texunit, target, pname, params));
+   }
+}
+
 static void GLAPIENTRY
 save_MultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, GLint param)
 {
@@ -12575,6 +12664,26 @@ execute_list(struct gl_context *ctx, GLuint list)
                CALL_TextureParameterivEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].e, params));
             }
             break;
+         case OPCODE_TEXTUREPARAMETER_II:
+            {
+               GLint params[4];
+               params[0] = n[4].i;
+               params[1] = n[5].i;
+               params[2] = n[6].i;
+               params[3] = n[7].i;
+               CALL_TextureParameterIivEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].e, params));
+            }
+            break;
+         case OPCODE_TEXTUREPARAMETER_IUI:
+            {
+               GLuint params[4];
+               params[0] = n[4].ui;
+               params[1] = n[5].ui;
+               params[2] = n[6].ui;
+               params[3] = n[7].ui;
+               CALL_TextureParameterIuivEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].e, params));
+            }
+            break;
          case OPCODE_TEXTURE_IMAGE1D:
             {
                const struct gl_pixelstore_attrib save = ctx->Unpack;
@@ -12708,6 +12817,26 @@ execute_list(struct gl_context *ctx, GLuint list)
                CALL_MultiTexParameterivEXT(ctx->Exec, (n[1].e, n[2].e, n[3].e, params));
             }
             break;
+         case OPCODE_MULTITEXPARAMETER_II:
+            {
+               GLint params[4];
+               params[0] = n[4].i;
+               params[1] = n[5].i;
+               params[2] = n[6].i;
+               params[3] = n[7].i;
+               CALL_MultiTexParameterIivEXT(ctx->Exec, (n[1].e, n[2].e, n[3].e, params));
+            }
+            break;
+         case OPCODE_MULTITEXPARAMETER_IUI:
+            {
+               GLuint params[4];
+               params[0] = n[4].ui;
+               params[1] = n[5].ui;
+               params[2] = n[6].ui;
+               params[3] = n[7].ui;
+               CALL_MultiTexParameterIuivEXT(ctx->Exec, (n[1].e, n[2].e, n[3].e, params));
+            }
+            break;
          case OPCODE_MULTITEX_IMAGE1D:
             {
                const struct gl_pixelstore_attrib save = ctx->Unpack;
@@ -13906,6 +14035,8 @@ _mesa_initialize_save_table(const struct gl_context *ctx)
    SET_TextureParameterivEXT(table, save_TextureParameterivEXT);
    SET_TextureParameterfEXT(table, save_TextureParameterfEXT);
    SET_TextureParameterfvEXT(table, save_TextureParameterfvEXT);
+   SET_TextureParameterIivEXT(table, save_TextureParameterIivEXT);
+   SET_TextureParameterIuivEXT(table, save_TextureParameterIuivEXT);
    SET_TextureImage1DEXT(table, save_TextureImage1DEXT);
    SET_TextureImage2DEXT(table, save_TextureImage2DEXT);
    SET_TextureImage3DEXT(table, save_TextureImage3DEXT);
@@ -13920,6 +14051,8 @@ _mesa_initialize_save_table(const struct gl_context *ctx)
    SET_BindMultiTextureEXT(table, save_BindMultiTextureEXT);
    SET_MultiTexParameteriEXT(table, save_MultiTexParameteriEXT);
    SET_MultiTexParameterivEXT(table, save_MultiTexParameterivEXT);
+   SET_MultiTexParameterIivEXT(table, save_MultiTexParameterIivEXT);
+   SET_MultiTexParameterIuivEXT(table, save_MultiTexParameterIuivEXT);
    SET_MultiTexParameterfEXT(table, save_MultiTexParameterfEXT);
    SET_MultiTexParameterfvEXT(table, save_MultiTexParameterfvEXT);
    SET_MultiTexImage1DEXT(table, save_MultiTexImage1DEXT);
index e0451b36df362e044e162083c8a46805ae939b9b..ed38f00b6940d0690e8d9d76d6f268845723ddb0 100644 (file)
@@ -1140,14 +1140,14 @@ const struct function common_desktop_functions_possible[] = {
    { "glTextureBufferEXT", 10, -1 },
    { "glMultiTexBufferEXT", 10, -1 },
    /* GL_EXT_direct_state_access - EXT_texture_integer */
-   //{ "glTextureParameterIivEXT", 10, -1 },
-   //{ "glTextureParameterIuivEXT", 10, -1 },
-   //{ "glGetTextureParameterIivEXT", 10, -1 },
-   //{ "glGetTextureParameterIuivEXT", 10, -1 },
-   //{ "glMultiTexParameterIivEXT", 10, -1 },
-   //{ "glMultiTexParameterIuivEXT", 10, -1 },
-   //{ "glGetMultiTexParameterIivEXT", 10, -1 },
-   //{ "glGetMultiTexParameterIuivEXT", 10, -1 },
+   { "glTextureParameterIivEXT", 10, -1 },
+   { "glTextureParameterIuivEXT", 10, -1 },
+   { "glGetTextureParameterIivEXT", 10, -1 },
+   { "glGetTextureParameterIuivEXT", 10, -1 },
+   { "glMultiTexParameterIivEXT", 10, -1 },
+   { "glMultiTexParameterIuivEXT", 10, -1 },
+   { "glGetMultiTexParameterIivEXT", 10, -1 },
+   { "glGetMultiTexParameterIuivEXT", 10, -1 },
    /* GL_EXT_direct_state_access - EXT_gpu_shader4 */
    //{ "glProgramUniform1uiEXT", 10, -1 },
    //{ "glProgramUniform1uivEXT", 10, -1 },
index ade10b2e2b4b18df7f16e5c93110df1fb00bbb82..c642f4569928195d94cf3ba7c04b438e78b78e0e 100644 (file)
@@ -1394,6 +1394,38 @@ _mesa_TextureParameterIiv(GLuint texture, GLenum pname, const GLint *params)
    _mesa_texture_parameterIiv(ctx, texObj, pname, params, true);
 }
 
+void GLAPIENTRY
+_mesa_TextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname,
+                             const GLint *params)
+{
+   struct gl_texture_object *texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_lookup_or_create_texture(ctx, target, texture, false, true,
+                                           "glTextureParameterIivEXT");
+   if (!texObj)
+      return;
+
+   _mesa_texture_parameterIiv(ctx, texObj, pname, params, true);
+}
+
+void GLAPIENTRY
+_mesa_MultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname,
+                              const GLint *params)
+{
+   struct gl_texture_object *texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_get_texobj_by_target_and_texunit(ctx, target,
+                                                   texunit - GL_TEXTURE0,
+                                                   true,
+                                                   "glMultiTexParameterIivEXT");
+   if (!texObj)
+      return;
+
+   _mesa_texture_parameterIiv(ctx, texObj, pname, params, true);
+}
+
 void GLAPIENTRY
 _mesa_TextureParameterIuiv(GLuint texture, GLenum pname, const GLuint *params)
 {
@@ -1407,6 +1439,38 @@ _mesa_TextureParameterIuiv(GLuint texture, GLenum pname, const GLuint *params)
    _mesa_texture_parameterIuiv(ctx, texObj, pname, params, true);
 }
 
+void GLAPIENTRY
+_mesa_TextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname,
+                              const GLuint *params)
+{
+   struct gl_texture_object *texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_lookup_or_create_texture(ctx, target, texture, false, true,
+                                           "glTextureParameterIuivEXT");
+   if (!texObj)
+      return;
+
+   _mesa_texture_parameterIuiv(ctx, texObj, pname, params, true);
+}
+
+void GLAPIENTRY
+_mesa_MultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname,
+                               const GLuint *params)
+{
+   struct gl_texture_object *texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_get_texobj_by_target_and_texunit(ctx, target,
+                                                   texunit - GL_TEXTURE0,
+                                                   true,
+                                                   "glMultiTexParameterIuivEXT");
+   if (!texObj)
+      return;
+
+   _mesa_texture_parameterIuiv(ctx, texObj, pname, params, true);
+}
+
 GLboolean
 _mesa_legal_get_tex_level_parameter_target(struct gl_context *ctx, GLenum target,
                                            bool dsa)
@@ -2739,6 +2803,37 @@ _mesa_GetTextureParameterIiv(GLuint texture, GLenum pname, GLint *params)
    get_tex_parameterIiv(ctx, texObj, pname, params, true);
 }
 
+void GLAPIENTRY
+_mesa_GetTextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname, GLint *params)
+{
+   struct gl_texture_object *texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_lookup_or_create_texture(ctx, target, texture, false, true,
+                                           "glGetTextureParameterIivEXT");
+   if (!texObj)
+      return;
+
+
+   get_tex_parameterIiv(ctx, texObj, pname, params, true);
+}
+
+void GLAPIENTRY
+_mesa_GetMultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname,
+                                 GLint *params)
+{
+   struct gl_texture_object *texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_get_texobj_by_target_and_texunit(ctx, target,
+                                                   texunit - GL_TEXTURE0,
+                                                   true,
+                                                   "glGetMultiTexParameterIiv");
+   if (!texObj)
+      return;
+
+   get_tex_parameterIiv(ctx, texObj, pname, params, true);
+}
 
 void GLAPIENTRY
 _mesa_GetTextureParameterIuiv(GLuint texture, GLenum pname, GLuint *params)
@@ -2752,3 +2847,35 @@ _mesa_GetTextureParameterIuiv(GLuint texture, GLenum pname, GLuint *params)
 
    get_tex_parameterIiv(ctx, texObj, pname, (GLint *) params, true);
 }
+
+void GLAPIENTRY
+_mesa_GetTextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname,
+                                 GLuint *params)
+{
+   struct gl_texture_object *texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_lookup_or_create_texture(ctx, target, texture, false, true,
+                                           "glGetTextureParameterIuvEXT");
+   if (!texObj)
+      return;
+
+   get_tex_parameterIiv(ctx, texObj, pname, (GLint *) params, true);
+}
+
+void GLAPIENTRY
+_mesa_GetMultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname,
+                               GLuint *params)
+{
+   struct gl_texture_object *texObj;
+   GET_CURRENT_CONTEXT(ctx);
+
+   texObj = _mesa_get_texobj_by_target_and_texunit(ctx, target,
+                                                   texunit - GL_TEXTURE0,
+                                                   true,
+                                                   "glGetMultiTexParameterIuiv");
+   if (!texObj)
+      return;
+
+   get_tex_parameterIiv(ctx, texObj, pname, (GLint *) params, true);
+}
index 858a5126a84b025e00277d0d31d9ceb6217074fe..d352b560138f71a9122d44b5af8b6f214981d13d 100644 (file)
@@ -143,9 +143,21 @@ _mesa_GetTextureParameteriv(GLuint texture, GLenum pname, GLint *params);
 extern void GLAPIENTRY
 _mesa_GetTextureParameterIiv(GLuint texture, GLenum pname, GLint *params);
 
+extern void GLAPIENTRY
+_mesa_GetTextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname, GLint *params);
+
+extern void GLAPIENTRY
+_mesa_GetMultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname, GLint *params);
+
 extern void GLAPIENTRY
 _mesa_GetTextureParameterIuiv(GLuint texture, GLenum pname, GLuint *params);
 
+extern void GLAPIENTRY
+_mesa_GetTextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname, GLuint *params);
+
+extern void GLAPIENTRY
+_mesa_GetMultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname, GLuint *params);
+
 
 extern void GLAPIENTRY
 _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params );
@@ -192,9 +204,21 @@ _mesa_TextureParameteriv(GLuint texture, GLenum pname, const GLint *params);
 extern void GLAPIENTRY
 _mesa_TextureParameterIiv(GLuint texture, GLenum pname, const GLint *params);
 
+extern void GLAPIENTRY
+_mesa_TextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname, const GLint *params);
+
+extern void GLAPIENTRY
+_mesa_MultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params);
+
 extern void GLAPIENTRY
 _mesa_TextureParameterIuiv(GLuint texture, GLenum pname, const GLuint *params);
 
+extern void GLAPIENTRY
+_mesa_TextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname, const GLuint *params);
+
+extern void GLAPIENTRY
+_mesa_MultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname, const GLuint *params);
+
 extern void GLAPIENTRY
 _mesa_MultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param);