summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvflinger/buffer_queue.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-06-07 17:34:55 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2019-07-05 21:49:10 +0200
commit737e978f5b1440a044ef90f346c8616c2de49a81 (patch)
tree42b3c99171a3929f64db141db81193a0067b3523 /src/core/hle/service/nvflinger/buffer_queue.cpp
parentnvflinger: Implement swap intervals (diff)
downloadyuzu-737e978f5b1440a044ef90f346c8616c2de49a81.tar
yuzu-737e978f5b1440a044ef90f346c8616c2de49a81.tar.gz
yuzu-737e978f5b1440a044ef90f346c8616c2de49a81.tar.bz2
yuzu-737e978f5b1440a044ef90f346c8616c2de49a81.tar.lz
yuzu-737e978f5b1440a044ef90f346c8616c2de49a81.tar.xz
yuzu-737e978f5b1440a044ef90f346c8616c2de49a81.tar.zst
yuzu-737e978f5b1440a044ef90f346c8616c2de49a81.zip
Diffstat (limited to 'src/core/hle/service/nvflinger/buffer_queue.cpp')
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/hle/service/nvflinger/buffer_queue.cpp b/src/core/hle/service/nvflinger/buffer_queue.cpp
index dca75c35e..75e47b8c7 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.cpp
+++ b/src/core/hle/service/nvflinger/buffer_queue.cpp
@@ -34,7 +34,8 @@ void BufferQueue::SetPreallocatedBuffer(u32 slot, const IGBPBuffer& igbp_buffer)
buffer_wait_event.writable->Signal();
}
-std::optional<u32> BufferQueue::DequeueBuffer(u32 width, u32 height) {
+std::optional<std::pair<u32, Service::Nvidia::MultiFence*>> BufferQueue::DequeueBuffer(u32 width,
+ u32 height) {
auto itr = std::find_if(queue.begin(), queue.end(), [&](const Buffer& buffer) {
// Only consider free buffers. Buffers become free once again after they've been Acquired
// and Released by the compositor, see the NVFlinger::Compose method.
@@ -51,7 +52,7 @@ std::optional<u32> BufferQueue::DequeueBuffer(u32 width, u32 height) {
}
itr->status = Buffer::Status::Dequeued;
- return itr->slot;
+ return {{itr->slot, &itr->multi_fence}};
}
const IGBPBuffer& BufferQueue::RequestBuffer(u32 slot) const {
@@ -63,7 +64,8 @@ const IGBPBuffer& BufferQueue::RequestBuffer(u32 slot) const {
}
void BufferQueue::QueueBuffer(u32 slot, BufferTransformFlags transform,
- const Common::Rectangle<int>& crop_rect, u32 swap_interval) {
+ const Common::Rectangle<int>& crop_rect, u32 swap_interval,
+ Service::Nvidia::MultiFence& multi_fence) {
auto itr = std::find_if(queue.begin(), queue.end(),
[&](const Buffer& buffer) { return buffer.slot == slot; });
ASSERT(itr != queue.end());
@@ -72,6 +74,7 @@ void BufferQueue::QueueBuffer(u32 slot, BufferTransformFlags transform,
itr->transform = transform;
itr->crop_rect = crop_rect;
itr->swap_interval = swap_interval;
+ itr->multi_fence = multi_fence;
}
std::optional<std::reference_wrapper<const BufferQueue::Buffer>> BufferQueue::AcquireBuffer() {