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-05-10 02:57:42 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-05-10 13:25:16 +0300
commit632e0725d27271f95073f668a24bcf06f603f001 (patch)
tree6980992db3d05f25aff27646bad1e3a01827153b /source/blender/draw/modes/paint_texture_mode.c
parent6006f86e07c5732f72015d500ce3e066464e2baa (diff)
Overlays: Use common_view_lib.glsl
This removes ModelViewProjectionMatrix usage
Diffstat (limited to 'source/blender/draw/modes/paint_texture_mode.c')
-rw-r--r--source/blender/draw/modes/paint_texture_mode.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/draw/modes/paint_texture_mode.c b/source/blender/draw/modes/paint_texture_mode.c
index 3e292f4e4bc..123dc7fca88 100644
--- a/source/blender/draw/modes/paint_texture_mode.c
+++ b/source/blender/draw/modes/paint_texture_mode.c
@@ -27,6 +27,8 @@
#include "BKE_node.h"
+#include "BLI_string_utils.h"
+
/* If builtin shaders are needed */
#include "GPU_shader.h"
#include "GPU_texture.h"
@@ -39,6 +41,7 @@
#include "DEG_depsgraph_query.h"
extern char datatoc_common_globals_lib_glsl[];
+extern char datatoc_common_view_lib_glsl[];
extern char datatoc_paint_texture_vert_glsl[];
extern char datatoc_paint_texture_frag_glsl[];
extern char datatoc_paint_wire_vert_glsl[];
@@ -132,26 +135,31 @@ static void PAINT_TEXTURE_engine_init(void *UNUSED(vedata))
if (!e_data.fallback_sh) {
e_data.fallback_sh = GPU_shader_get_builtin_shader(GPU_SHADER_3D_UNIFORM_COLOR);
- e_data.image_sh = DRW_shader_create_with_lib(datatoc_paint_texture_vert_glsl,
- NULL,
- datatoc_paint_texture_frag_glsl,
- datatoc_common_globals_lib_glsl,
- NULL);
+ char *lib = BLI_string_joinN(datatoc_common_globals_lib_glsl, datatoc_common_view_lib_glsl);
+
+ e_data.image_sh = DRW_shader_create_with_lib(
+ datatoc_paint_texture_vert_glsl, NULL, datatoc_paint_texture_frag_glsl, lib, NULL);
e_data.image_masking_sh = DRW_shader_create_with_lib(datatoc_paint_texture_vert_glsl,
NULL,
datatoc_paint_texture_frag_glsl,
- datatoc_common_globals_lib_glsl,
+ lib,
"#define TEXTURE_PAINT_MASK\n");
e_data.wire_overlay_shader = DRW_shader_create_with_lib(datatoc_paint_wire_vert_glsl,
NULL,
datatoc_paint_wire_frag_glsl,
- datatoc_common_globals_lib_glsl,
+ lib,
"#define VERTEX_MODE\n");
- e_data.face_overlay_shader = DRW_shader_create(
- datatoc_paint_face_vert_glsl, NULL, datatoc_gpu_shader_uniform_color_frag_glsl, NULL);
+ e_data.face_overlay_shader = DRW_shader_create_with_lib(
+ datatoc_paint_face_vert_glsl,
+ NULL,
+ datatoc_gpu_shader_uniform_color_frag_glsl,
+ datatoc_common_view_lib_glsl,
+ NULL);
+
+ MEM_freeN(lib);
}
}