[Mesa-dev] [PATCH 02/10] mesa: pass the 'caller' function to texstorage()

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Jul 20 09:52:56 UTC 2017


To be consistent with texturestorage().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.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");
 }
 
 
-- 
2.13.3



More information about the mesa-dev mailing list