Fix T64965: crash using masks in texture paint mode
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 22 May 2019 07:59:52 +0000 (09:59 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 22 May 2019 08:00:33 +0000 (10:00 +0200)
source/blender/draw/modes/paint_texture_mode.c

index 847d2d2..ee8ec78 100644 (file)
@@ -154,6 +154,16 @@ static void PAINT_TEXTURE_engine_init(void *UNUSED(vedata))
         .defs = (const char *[]){sh_cfg_data->def, NULL},
     });
 
+    sh_data->image_mask = GPU_shader_create_from_arrays({
+        .vert = (const char *[]){sh_cfg_data->lib,
+                                 datatoc_common_globals_lib_glsl,
+                                 datatoc_common_view_lib_glsl,
+                                 datatoc_paint_texture_vert_glsl,
+                                 NULL},
+        .frag = (const char *[]){datatoc_paint_texture_frag_glsl, NULL},
+        .defs = (const char *[]){sh_cfg_data->def, "#define TEXTURE_PAINT_MASK\n", NULL},
+    });
+
     sh_data->wire_select_overlay = GPU_shader_create_from_arrays({
         .vert = (const char *[]){sh_cfg_data->lib,
                                  datatoc_common_globals_lib_glsl,