mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-11-17 03:46:00 +01:00
swapchain: add rollback
This commit is contained in:
parent
8d1d10397a
commit
d3bacb4600
2 changed files with 11 additions and 0 deletions
|
@ -24,6 +24,11 @@ namespace Aquamarine {
|
|||
Hyprutils::Memory::CSharedPointer<IBuffer> next(int* age);
|
||||
const SSwapchainOptions& currentOptions();
|
||||
|
||||
// rolls the buffers back, marking the last consumed as the next valid.
|
||||
// useful if e.g. a commit fails and we don't wanna write to the previous buffer that is
|
||||
// in use.
|
||||
void rollback();
|
||||
|
||||
private:
|
||||
CSwapchain(Hyprutils::Memory::CSharedPointer<IAllocator> allocator_, Hyprutils::Memory::CSharedPointer<IBackendImplementation> backendImpl_);
|
||||
|
||||
|
|
|
@ -114,3 +114,9 @@ bool Aquamarine::CSwapchain::contains(Hyprutils::Memory::CSharedPointer<IBuffer>
|
|||
const SSwapchainOptions& Aquamarine::CSwapchain::currentOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
void Aquamarine::CSwapchain::rollback() {
|
||||
lastAcquired--;
|
||||
if (lastAcquired < 0)
|
||||
lastAcquired = options.length - 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue