diff options
author | Pierre-Eric Pelloux-Prayer <[email protected]> | 2019-09-09 16:22:29 +0200 |
---|---|---|
committer | Pierre-Eric Pelloux-Prayer <[email protected]> | 2019-10-18 10:26:26 +0200 |
commit | 2bdf809e66d16ff571eafa90f7607793ba65266b (patch) | |
tree | 5510064917a83016a9fd723429d25d126e848bd5 /src | |
parent | 28cc07a876d35d8d52120af6859fc7bbe270a9f2 (diff) |
mesa: add EXT_dsa + EXT_texture_buffer_object functions
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mapi/glapi/gen/EXT_direct_state_access.xml | 14 | ||||
-rw-r--r-- | src/mapi/glapi/gen/static_data.py | 2 | ||||
-rw-r--r-- | src/mesa/main/tests/dispatch_sanity.cpp | 4 | ||||
-rw-r--r-- | src/mesa/main/teximage.c | 59 | ||||
-rw-r--r-- | src/mesa/main/teximage.h | 8 |
5 files changed, 85 insertions, 2 deletions
diff --git a/src/mapi/glapi/gen/EXT_direct_state_access.xml b/src/mapi/glapi/gen/EXT_direct_state_access.xml index c35eacadeed..6a26a43dba2 100644 --- a/src/mapi/glapi/gen/EXT_direct_state_access.xml +++ b/src/mapi/glapi/gen/EXT_direct_state_access.xml @@ -1085,5 +1085,19 @@ <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> diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index 2116a1b38a5..ae041817bb3 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1582,6 +1582,8 @@ offsets = { "NamedProgramLocalParameter4dvEXT": 1546, "GetNamedProgramLocalParameterdvEXT": 1547, "GetNamedProgramivEXT": 1548, + "TextureBufferEXT": 1549, + "MultiTexBufferEXT": 1550, } functions = [ 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); |