From b7933cc60195b5e96878aaab7045db6cf81b2dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 11 Dec 2018 22:30:41 +0100 Subject: GPUTexture: Add debug print for cubemap textures --- source/blender/gpu/intern/gpu_texture.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/gpu/intern') diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index 75eb17546ac..d3642c8f31b 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -138,6 +138,7 @@ static const char *gl_enum_to_str(GLenum e) { #define ENUM_TO_STRING(e) [GL_##e] = STRINGIFY_ARG(e) static const char *enum_strings[] = { + ENUM_TO_STRING(TEXTURE_CUBE_MAP), ENUM_TO_STRING(TEXTURE_2D), ENUM_TO_STRING(TEXTURE_2D_ARRAY), ENUM_TO_STRING(TEXTURE_1D), @@ -764,6 +765,13 @@ static GPUTexture *GPU_texture_cube_create( return NULL; } + if (G.debug & G_DEBUG_GPU) { + printf("GPUTexture: create : %s, %s, w : %d, h : %d, d : %d, comp : %d, size : %.2f MiB\n", + gl_enum_to_str(tex->target), gl_enum_to_str(internalformat), + w, w, d, tex->components, + gpu_texture_memory_footprint_compute(tex) / 1048576.0f); + } + gpu_texture_memory_footprint_add(tex); glBindTexture(tex->target, tex->bindcode); -- cgit v1.2.3