mesa: add EXT_dsa + EXT_texture_buffer_object functions
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 9 Sep 2019 14:22:29 +0000 (16:22 +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/tests/dispatch_sanity.cpp
src/mesa/main/teximage.c
src/mesa/main/teximage.h

index c35eacadeed5a03064e14e0ec85db927d442c4d2..6a26a43dba26968c55a54240789a2b948860975a 100644 (file)
       <param name="params" type="GLint*" />
   </function>
 
+   <!-- EXT_texture_buffer_object -->
+   <function name="TextureBufferEXT">
+      <param name="texture" type="GLuint" />
+      <param name="target" type="GLenum" />
+      <param name="internalformat" type="GLenum" />
+      <param name="buffer" type="GLuint" />
+   </function>
+
+   <function name="MultiTexBufferEXT">
+      <param name="texunit" type="GLenum" />
+      <param name="target" type="GLenum" />
+      <param name="internalformat" type="GLenum" />
+      <param name="buffer" type="GLuint" />
+   </function>
 </category>
 </OpenGLAPI>
index 2116a1b38a5c286949459bf58e5a618e467f8ddf..ae041817bb3fa088f0497f69d586826c33da2e61 100644 (file)
@@ -1582,6 +1582,8 @@ offsets = {
     "NamedProgramLocalParameter4dvEXT": 1546,
     "GetNamedProgramLocalParameterdvEXT": 1547,
     "GetNamedProgramivEXT": 1548,
+    "TextureBufferEXT": 1549,
+    "MultiTexBufferEXT": 1550,
 }
 
 functions = [
index 8e06a7179ddb99c4cc47e25bf83ef1a5f1e3c975..e0451b36df362e044e162083c8a46805ae939b9b 100644 (file)
@@ -1137,8 +1137,8 @@ const struct function common_desktop_functions_possible[] = {
    /* GL_EXT_direct_state_access - GL 2.1 */
    /* Added glProgramUniformMAtrix*EXT functions are aliases */
    /* GL_EXT_direct_state_access - EXT_texture_buffer_object */
-   //{ "glTextureBufferEXT", 10, -1 },
-   //{ "glMultiTexBufferEXT", 10, -1 },
+   { "glTextureBufferEXT", 10, -1 },
+   { "glMultiTexBufferEXT", 10, -1 },
    /* GL_EXT_direct_state_access - EXT_texture_integer */
    //{ "glTextureParameterIivEXT", 10, -1 },
    //{ "glTextureParameterIuivEXT", 10, -1 },
index b80d5a9b675f98375113653daf3d192b0f3b9830..67500830853179392dfb2b5efd22e94294bda43c 100644 (file)
@@ -6428,6 +6428,65 @@ _mesa_TextureBuffer(GLuint texture, GLenum internalFormat, GLuint buffer)
                         bufObj, 0, buffer ? -1 : 0, "glTextureBuffer");
 }
 
+void GLAPIENTRY
+_mesa_TextureBufferEXT(GLuint texture, GLenum target,
+                       GLenum internalFormat, GLuint buffer)
+{
+   struct gl_texture_object *texObj;
+   struct gl_buffer_object *bufObj;
+
+   GET_CURRENT_CONTEXT(ctx);
+
+   if (buffer) {
+      bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, "glTextureBuffer");
+      if (!bufObj)
+         return;
+   } else
+      bufObj = NULL;
+
+   /* Get the texture object by Name. */
+   texObj = _mesa_lookup_or_create_texture(ctx, target, texture,
+                                           false, true,
+                                           "glTextureBufferEXT");
+
+   if (!texObj ||
+       !check_texture_buffer_target(ctx, texObj->Target, "glTextureBufferEXT"))
+      return;
+
+   texture_buffer_range(ctx, texObj, internalFormat,
+                        bufObj, 0, buffer ? -1 : 0, "glTextureBufferEXT");
+}
+
+void GLAPIENTRY
+_mesa_MultiTexBufferEXT(GLenum texunit, GLenum target,
+                        GLenum internalFormat, GLuint buffer)
+{
+   struct gl_texture_object *texObj;
+   struct gl_buffer_object *bufObj;
+
+   GET_CURRENT_CONTEXT(ctx);
+
+   if (buffer) {
+      bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, "glMultiTexBufferEXT");
+      if (!bufObj)
+         return;
+   } else
+      bufObj = NULL;
+
+   /* Get the texture object */
+   texObj = _mesa_get_texobj_by_target_and_texunit(ctx, target,
+                                                   texunit - GL_TEXTURE0,
+                                                   true,
+                                                   "glMultiTexBufferEXT");
+
+   if (!texObj ||
+       !check_texture_buffer_target(ctx, texObj->Target, "glMultiTexBufferEXT"))
+      return;
+
+   texture_buffer_range(ctx, texObj, internalFormat,
+                        bufObj, 0, buffer ? -1 : 0, "glMultiTexBufferEXT");
+}
+
 void GLAPIENTRY
 _mesa_TextureBufferRange(GLuint texture, GLenum internalFormat, GLuint buffer,
                          GLintptr offset, GLsizeiptr size)
index 51d555584c92ca1bdbd84dc6062202ca7c40635a..b14acdf7597fc863a7eeef31e8ea898f4076e861 100644 (file)
@@ -787,6 +787,14 @@ _mesa_TexBufferRange(GLenum target, GLenum internalFormat, GLuint buffer,
 extern void GLAPIENTRY
 _mesa_TextureBuffer(GLuint texture, GLenum internalFormat, GLuint buffer);
 
+extern void GLAPIENTRY
+_mesa_TextureBufferEXT(GLuint texture, GLenum target, GLenum internalFormat,
+                       GLuint buffer);
+
+extern void GLAPIENTRY
+_mesa_MultiTexBufferEXT(GLenum texunit, GLenum target, GLenum internalFormat,
+                        GLuint buffer);
+
 extern void GLAPIENTRY
 _mesa_TextureBufferRange(GLuint texture, GLenum internalFormat, GLuint buffer,
                          GLintptr offset, GLsizeiptr size);