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