summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-11-12 03:39:29 +0100
committerbunnei <bunneidev@gmail.com>2022-03-25 02:13:32 +0100
commitd25cb12bffe93bcd2c37cb02d96c0d4c7d006002 (patch)
tree49ea27f365074b58d661e33a4369a490e10cc45b /src/core/hle
parenthle: nvflinger: Add implementation for BufferItem class. (diff)
downloadyuzu-d25cb12bffe93bcd2c37cb02d96c0d4c7d006002.tar
yuzu-d25cb12bffe93bcd2c37cb02d96c0d4c7d006002.tar.gz
yuzu-d25cb12bffe93bcd2c37cb02d96c0d4c7d006002.tar.bz2
yuzu-d25cb12bffe93bcd2c37cb02d96c0d4c7d006002.tar.lz
yuzu-d25cb12bffe93bcd2c37cb02d96c0d4c7d006002.tar.xz
yuzu-d25cb12bffe93bcd2c37cb02d96c0d4c7d006002.tar.zst
yuzu-d25cb12bffe93bcd2c37cb02d96c0d4c7d006002.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/nvflinger/buffer_slot.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/core/hle/service/nvflinger/buffer_slot.h b/src/core/hle/service/nvflinger/buffer_slot.h
new file mode 100644
index 000000000..24b806d33
--- /dev/null
+++ b/src/core/hle/service/nvflinger/buffer_slot.h
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+// Copyright 2021 yuzu Emulator Project
+// Copyright 2014 The Android Open Source Project
+// Parts of this implementation were base on:
+// https://cs.android.com/android/platform/superproject/+/android-5.1.1_r38:frameworks/native/include/gui/BufferSlot.h
+
+#pragma once
+
+#include <memory>
+
+#include "common/common_types.h"
+#include "core/hle/service/nvflinger/ui/fence.h"
+
+namespace android {
+
+class GraphicBuffer;
+
+enum class BufferState : u32 {
+ Free = 0,
+ Dequeued = 1,
+ Queued = 2,
+ Acquired = 3,
+};
+
+struct BufferSlot final {
+ constexpr BufferSlot() = default;
+
+ std::shared_ptr<GraphicBuffer> graphic_buffer;
+ BufferState buffer_state{BufferState::Free};
+ bool request_buffer_called{};
+ u64 frame_number{};
+ Fence fence;
+ bool acquire_called{};
+ bool needs_cleanup_on_release{};
+ bool attached_by_consumer{};
+ bool is_preallocated{};
+};
+
+} // namespace android