Mesa (master): mesa: pass the 'caller' function to texstorage()

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Thu Jul 20 14:16:33 UTC 2017


Module: Mesa
Branch: master
Commit: f95420d74effae98f02d56cb680556f96b82059f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f95420d74effae98f02d56cb680556f96b82059f

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Jul 20 11:52:56 2017 +0200

mesa: pass the 'caller' function to texstorage()

To be consistent with texturestorage().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

---

 src/mesa/main/texstorage.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
index 7519ca2807..99a169e5ff 100644
--- a/src/mesa/main/texstorage.c
+++ b/src/mesa/main/texstorage.c
@@ -475,7 +475,7 @@ texture_storage(struct gl_context *ctx, GLuint dims,
  */
 static void
 texstorage(GLuint dims, GLenum target, GLsizei levels, GLenum internalformat,
-           GLsizei width, GLsizei height, GLsizei depth)
+           GLsizei width, GLsizei height, GLsizei depth, const char *caller)
 {
    struct gl_texture_object *texObj;
    GET_CURRENT_CONTEXT(ctx);
@@ -485,14 +485,13 @@ texstorage(GLuint dims, GLenum target, GLsizei levels, GLenum internalformat,
     */
    if (!legal_texobj_target(ctx, dims, target)) {
       _mesa_error(ctx, GL_INVALID_ENUM,
-                  "glTexStorage%uD(illegal target=%s)",
-                  dims, _mesa_enum_to_string(target));
+                  "%s(illegal target=%s)",
+                  caller, _mesa_enum_to_string(target));
       return;
    }
 
    if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
-      _mesa_debug(ctx, "glTexStorage%uD %s %d %s %d %d %d\n",
-                  dims,
+      _mesa_debug(ctx, "%s %s %d %s %d %d %d\n", caller,
                   _mesa_enum_to_string(target), levels,
                   _mesa_enum_to_string(internalformat),
                   width, height, depth);
@@ -500,7 +499,7 @@ texstorage(GLuint dims, GLenum target, GLsizei levels, GLenum internalformat,
    /* Check the format to make sure it is sized. */
    if (!_mesa_is_legal_tex_storage_format(ctx, internalformat)) {
       _mesa_error(ctx, GL_INVALID_ENUM,
-                  "glTexStorage%uD(internalformat = %s)", dims,
+                  "%s(internalformat = %s)", caller,
                   _mesa_enum_to_string(internalformat));
       return;
    }
@@ -562,7 +561,8 @@ void GLAPIENTRY
 _mesa_TexStorage1D(GLenum target, GLsizei levels, GLenum internalformat,
                    GLsizei width)
 {
-   texstorage(1, target, levels, internalformat, width, 1, 1);
+   texstorage(1, target, levels, internalformat, width, 1, 1,
+              "glTexStorage1D");
 }
 
 
@@ -570,7 +570,8 @@ void GLAPIENTRY
 _mesa_TexStorage2D(GLenum target, GLsizei levels, GLenum internalformat,
                    GLsizei width, GLsizei height)
 {
-   texstorage(2, target, levels, internalformat, width, height, 1);
+   texstorage(2, target, levels, internalformat, width, height, 1,
+              "glTexStorage2D");
 }
 
 
@@ -578,7 +579,8 @@ void GLAPIENTRY
 _mesa_TexStorage3D(GLenum target, GLsizei levels, GLenum internalformat,
                    GLsizei width, GLsizei height, GLsizei depth)
 {
-   texstorage(3, target, levels, internalformat, width, height, depth);
+   texstorage(3, target, levels, internalformat, width, height, depth,
+              "glTexStorage3D");
 }
 
 




More information about the mesa-commit mailing list