mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
display: don't render window if all its DRs are inactive
This is an optimization, which will skip begin_frame/end_frame for a buffer that isn't going to have anything rendered to it. Affects the RenderPipeline.
This commit is contained in:
parent
e759a1b605
commit
d902ea5ce4
@ -412,15 +412,38 @@ is_active() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
CDReader cdata(_cycler);
|
||||
CDLockedReader cdata(_cycler);
|
||||
if (!cdata->_active) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cdata->_one_shot_frame != -1) {
|
||||
// If one_shot is in effect, then we are active only for the one indicated
|
||||
// frame.
|
||||
if (cdata->_one_shot_frame != ClockObject::get_global_clock()->get_frame_count()) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return cdata->_active;
|
||||
|
||||
// If the window has a clear value set, it is active.
|
||||
if (is_any_clear_active()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If we triggered a copy operation, it is also active.
|
||||
if (_trigger_copy) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// The window is active if at least one display region is active.
|
||||
if (cdata->_active_display_regions_stale) {
|
||||
CDWriter cdataw(((GraphicsOutput *)this)->_cycler, cdata, false);
|
||||
((GraphicsOutput *)this)->do_determine_display_regions(cdataw);
|
||||
}
|
||||
|
||||
return !cdata->_active_display_regions.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user