[Bf-blender-cvs] [844cda8f22f] master: DRW: Make missing uniform debuging print only once

Clément Foucault noreply at git.blender.org
Thu Jan 17 19:49:28 CET 2019


Commit: 844cda8f22f8b28b8892057cbd2070bb06642775
Author: Clément Foucault
Date:   Thu Jan 17 19:39:27 2019 +0100
Branches: master
https://developer.blender.org/rB844cda8f22f8b28b8892057cbd2070bb06642775

DRW: Make missing uniform debuging print only once

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

M	source/blender/draw/intern/draw_manager_data.c
M	source/blender/gpu/intern/gpu_shader_interface.c

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

diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 0df1603a860..45365ed299e 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -122,8 +122,6 @@ static void drw_shgroup_uniform(DRWShadingGroup *shgroup, const char *name,
 	}
 
 	if (location == -1) {
-		if (G.debug & G_DEBUG_GPU)
-			fprintf(stderr, "Warning: Pass : %s, Uniform '%s' not found!\n", shgroup->pass_parent->name, name);
 		/* Nice to enable eventually, for now eevee uses uniforms that might not exist. */
 		// BLI_assert(0);
 		return;
diff --git a/source/blender/gpu/intern/gpu_shader_interface.c b/source/blender/gpu/intern/gpu_shader_interface.c
index 7522c92eb93..f5ba30ac2df 100644
--- a/source/blender/gpu/intern/gpu_shader_interface.c
+++ b/source/blender/gpu/intern/gpu_shader_interface.c
@@ -30,6 +30,7 @@
  */
 
 #include "MEM_guardedalloc.h"
+#include "BKE_global.h"
 
 #include "GPU_shader_interface.h"
 
@@ -316,11 +317,14 @@ const GPUShaderInput *GPU_shaderinterface_uniform(const GPUShaderInterface *shad
 
 const GPUShaderInput *GPU_shaderinterface_uniform_ensure(const GPUShaderInterface *shaderface, const char *name)
 {
-	/* TODO: Warn if we find a matching builtin, since these can be looked up much quicker. */
 	const GPUShaderInput *input = GPU_shaderinterface_uniform(shaderface, name);
 	/* If input is not found add it so it's found next time. */
 	if (input == NULL) {
 		input = add_uniform((GPUShaderInterface *)shaderface, name);
+
+		if ((G.debug & G_DEBUG_GPU) && (input->location == -1)) {
+			fprintf(stderr, "GPUShaderInterface: Warning: Uniform '%s' not found!\n", name);
+		}
 	}
 	return (input->location != -1) ? input : NULL;
 }



More information about the Bf-blender-cvs mailing list