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 20:33:08 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-01-17 21:48:00 +0300
commite3b3b3207682233978dac5b06aef6748dcc0367c (patch)
tree34adba542c21f2c983b072e4d7330ce64b55a6b1 /source/blender/gpu/intern/gpu_shader.c
parentdc7e492989408038c89b5283ec5710b98457696f (diff)
DRW: Use name buffer to request uniform location before drawing.
This is in order to avoid GL call during the "cache creation" phase and support multithreading.
Diffstat (limited to 'source/blender/gpu/intern/gpu_shader.c')
-rw-r--r--source/blender/gpu/intern/gpu_shader.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c
index 31a85800754..0c1ea0d97d5 100644
--- a/source/blender/gpu/intern/gpu_shader.c
+++ b/source/blender/gpu/intern/gpu_shader.c
@@ -563,18 +563,7 @@ int GPU_shader_get_uniform(GPUShader *shader, const char *name)
{
BLI_assert(shader && shader->program);
const GPUShaderInput *uniform = GPU_shaderinterface_uniform(shader->interface, name);
-#if 1 /* Remove this when we have transitionned all uniforms. */
- if (uniform == NULL) {
-# ifndef NDEBUG
- printf("Uniform \"%s\" needs to be added to shader interface after shader creation.\n", name);
-# endif
- /* Fallback to avoid issues. */
- return GPU_shader_get_uniform_ensure(shader, name);
- }
-#else
- BLI_assert(uniform);
-#endif
- return uniform->location;
+ return uniform ? uniform->location : -2;
}
int GPU_shader_get_uniform_ensure(GPUShader *shader, const char *name)