2022-04-23 10:59:50 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
|
|
|
// SPDX-FileCopyrightText: Copyright 2014 The Android Open Source Project
|
2021-11-12 03:39:29 +01:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
2022-04-23 10:59:50 +02:00
|
|
|
// Parts of this implementation were based on:
|
2021-11-12 03:39:29 +01:00
|
|
|
// 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"
|
|
|
|
|
2022-03-20 05:51:16 +01:00
|
|
|
namespace Service::android {
|
2021-11-12 03:39:29 +01:00
|
|
|
|
|
|
|
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 attached_by_consumer{};
|
|
|
|
bool is_preallocated{};
|
|
|
|
};
|
|
|
|
|
2022-03-20 05:51:16 +01:00
|
|
|
} // namespace Service::android
|