mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-06-26 04:49:30 -04:00
parent
544515cf94
commit
c1849ddc8e
2 changed files with 9 additions and 7 deletions
|
|
@ -18,7 +18,8 @@ namespace Vulkan {
|
|||
UpdateDescriptorQueue::UpdateDescriptorQueue(const Device& device_)
|
||||
: device{device_}
|
||||
{
|
||||
payload_start = payload_cursor = payload.data();
|
||||
payload_start = payload.data();
|
||||
payload_cursor = payload.data();
|
||||
}
|
||||
|
||||
UpdateDescriptorQueue::~UpdateDescriptorQueue() = default;
|
||||
|
|
@ -32,8 +33,12 @@ void UpdateDescriptorQueue::TickFrame() {
|
|||
}
|
||||
|
||||
void UpdateDescriptorQueue::Acquire(Scheduler& scheduler) {
|
||||
if (std::distance(payload_start, payload_cursor) + MIN_ENTRIES > ptrdiff_t(FRAME_PAYLOAD_SIZE)) {
|
||||
LOG_WARNING(Render_Vulkan, "Payload overflow {}, waiting for worker thread", std::distance(payload_start, payload_cursor));
|
||||
// Minimum number of entries required.
|
||||
// This is the maximum number of entries a single draw call might use.
|
||||
static constexpr size_t MIN_ENTRIES = 0x400;
|
||||
|
||||
if (std::distance(payload_start, payload_cursor) + MIN_ENTRIES >= FRAME_PAYLOAD_SIZE) {
|
||||
LOG_WARNING(Render_Vulkan, "Payload overflow, waiting for worker thread");
|
||||
scheduler.WaitWorker();
|
||||
payload_cursor = payload_start;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,13 +27,10 @@ union DescriptorUpdateEntry {
|
|||
};
|
||||
|
||||
class UpdateDescriptorQueue final {
|
||||
// Minimum number of entries required. This is the maximum number of entries a single draw call might use.
|
||||
static constexpr size_t MIN_ENTRIES = 0x400;
|
||||
// This should be plenty for the vast majority of cases. Most desktop platforms only
|
||||
// provide up to 3 swapchain images.
|
||||
static constexpr size_t FRAMES_IN_FLIGHT = 8;
|
||||
// Mario Jamboree on minigames uses up to 0x21xxx entries at a time
|
||||
static constexpr size_t FRAME_PAYLOAD_SIZE = 0x24000;
|
||||
static constexpr size_t FRAME_PAYLOAD_SIZE = 0x20000;
|
||||
static constexpr size_t PAYLOAD_SIZE = FRAME_PAYLOAD_SIZE * FRAMES_IN_FLIGHT;
|
||||
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue