From b71eb0527f8d58c32a7a746829bd09180cdbc23f Mon Sep 17 00:00:00 2001 From: goeiecool9999 <7033575+goeiecool9999@users.noreply.github.com> Date: Sat, 16 Mar 2024 16:21:06 +0100 Subject: [PATCH 1/4] fix fmt format string --- .../HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSL.cpp b/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSL.cpp index f3d2c7a82..e19535be1 100644 --- a/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSL.cpp +++ b/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSL.cpp @@ -973,7 +973,7 @@ void _emitOperandInputCode(LatteDecompilerShaderContext* shaderContext, LatteDec } else { - cemuLog_log(LogType::Force, "Unsupported shader ALU operand sel 0x%x\n", aluInstruction->sourceOperand[operandIndex].sel); + cemuLog_log(LogType::Force, "Unsupported shader ALU operand sel {:#x}\n", aluInstruction->sourceOperand[operandIndex].sel); debugBreakpoint(); } From 69f2f825dd1fd3ae2b84167a7841adbfe02ffe40 Mon Sep 17 00:00:00 2001 From: goeiecool9999 <7033575+goeiecool9999@users.noreply.github.com> Date: Sat, 16 Mar 2024 16:39:51 +0100 Subject: [PATCH 2/4] OpenGLRenderer: delete unused function declaration --- src/Cafe/HW/Latte/Renderer/OpenGL/OpenGLRenderer.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Cafe/HW/Latte/Renderer/OpenGL/OpenGLRenderer.h b/src/Cafe/HW/Latte/Renderer/OpenGL/OpenGLRenderer.h index 3a892191b..313ea3c0a 100644 --- a/src/Cafe/HW/Latte/Renderer/OpenGL/OpenGLRenderer.h +++ b/src/Cafe/HW/Latte/Renderer/OpenGL/OpenGLRenderer.h @@ -30,8 +30,6 @@ class OpenGLRenderer : public Renderer void Flush(bool waitIdle = false) override; void NotifyLatteCommandProcessorIdle() override; - void UpdateVSyncState(); - void EnableDebugMode() override; void SwapBuffers(bool swapTV = true, bool swapDRC = true) override; From 6c9fd07d9f7c39f6b478f510aff3c8fe9c9cdc94 Mon Sep 17 00:00:00 2001 From: goeiecool9999 <7033575+goeiecool9999@users.noreply.github.com> Date: Sat, 16 Mar 2024 16:53:02 +0100 Subject: [PATCH 3/4] Vulkan: replace semaphore for pad close with atomic_flag --- src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp | 10 +++++----- src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp index d62b61a67..02bb1e71d 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp @@ -706,8 +706,8 @@ SwapchainInfoVk& VulkanRenderer::GetChainInfo(bool mainWindow) const void VulkanRenderer::StopUsingPadAndWait() { - m_destroyPadSwapchainNextAcquire = true; - m_padCloseReadySemaphore.wait(); + m_destroyPadSwapchainNextAcquire.test_and_set(); + m_destroyPadSwapchainNextAcquire.wait(true); } bool VulkanRenderer::IsPadWindowActive() @@ -2557,11 +2557,11 @@ bool VulkanRenderer::AcquireNextSwapchainImage(bool mainWindow) if(!IsSwapchainInfoValid(mainWindow)) return false; - if(!mainWindow && m_destroyPadSwapchainNextAcquire) + if(!mainWindow && m_destroyPadSwapchainNextAcquire.test()) { RecreateSwapchain(mainWindow, true); - m_destroyPadSwapchainNextAcquire = false; - m_padCloseReadySemaphore.notify(); + m_destroyPadSwapchainNextAcquire.clear(); + m_destroyPadSwapchainNextAcquire.notify_all(); return false; } diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h index e0a4c75b6..47097dfa8 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h @@ -414,8 +414,7 @@ class VulkanRenderer : public Renderer }m_state; std::unique_ptr m_mainSwapchainInfo{}, m_padSwapchainInfo{}; - Semaphore m_padCloseReadySemaphore; - bool m_destroyPadSwapchainNextAcquire = false; + std::atomic_flag m_destroyPadSwapchainNextAcquire{}; bool IsSwapchainInfoValid(bool mainWindow) const; VkRenderPass m_imguiRenderPass = VK_NULL_HANDLE; From e3851e076339075cad20533b511448ef65ba2297 Mon Sep 17 00:00:00 2001 From: goeiecool9999 <7033575+goeiecool9999@users.noreply.github.com> Date: Sat, 16 Mar 2024 16:56:39 +0100 Subject: [PATCH 4/4] MotionSample.h: convert to UTF-8 --- src/input/motion/MotionSample.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/input/motion/MotionSample.h b/src/input/motion/MotionSample.h index bb47f784b..0697711b8 100644 --- a/src/input/motion/MotionSample.h +++ b/src/input/motion/MotionSample.h @@ -258,48 +258,48 @@ DRC flat on table, screen facing up. Top pointing away (away from person, pointi 0.03 0.99 -0.13 0.01 0.13 0.99 -Turned 45° to the right: +Turned 45° to the right: 0.71 -0.03 0.71 0.12 0.99 -0.08 -0.70 0.14 0.70 -Turned 45° to the right (top of GamePad pointing right now): +Turned 45° to the right (top of GamePad pointing right now): 0.08 -0.03 1.00 -> Z points towards person 0.15 0.99 0.01 -0.99 0.15 0.09 -> DRC Z-Axis now points towards X-minus -Turned 90° to the right (top of gamepad now pointing towards holder, away from monitor): +Turned 90° to the right (top of gamepad now pointing towards holder, away from monitor): -1.00 -0.01 0.06 0.00 0.99 0.15 -0.06 0.15 -0.99 -Turned 90° to the right (pointing left): +Turned 90° to the right (pointing left): -0.17 -0.01 -0.99 -0.13 0.99 0.02 0.98 0.13 -0.17 -After another 90° we end up in the initial position: +After another 90° we end up in the initial position: 0.99 -0.03 -0.11 0.01 0.99 -0.13 0.12 0.12 0.99 ------ -From initial position, lean the GamePad on its left side. 45° up. So the screen is pointing to the top left +From initial position, lean the GamePad on its left side. 45° up. So the screen is pointing to the top left 0.66 -0.75 -0.03 0.74 0.66 -0.11 0.10 0.05 0.99 -Further 45°, GamePad now on its left, screen pointing left: +Further 45°, GamePad now on its left, screen pointing left: -0.03 -1.00 -0.00 0.99 -0.03 -0.15 0.15 -0.01 0.99 -From initial position, lean the GamePad on its right side. 45° up. So the screen is pointing to the top right +From initial position, lean the GamePad on its right side. 45° up. So the screen is pointing to the top right 0.75 0.65 -0.11 -0.65 0.76 0.07 0.12 0.02 0.99 -From initial position, tilt the GamePad up 90° (bottom side remains in touch with surface): +From initial position, tilt the GamePad up 90° (bottom side remains in touch with surface): 0.99 -0.05 -0.10 -0.10 0.01 -0.99 0.05 1.00 0.01 @@ -309,7 +309,7 @@ From initial position, stand the GamePad on its top side: 0.09 -0.01 1.00 -0.01 -1.00 -0.01 -Rotate GamePad 180° around x axis, so it now lies on its screen (top of GamePad pointing to holder): +Rotate GamePad 180° around x axis, so it now lies on its screen (top of GamePad pointing to holder): 0.99 -0.03 -0.15 -0.04 -1.00 -0.08 -0.15 0.09 -0.99