From eb7fe7546c1410f3cd82298491edcae3a3e70c1d Mon Sep 17 00:00:00 2001 From: mano-wii Date: Thu, 1 Aug 2019 08:30:57 -0300 Subject: Fix T68055: mesh selection issues, once blend is loaded second time in a Blender session The depth attachment of the framebuffer was missing. --- source/blender/draw/engines/select/select_engine.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/draw/engines/select/select_engine.c b/source/blender/draw/engines/select/select_engine.c index b910f59c432..53a83e495ca 100644 --- a/source/blender/draw/engines/select/select_engine.c +++ b/source/blender/draw/engines/select/select_engine.c @@ -86,10 +86,12 @@ static void draw_select_framebuffer_select_id_setup(void) e_data.texture_u32 = NULL; } + /* Make sure the depth texture is attached. + * It may disappear when loading another Blender session. */ + GPU_framebuffer_texture_attach(e_data.framebuffer_select_id, dtxl->depth, 0, 0); + if (e_data.texture_u32 == NULL) { e_data.texture_u32 = GPU_texture_create_2d(size[0], size[1], GPU_R32UI, NULL, NULL); - - GPU_framebuffer_texture_attach(e_data.framebuffer_select_id, dtxl->depth, 0, 0); GPU_framebuffer_texture_attach(e_data.framebuffer_select_id, e_data.texture_u32, 0, 0); GPU_framebuffer_check_valid(e_data.framebuffer_select_id, NULL); } -- cgit v1.2.3