Fix #135652: Overlay: Overlays draw in front of mesh in Paint modes

This was caused by a missing prepass.
Only early out if drawing the prepass, otherwise, run all checks.
This is much safer.
This commit is contained in:
Clément Foucault
2025-03-10 13:07:20 +01:00
parent c31c2656e4
commit 690a165630
@@ -734,12 +734,16 @@ bool Instance::object_needs_prepass(const ObjectRef &ob_ref, bool in_paint_mode)
if (in_paint_mode) {
/* Allow paint overlays to draw with depth equal test. */
return object_is_rendered_transparent(ob_ref.object, state);
if (object_is_rendered_transparent(ob_ref.object, state)) {
return true;
}
}
if (!state.xray_enabled) {
/* Force depth prepass if depth buffer form render engine is not available. */
return !state.is_render_depth_available && (ob_ref.object->dt >= OB_SOLID);
if (!state.is_render_depth_available && (ob_ref.object->dt >= OB_SOLID)) {
return true;
}
}
return false;