Fix T64137 Empty Images flickering graphics when "Auto Depth" is enabled

Also fix T64373 Grid intensity increases in Ortographic when use Circle
Select in GPencil Edit mode
This commit is contained in:
Clément Foucault 2019-05-11 00:21:27 +02:00
parent 93901e7f0a
commit de9d846353
Notes: blender-bot 2023-02-14 11:24:03 +01:00
Referenced by issue #64482, Crush on UV Editing layout after pressing A
Referenced by issue #64462, Keyed Particle Duration Crash
Referenced by issue #64373, Grid intensity increases in Ortographic when use Circle Select in GPencil Edit mode
Referenced by issue #64137, Empty - flickering graphics when "Auto Depth" is enabled
2 changed files with 5 additions and 4 deletions

View File

@ -105,7 +105,7 @@ typedef char DRWViewportEmptyList;
/* Use of multisample framebuffers. */
#define MULTISAMPLE_SYNC_ENABLE(dfbl, dtxl) \
{ \
if (dfbl->multisample_fb != NULL) { \
if (dfbl->multisample_fb != NULL && DRW_state_is_fbo()) { \
DRW_stats_query_start("Multisample Blit"); \
GPU_framebuffer_bind(dfbl->multisample_fb); \
/* TODO clear only depth but need to do alpha to coverage for transparencies. */ \
@ -117,7 +117,7 @@ typedef char DRWViewportEmptyList;
#define MULTISAMPLE_SYNC_DISABLE(dfbl, dtxl) \
{ \
if (dfbl->multisample_fb != NULL) { \
if (dfbl->multisample_fb != NULL && DRW_state_is_fbo()) { \
DRW_stats_query_start("Multisample Resolve"); \
GPU_framebuffer_bind(dfbl->default_fb); \
DRW_multisamples_resolve(dtxl->multisample_depth, dtxl->multisample_color, true); \
@ -128,7 +128,7 @@ typedef char DRWViewportEmptyList;
#define MULTISAMPLE_SYNC_DISABLE_NO_DEPTH(dfbl, dtxl) \
{ \
if (dfbl->multisample_fb != NULL) { \
if (dfbl->multisample_fb != NULL && DRW_state_is_fbo()) { \
DRW_stats_query_start("Multisample Resolve"); \
GPU_framebuffer_bind(dfbl->default_fb); \
DRW_multisamples_resolve(dtxl->multisample_depth, dtxl->multisample_color, false); \

View File

@ -2760,7 +2760,8 @@ void DRW_state_dfdy_factors_get(float dfdyfac[2])
*/
bool DRW_state_is_fbo(void)
{
return ((DST.default_framebuffer != NULL) || DST.options.is_image_render);
return ((DST.default_framebuffer != NULL) || DST.options.is_image_render) &&
!DRW_state_is_depth() && !DRW_state_is_select();
}
/**