summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <[email protected]>2019-09-09 16:22:29 +0200
committerPierre-Eric Pelloux-Prayer <[email protected]>2019-10-18 10:26:26 +0200
commit2bdf809e66d16ff571eafa90f7607793ba65266b (patch)
tree5510064917a83016a9fd723429d25d126e848bd5 /src/mesa
parent28cc07a876d35d8d52120af6859fc7bbe270a9f2 (diff)
mesa: add EXT_dsa + EXT_texture_buffer_object functions
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp4
-rw-r--r--src/mesa/main/teximage.c59
-rw-r--r--src/mesa/main/teximage.h8
3 files changed, 69 insertions, 2 deletions
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 8e06a7179dd..e0451b36df3 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -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 },
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index b80d5a9b675..67500830853 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -6429,6 +6429,65 @@ _mesa_TextureBuffer(GLuint texture, GLenum internalFormat, GLuint buffer)
}
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)
{
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 51d555584c9..b14acdf7597 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -788,6 +788,14 @@ 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);