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-16 06:41:27 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-01-17 21:44:01 +0300
commit4c9589909807f346e23966379f240dd57d057a1d (patch)
tree40bad4807d5b5cdd5e632f00562477bf7bb7754c /source/blender/windowmanager/intern/wm_draw.c
parent938b08b33654f6bc3419519fc364021115d19dba (diff)
GPU: Rename GPU_shader_get_uniform to GPU_shader_get_uniform_ensure
This is in order to make the API more multithread friendly inside the draw manager. GPU_shader_get_uniform will only serve to query the shader interface and not do any GL call, making it threadsafe. For now it only print a warning if the uniform was not queried before.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_draw.c')
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index c811a52c0e9..073b43107bd 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -488,9 +488,9 @@ void wm_draw_region_blend(ARegion *ar, int view, bool blend)
alpha = 1.0f;
}
- glUniform1i(GPU_shader_get_uniform(shader, "image"), 0);
- glUniform4f(GPU_shader_get_uniform(shader, "rect_icon"), rect_tex.xmin, rect_tex.ymin, rect_tex.xmax, rect_tex.ymax);
- glUniform4f(GPU_shader_get_uniform(shader, "rect_geom"), rect_geo.xmin, rect_geo.ymin, rect_geo.xmax, rect_geo.ymax);
+ glUniform1i(GPU_shader_get_uniform_ensure(shader, "image"), 0);
+ glUniform4f(GPU_shader_get_uniform_ensure(shader, "rect_icon"), rect_tex.xmin, rect_tex.ymin, rect_tex.xmax, rect_tex.ymax);
+ glUniform4f(GPU_shader_get_uniform_ensure(shader, "rect_geom"), rect_geo.xmin, rect_geo.ymin, rect_geo.xmax, rect_geo.ymax);
glUniform4f(GPU_shader_get_builtin_uniform(shader, GPU_UNIFORM_COLOR), alpha, alpha, alpha, alpha);
GPU_draw_primitive(GPU_PRIM_TRI_STRIP, 4);