mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2025-07-10 08:57:52 -05:00
NV: Determine what buffer to draw for each layer of each display.
Don't try to draw buffers that the guest application is using, only queued buffers are eligible for drawing. Drawing actual pixels is still not implemented.
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <boost/optional.hpp>
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
@ -34,10 +35,20 @@ public:
|
||||
BufferQueue(u32 id, u64 layer_id);
|
||||
~BufferQueue() = default;
|
||||
|
||||
struct Buffer {
|
||||
enum class Status { Free = 0, Queued = 1, Dequeued = 2, Acquired = 3 };
|
||||
|
||||
u32 slot;
|
||||
Status status = Status::Free;
|
||||
IGBPBuffer igbp_buffer;
|
||||
};
|
||||
|
||||
void SetPreallocatedBuffer(u32 slot, IGBPBuffer& buffer);
|
||||
u32 DequeueBuffer(u32 pixel_format, u32 width, u32 height);
|
||||
const IGBPBuffer& RequestBuffer(u32 slot) const;
|
||||
void QueueBuffer(u32 slot);
|
||||
boost::optional<const Buffer&> AcquireBuffer();
|
||||
void ReleaseBuffer(u32 slot);
|
||||
|
||||
u32 GetId() const {
|
||||
return id;
|
||||
@ -47,14 +58,6 @@ private:
|
||||
u32 id;
|
||||
u64 layer_id;
|
||||
|
||||
struct Buffer {
|
||||
enum class Status { None = 0, Queued = 1, Dequeued = 2 };
|
||||
|
||||
u32 slot;
|
||||
Status status = Status::None;
|
||||
IGBPBuffer igbp_buffer;
|
||||
};
|
||||
|
||||
std::vector<Buffer> queue;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user