Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2019-01-17 21:39:27 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-01-17 21:48:00 +0300
commit844cda8f22f8b28b8892057cbd2070bb06642775 (patch)
tree5bb252b81bd942c7123cb4c0e3d70a016fb0f4a2 /source/blender/gpu
parente3b3b3207682233978dac5b06aef6748dcc0367c (diff)
DRW: Make missing uniform debuging print only once
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_shader_interface.c6
1 files changed, 5 insertions, 1 deletions
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;
}