Module: Mesa Branch: master Commit: af60187153adce3bbd47c24abcfbaf1c403f1620 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=af60187153adce3bbd47c24abcfbaf1c403f1620
Author: Pierre-Eric Pelloux Prayer <pierre-eric.pelloux-pra...@amd.com> Date: Mon Sep 23 11:06:07 2019 +0200 mesa: implement glTextureStorageNDEXT functions Implement the 3 functions using the texturestorage_error() helper. _mesa_lookup_or_create_texture is always called to make sure that 'texture' is initialized (even if the texturestorage_error() generates an error afterwards). Reviewed-by: Marek Olšák <marek.ol...@amd.com> --- src/mesa/main/texstorage.c | 62 ++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c index 9cb8b900651..d2e0e52ecab 100644 --- a/src/mesa/main/texstorage.c +++ b/src/mesa/main/texstorage.c @@ -738,29 +738,20 @@ _mesa_TextureStorage3D(GLuint texture, GLsizei levels, GLenum internalformat, } -/* - * Note: we don't support GL_EXT_direct_state_access and the spec says - * we don't need the following functions. However, glew checks for the - * presence of all six functions and will say that GL_ARB_texture_storage - * is not supported if these functions are missing. - */ - - void GLAPIENTRY _mesa_TextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width) { GET_CURRENT_CONTEXT(ctx); - - (void) texture; - (void) target; - (void) levels; - (void) internalformat; - (void) width; - - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTextureStorage1DEXT not supported"); + /* 'texture' must always be initialized, even if the call to + * glTextureStorage1DEXT will generate an error. + */ + if (!_mesa_lookup_or_create_texture(ctx, target, texture, false, true, + "glTextureStorage1DEXT")) + return; + texturestorage_error(1, texture, levels, internalformat, width, 1, 1, + "glTextureStorage1DEXT"); } @@ -770,16 +761,14 @@ _mesa_TextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLsizei width, GLsizei height) { GET_CURRENT_CONTEXT(ctx); - - (void) texture; - (void) target; - (void) levels; - (void) internalformat; - (void) width; - (void) height; - - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTextureStorage2DEXT not supported"); + /* 'texture' must always be initialized, even if the call to + * glTextureStorage2DEXT will generate an error. + */ + if (!_mesa_lookup_or_create_texture(ctx, target, texture, false, true, + "glTextureStorage2DEXT")) + return; + texturestorage_error(2, texture, levels, internalformat, width, height, 1, + "glTextureStorage2DEXT"); } @@ -789,17 +778,14 @@ _mesa_TextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLsizei width, GLsizei height, GLsizei depth) { GET_CURRENT_CONTEXT(ctx); - - (void) texture; - (void) target; - (void) levels; - (void) internalformat; - (void) width; - (void) height; - (void) depth; - - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTextureStorage3DEXT not supported"); + /* 'texture' must always be initialized, even if the call to + * glTextureStorage3DEXT will generate an error. + */ + if (!_mesa_lookup_or_create_texture(ctx, target, texture, false, true, + "glTextureStorage3DEXT")) + return; + texturestorage_error(3, texture, levels, internalformat, width, height, depth, + "glTextureStorage3DEXT"); } _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit