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-11 00:22:42 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-01-11 18:00:23 +0300
commit1c91b6ee29845c323ffd3f477b56f3a68f4e76be (patch)
treed032aa1fa9d56511b96da64412a0d91439817d13 /source/blender/gpu
parent621a6d4a5de872a94f81d239ff627d24afecc56b (diff)
UVEdit: Port texpaint_loop_wire to batch request
This removes code duplication and put an end to the old "create at request" batch creation. Also it uses the same vbo as the uv layer used for shading. Reducing VRAM usage. Also fixes the modified uv display in uv edit mode.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/GPU_shader.h1
-rw-r--r--source/blender/gpu/intern/gpu_shader.c6
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_vert.glsl5
3 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h
index 71536523caf..4803c6c0792 100644
--- a/source/blender/gpu/GPU_shader.h
+++ b/source/blender/gpu/GPU_shader.h
@@ -344,6 +344,7 @@ typedef enum GPUBuiltinShader {
GPU_SHADER_2D_NODELINK,
GPU_SHADER_2D_NODELINK_INST,
/* specialized for edituv drawing */
+ GPU_SHADER_2D_UV_UNIFORM_COLOR,
GPU_SHADER_2D_UV_VERTS,
GPU_SHADER_2D_UV_FACEDOTS,
GPU_SHADER_2D_UV_EDGES,
diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c
index 8a3581c54df..8a141eaa2b2 100644
--- a/source/blender/gpu/intern/gpu_shader.c
+++ b/source/blender/gpu/intern/gpu_shader.c
@@ -918,6 +918,9 @@ static const GPUShaderStages builtin_shader_stages[GPU_NUM_BUILTIN_SHADERS] = {
{ datatoc_gpu_shader_2D_nodelink_vert_glsl,
datatoc_gpu_shader_2D_nodelink_frag_glsl },
+ [GPU_SHADER_2D_UV_UNIFORM_COLOR] =
+ { datatoc_gpu_shader_2D_vert_glsl,
+ datatoc_gpu_shader_uniform_color_frag_glsl },
[GPU_SHADER_2D_UV_VERTS] =
{ datatoc_gpu_shader_2D_edituvs_points_vert_glsl,
datatoc_gpu_shader_point_varying_color_varying_outline_aa_frag_glsl },
@@ -1007,6 +1010,9 @@ static const char *gpu_shader_get_builtin_shader_defines(
case GPU_SHADER_SIMPLE_LIGHTING_FLAT_COLOR:
return "#define USE_FLAT_NORMAL\n";
+ case GPU_SHADER_2D_UV_UNIFORM_COLOR:
+ return "#define UV_POS\n";
+
case GPU_SHADER_2D_UV_EDGES_SMOOTH:
return "#define SMOOTH_COLOR\n";
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_vert.glsl
index 89e3c52f9f8..b3b897da3c6 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_vert.glsl
@@ -1,7 +1,12 @@
uniform mat4 ModelViewProjectionMatrix;
+#ifdef UV_POS
+in vec2 u;
+# define pos u
+#else
in vec2 pos;
+#endif
void main()
{