summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-02-18 03:29:12 +0100
committerbunnei <bunneidev@gmail.com>2020-02-26 03:23:01 +0100
commite25297536f975db307f7117b3060e9919c44be52 (patch)
tree80e2f2b7e577fe3b16521b0f6f28e38a352b97b0 /src/video_core
parentfrontend: qt: bootmanager: OpenGL: Implement separate presentation thread. (diff)
downloadyuzu-e25297536f975db307f7117b3060e9919c44be52.tar
yuzu-e25297536f975db307f7117b3060e9919c44be52.tar.gz
yuzu-e25297536f975db307f7117b3060e9919c44be52.tar.bz2
yuzu-e25297536f975db307f7117b3060e9919c44be52.tar.lz
yuzu-e25297536f975db307f7117b3060e9919c44be52.tar.xz
yuzu-e25297536f975db307f7117b3060e9919c44be52.tar.zst
yuzu-e25297536f975db307f7117b3060e9919c44be52.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_vulkan/renderer_vulkan.cpp15
-rw-r--r--src/video_core/renderer_vulkan/renderer_vulkan.h8
2 files changed, 14 insertions, 9 deletions
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp
index d5032b432..ddc62bc97 100644
--- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp
+++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp
@@ -106,8 +106,14 @@ RendererVulkan::~RendererVulkan() {
}
void RendererVulkan::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
+ render_window.PollEvents();
+
+ if (!framebuffer) {
+ return;
+ }
+
const auto& layout = render_window.GetFramebufferLayout();
- if (framebuffer && layout.width > 0 && layout.height > 0 && render_window.IsShown()) {
+ if (layout.width > 0 && layout.height > 0 && render_window.IsShown()) {
const VAddr framebuffer_addr = framebuffer->address + framebuffer->offset;
const bool use_accelerated =
rasterizer->AccelerateDisplay(*framebuffer, framebuffer_addr, framebuffer->stride);
@@ -128,13 +134,16 @@ void RendererVulkan::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
blit_screen->Recreate();
}
- render_window.SwapBuffers();
rasterizer->TickFrame();
}
render_window.PollEvents();
}
+void RendererVulkan::TryPresent(int /*timeout_ms*/) {
+ // TODO (bunnei): ImplementMe
+}
+
bool RendererVulkan::Init() {
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr{};
render_window.RetrieveVulkanHandlers(&vkGetInstanceProcAddr, &instance, &surface);
@@ -262,4 +271,4 @@ void RendererVulkan::Report() const {
telemetry_session.AddField(field, "GPU_Vulkan_Extensions", extensions);
}
-} // namespace Vulkan \ No newline at end of file
+} // namespace Vulkan
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.h b/src/video_core/renderer_vulkan/renderer_vulkan.h
index a472c5dc9..f513397f0 100644
--- a/src/video_core/renderer_vulkan/renderer_vulkan.h
+++ b/src/video_core/renderer_vulkan/renderer_vulkan.h
@@ -36,14 +36,10 @@ public:
explicit RendererVulkan(Core::Frontend::EmuWindow& window, Core::System& system);
~RendererVulkan() override;
- /// Swap buffers (render frame)
- void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) override;
-
- /// Initialize the renderer
bool Init() override;
-
- /// Shutdown the renderer
void ShutDown() override;
+ void SwapBuffers(const Tegra::FramebufferConfig* framebuffer) override;
+ void TryPresent(int timeout_ms) override;
private:
std::optional<vk::DebugUtilsMessengerEXT> CreateDebugCallback(