summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common/meta.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-04-12 20:16:41 -0700
committerEric Anholt <[email protected]>2013-04-21 12:28:03 -0700
commite86170c2b88f9970a124479bbf47b5a7cd43d628 (patch)
treeaaa4b5f59d4bc184bbb52234eabc42c7b5867681 /src/mesa/drivers/common/meta.c
parentcbe8b75b586b22006783af0ed1ebba87b00ce61a (diff)
mesa: Add performance debug for meta code.
I noticed a fallback in regnum through sysprof, and wanted a nicer way to get information about it. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common/meta.c')
-rw-r--r--src/mesa/drivers/common/meta.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index e3ab82bfe1b..6ee0986b0c6 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3048,16 +3048,33 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target,
GLenum status;
/* check for fallbacks */
- if (!ctx->Extensions.EXT_framebuffer_object ||
- target == GL_TEXTURE_3D ||
+ if (!ctx->Extensions.EXT_framebuffer_object) {
+ _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH,
+ "glGenerateMipmap() without FBOs\n");
+ return GL_TRUE;
+ }
+
+ if (target == GL_TEXTURE_3D ||
target == GL_TEXTURE_1D_ARRAY ||
target == GL_TEXTURE_2D_ARRAY) {
+ _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH,
+ "glGenerateMipmap() to %s target\n",
+ _mesa_lookup_enum_by_nr(target));
return GL_TRUE;
}
srcLevel = texObj->BaseLevel;
baseImage = _mesa_select_tex_image(ctx, texObj, target, srcLevel);
- if (!baseImage || _mesa_is_format_compressed(baseImage->TexFormat)) {
+ if (!baseImage) {
+ _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH,
+ "glGenerateMipmap() couldn't find base teximage\n");
+ return GL_TRUE;
+ }
+
+ if (_mesa_is_format_compressed(baseImage->TexFormat)) {
+ _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH,
+ "glGenerateMipmap() with %s format\n",
+ _mesa_get_format_name(baseImage->TexFormat));
return GL_TRUE;
}
@@ -3067,6 +3084,9 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target,
* texture sample conversion. So we won't be able to generate the
* right colors when rendering. Need to use a fallback.
*/
+ _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH,
+ "glGenerateMipmap() of sRGB texture without "
+ "sRGB decode\n");
return GL_TRUE;
}
@@ -3103,6 +3123,8 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target,
_mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, fboSave);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_perf_debug(ctx, MESA_DEBUG_SEVERITY_HIGH,
+ "glGenerateMipmap() got incomplete FBO\n");
return GL_TRUE;
}