[Bf-blender-cvs] [b7933cc6019] blender2.8: GPUTexture: Add debug print for cubemap textures

Clément Foucault noreply at git.blender.org
Tue Dec 11 22:33:22 CET 2018


Commit: b7933cc60195b5e96878aaab7045db6cf81b2dba
Author: Clément Foucault
Date:   Tue Dec 11 22:30:41 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBb7933cc60195b5e96878aaab7045db6cf81b2dba

GPUTexture: Add debug print for cubemap textures

===================================================================

M	source/blender/gpu/intern/gpu_texture.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list