From bb2241bf06b6e23eb632523ae582e90c4c429a8b Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Wed, 6 Nov 2019 15:42:10 +0100 Subject: [PATCH] mesa: implement ARB_texture_storage_multisample + EXT_dsa functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák --- docs/features.txt | 2 +- .../gen/ARB_texture_storage_multisample.xml | 21 +++++++++ src/mapi/glapi/gen/static_data.py | 2 + src/mesa/main/tests/dispatch_sanity.cpp | 4 +- src/mesa/main/teximage.c | 46 +++++++++++++++++++ src/mesa/main/teximage.h | 12 +++++ 6 files changed, 84 insertions(+), 3 deletions(-) diff --git a/docs/features.txt b/docs/features.txt index 0e2aaeb3bad..1661e41492d 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -386,7 +386,7 @@ GL_EXT_direct_state_access additions from other extensions (complete list): GL_ARB_sparse_buffer not started GL_ARB_texture_buffer_range DONE GL_ARB_texture_storage DONE - GL_ARB_texture_storage_multisample not started + GL_ARB_texture_storage_multisample DONE GL_ARB_vertex_attrib_64bit DONE GL_ARB_vertex_attrib_binding DONE GL_EXT_buffer_storage DONE diff --git a/src/mapi/glapi/gen/ARB_texture_storage_multisample.xml b/src/mapi/glapi/gen/ARB_texture_storage_multisample.xml index d1dd2f9b415..7785484330a 100644 --- a/src/mapi/glapi/gen/ARB_texture_storage_multisample.xml +++ b/src/mapi/glapi/gen/ARB_texture_storage_multisample.xml @@ -26,6 +26,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index 98690b14873..7bc95ae383e 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1623,6 +1623,8 @@ offsets = { "VertexArrayVertexAttribLOffsetEXT": 1587, "VertexArrayVertexAttribDivisorEXT": 1588, "TextureBufferRangeEXT": 1589, + "TextureStorage2DMultisampleEXT": 1590, + "TextureStorage3DMultisampleEXT": 1591, } functions = [ diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index f42d4f4b222..fdd647a3d1e 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -897,8 +897,8 @@ const struct function common_desktop_functions_possible[] = { { "glTextureBufferRangeEXT", 43, -1 }, { "glTexStorage2DMultisample", 43, -1 }, { "glTexStorage3DMultisample", 43, -1 }, -// { "glTextureStorage2DMultisampleEXT", 43, -1 }, // XXX: Add to xml -// { "glTextureStorage3DMultisampleEXT", 43, -1 }, // XXX: Add to xml + { "glTextureStorage2DMultisampleEXT", 43, -1 }, + { "glTextureStorage3DMultisampleEXT", 43, -1 }, { "glViewportArrayv", 43, -1 }, { "glViewportIndexedf", 43, -1 }, diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index bea5c9ae356..251cc08ecc5 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -6930,6 +6930,52 @@ _mesa_TextureStorage3DMultisample(GLuint texture, GLsizei samples, "glTextureStorage3DMultisample"); } +void GLAPIENTRY +_mesa_TextureStorage2DMultisampleEXT(GLuint texture, GLenum target, GLsizei samples, + GLenum internalformat, GLsizei width, + GLsizei height, + GLboolean fixedsamplelocations) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + + texObj = lookup_texture_ext_dsa(ctx, target, texture, + "glTextureStorage2DMultisampleEXT"); + if (!texObj) + return; + + if (!valid_texstorage_ms_parameters(width, height, 1, 2)) + return; + + texture_image_multisample(ctx, 2, texObj, NULL, texObj->Target, + samples, internalformat, width, height, 1, + fixedsamplelocations, GL_TRUE, 0, + "glTextureStorage2DMultisampleEXT"); +} + +void GLAPIENTRY +_mesa_TextureStorage3DMultisampleEXT(GLuint texture, GLenum target, GLsizei samples, + GLenum internalformat, GLsizei width, + GLsizei height, GLsizei depth, + GLboolean fixedsamplelocations) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + + texObj = lookup_texture_ext_dsa(ctx, target, texture, + "glTextureStorage3DMultisampleEXT"); + if (!texObj) + return; + + if (!valid_texstorage_ms_parameters(width, height, depth, 3)) + return; + + texture_image_multisample(ctx, 3, texObj, NULL, texObj->Target, samples, + internalformat, width, height, depth, + fixedsamplelocations, GL_TRUE, 0, + "glTextureStorage3DMultisampleEXT"); +} + void _mesa_texture_storage_ms_memory(struct gl_context *ctx, GLuint dims, struct gl_texture_object *texObj, diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index 66db78df4f9..bd835883774 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -837,6 +837,18 @@ _mesa_TextureStorage3DMultisample(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +extern void GLAPIENTRY +_mesa_TextureStorage2DMultisampleEXT(GLuint texture, GLenum target, GLsizei samples, + GLenum internalformat, GLsizei width, + GLsizei height, GLboolean fixedsamplelocations); + +extern void GLAPIENTRY +_mesa_TextureStorage3DMultisampleEXT(GLuint texture, GLenum target, GLsizei samples, + GLenum internalformat, GLsizei width, + GLsizei height, GLsizei depth, + GLboolean fixedsamplelocations); + /*@}*/ #ifdef __cplusplus -- 2.30.2