summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvflinger/buffer_queue_core.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-03-26 07:01:03 +0100
committerbunnei <bunneidev@gmail.com>2022-03-26 07:01:03 +0100
commit25faca8ea79f13b0eaa89dc2f7a3734e3d247b1c (patch)
tree03ee7563f76eef13c2b32912aa1ff9f30053561f /src/core/hle/service/nvflinger/buffer_queue_core.h
parenthle: service: nvflinger: buffer_queue_consumer: Use scoped_lock instead of unique_lock. (diff)
downloadyuzu-25faca8ea79f13b0eaa89dc2f7a3734e3d247b1c.tar
yuzu-25faca8ea79f13b0eaa89dc2f7a3734e3d247b1c.tar.gz
yuzu-25faca8ea79f13b0eaa89dc2f7a3734e3d247b1c.tar.bz2
yuzu-25faca8ea79f13b0eaa89dc2f7a3734e3d247b1c.tar.lz
yuzu-25faca8ea79f13b0eaa89dc2f7a3734e3d247b1c.tar.xz
yuzu-25faca8ea79f13b0eaa89dc2f7a3734e3d247b1c.tar.zst
yuzu-25faca8ea79f13b0eaa89dc2f7a3734e3d247b1c.zip
Diffstat (limited to 'src/core/hle/service/nvflinger/buffer_queue_core.h')
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue_core.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/core/hle/service/nvflinger/buffer_queue_core.h b/src/core/hle/service/nvflinger/buffer_queue_core.h
index a3cd89f1c..4dfd53387 100644
--- a/src/core/hle/service/nvflinger/buffer_queue_core.h
+++ b/src/core/hle/service/nvflinger/buffer_queue_core.h
@@ -50,23 +50,7 @@ private:
void WaitWhileAllocatingLocked() const;
private:
- class AutoLock final {
- public:
- AutoLock(std::shared_ptr<BufferQueueCore>& core_) : core{core_} {
- core->lock.lock();
- }
-
- ~AutoLock() {
- core->lock.unlock();
- }
-
- private:
- std::shared_ptr<BufferQueueCore>& core;
- };
-
-private:
mutable std::mutex mutex;
- mutable std::unique_lock<std::mutex> lock;
bool is_abandoned{};
bool consumer_controlled_by_app{};
std::shared_ptr<IConsumerListener> consumer_listener;
@@ -75,10 +59,8 @@ private:
std::shared_ptr<IProducerListener> connected_producer_listener;
BufferQueueDefs::SlotsType slots{};
std::vector<BufferItem> queue;
- std::set<s32> free_slots;
- std::list<s32> free_buffers;
s32 override_max_buffer_count{};
- mutable std::condition_variable dequeue_condition;
+ mutable std::condition_variable_any dequeue_condition;
const bool use_async_buffer{}; // This is always disabled on HOS
bool dequeue_buffer_cannot_block{};
PixelFormat default_buffer_format{PixelFormat::Rgba8888};
@@ -90,7 +72,7 @@ private:
u64 frame_counter{};
u32 transform_hint{};
bool is_allocating{};
- mutable std::condition_variable is_allocating_condition;
+ mutable std::condition_variable_any is_allocating_condition;
bool allow_allocation{true};
u64 buffer_age{};
bool is_shutting_down{};