early-access version 4019
This commit is contained in:
parent
81955276bf
commit
20b067fbf4
@ -1,7 +1,7 @@
|
||||
yuzu emulator early access
|
||||
=============
|
||||
|
||||
This is the source code for early-access 4018.
|
||||
This is the source code for early-access 4019.
|
||||
|
||||
## Legal Notice
|
||||
|
||||
|
@ -102,8 +102,8 @@ PresentManager::PresentManager(const vk::Instance& instance_,
|
||||
memory_allocator{memory_allocator_}, scheduler{scheduler_}, swapchain{swapchain_},
|
||||
surface{surface_}, blit_supported{CanBlitToSwapchain(device.GetPhysical(),
|
||||
swapchain.GetImageViewFormat())},
|
||||
use_present_thread{Settings::values.async_presentation.GetValue()},
|
||||
image_count{swapchain.GetImageCount()} {
|
||||
use_present_thread{Settings::values.async_presentation.GetValue()} {
|
||||
SetImageCount();
|
||||
|
||||
auto& dld = device.GetLogical();
|
||||
cmdpool = dld.CreateCommandPool({
|
||||
@ -165,12 +165,6 @@ void PresentManager::Present(Frame* frame) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
// If we have run too far ahead of command processing, wait.
|
||||
std::unique_lock lock{queue_mutex};
|
||||
frame_cv.wait(lock, [&] { return present_queue.size() < FRAMES_IN_FLIGHT - 1; });
|
||||
}
|
||||
|
||||
scheduler.Record([this, frame](vk::CommandBuffer) {
|
||||
std::unique_lock lock{queue_mutex};
|
||||
present_queue.push(frame);
|
||||
@ -298,6 +292,13 @@ void PresentManager::RecreateSwapchain(Frame* frame) {
|
||||
image_count = swapchain.GetImageCount();
|
||||
}
|
||||
|
||||
void PresentManager::SetImageCount() {
|
||||
// We cannot have more than 5 images in flight at any given time.
|
||||
// FRAMES_IN_FLIGHT is 7, and the cache TICKS_TO_DESTROY is 6.
|
||||
// Mali drivers will give us 6.
|
||||
image_count = std::min<size_t>(swapchain.GetImageCount(), 5);
|
||||
}
|
||||
|
||||
void PresentManager::CopyToSwapchain(Frame* frame) {
|
||||
bool requires_recreation = false;
|
||||
|
||||
|
@ -22,10 +22,6 @@ class Device;
|
||||
class Scheduler;
|
||||
class Swapchain;
|
||||
|
||||
// This should be plenty for the vast majority of cases. Most desktop platforms only
|
||||
// provide up to 3 swapchain images.
|
||||
constexpr size_t FRAMES_IN_FLIGHT = 7;
|
||||
|
||||
struct Frame {
|
||||
u32 width;
|
||||
u32 height;
|
||||
@ -66,6 +62,8 @@ private:
|
||||
|
||||
void RecreateSwapchain(Frame* frame);
|
||||
|
||||
void SetImageCount();
|
||||
|
||||
private:
|
||||
const vk::Instance& instance;
|
||||
Core::Frontend::EmuWindow& render_window;
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
#include "video_core/renderer_vulkan/vk_present_manager.h"
|
||||
#include "video_core/vulkan_common/vulkan_wrapper.h"
|
||||
|
||||
namespace Vulkan {
|
||||
@ -30,6 +29,9 @@ struct DescriptorUpdateEntry {
|
||||
};
|
||||
|
||||
class UpdateDescriptorQueue final {
|
||||
// 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 = 7;
|
||||
static constexpr size_t FRAME_PAYLOAD_SIZE = 0x20000;
|
||||
static constexpr size_t PAYLOAD_SIZE = FRAME_PAYLOAD_SIZE * FRAMES_IN_FLIGHT;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user