Fix T75958 Overlay: Blender Crashes when selecting without Depth Picking

This commit is contained in:
Clément Foucault 2020-05-07 18:02:55 +02:00
parent 933c721ccb
commit e6dd29ce6e
Notes: blender-bot 2023-02-14 05:28:01 +01:00
Referenced by issue #75958, Blender Crashes when an Object is selected after unchecking OpenGL Depth Picking
1 changed files with 3 additions and 2 deletions

View File

@ -73,8 +73,9 @@ void OVERLAY_wireframe_cache_init(OVERLAY_Data *vedata)
DRWState state = DRW_STATE_FIRST_VERTEX_CONVENTION | DRW_STATE_WRITE_COLOR |
DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL;
DRWPass *pass;
GPUTexture **depth_tx = (pd->xray_enabled || pd->xray_opacity > 0.0f) ? &txl->temp_depth_tx :
&txl->dummy_depth_tx;
GPUTexture **depth_tx = ((pd->xray_enabled || pd->xray_opacity > 0.0f) && DRW_state_is_fbo()) ?
&txl->temp_depth_tx :
&txl->dummy_depth_tx;
if (xray == 0) {
DRW_PASS_CREATE(psl->wireframe_ps, state | pd->clipping_state);