mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-08-17 01:00:27 +03:00
swapchain test stuff
This commit is contained in:
parent
5f32ef4c04
commit
8f5a21b831
@ -802,6 +802,14 @@ bool CMonitorState::commit() {
|
||||
bool CMonitorState::test() {
|
||||
if (!updateSwapchain())
|
||||
return false;
|
||||
|
||||
// if it has no buffer, attach one from the swapchain to test it
|
||||
if (!m_pOwner->output->state->state().buffer) {
|
||||
Debug::log(LOG, "CMonitorState::test: no buffer, attaching one from the swapchain for modeset being possible");
|
||||
m_pOwner->output->state->setBuffer(m_pOwner->output->swapchain->next(nullptr));
|
||||
m_pOwner->output->swapchain->rollback(); // restore the counter, don't advance the swapchain
|
||||
}
|
||||
|
||||
return m_pOwner->output->test();
|
||||
}
|
||||
|
||||
@ -809,8 +817,10 @@ bool CMonitorState::updateSwapchain() {
|
||||
auto options = m_pOwner->output->swapchain->currentOptions();
|
||||
const auto& STATE = m_pOwner->output->state->state();
|
||||
const auto& MODE = STATE.mode ? STATE.mode : STATE.customMode;
|
||||
if (!MODE)
|
||||
if (!MODE) {
|
||||
Debug::log(WARN, "updateSwapchain: No mode?");
|
||||
return true;
|
||||
}
|
||||
options.format = STATE.drmFormat;
|
||||
options.scanout = true;
|
||||
options.length = 2;
|
||||
|
Loading…
Reference in New Issue
Block a user