From 00b28e28dc33a51ff9bc4767089edb993aa604c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 19 Oct 2025 17:17:35 +0200 Subject: [PATCH] Mac/iOS: Avoid a vulkan warning about primitive restart --- Common/GPU/Vulkan/VulkanContext.h | 4 ++++ Common/GPU/Vulkan/VulkanRenderManager.cpp | 13 +++++++++++++ SDL/CocoaBarItems.mm | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Common/GPU/Vulkan/VulkanContext.h b/Common/GPU/Vulkan/VulkanContext.h index 7786727240..842bcdf6b0 100644 --- a/Common/GPU/Vulkan/VulkanContext.h +++ b/Common/GPU/Vulkan/VulkanContext.h @@ -437,6 +437,10 @@ public: return vulkanDeviceApiVersion_; } + WindowSystem GetWindowSystem() const { + return winsys_; + } + private: bool ChooseQueue(); diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index 4c26d78187..50b694819d 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -106,6 +106,19 @@ bool VKRGraphicsPipeline::Create(VulkanContext *vulkan, VkRenderPass compatibleR VkPipelineInputAssemblyStateCreateInfo inputAssembly{ VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO }; inputAssembly.topology = desc->topology; + inputAssembly.primitiveRestartEnable = VK_FALSE; + +#if PPSSPP_PLATFORM(MAC) + if (vulkan->GetWindowSystem() == WindowSystem::WINDOWSYSTEM_METAL_EXT) { + if (desc->topology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP || + desc->topology == VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN || + desc->topology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP) { + // Metal requires primitive restart to be on to not warn - having it off + // simply isn't supported. + inputAssembly.primitiveRestartEnable = VK_TRUE; + } + } +#endif // We will use dynamic viewport state. pipe.pVertexInputState = &desc->vis; diff --git a/SDL/CocoaBarItems.mm b/SDL/CocoaBarItems.mm index 47ed7306dc..472a3d3c9e 100644 --- a/SDL/CocoaBarItems.mm +++ b/SDL/CocoaBarItems.mm @@ -170,7 +170,7 @@ void OSXOpenURL(const char *url) { { GlobalUIState state = GetUIState(); item.enabled = state == UISTATE_INGAME ? YES : NO; - printf("Setting enabled state to %d\n", (int)item.enabled); + // printf("Setting enabled state to %d\n", (int)item.enabled); break; } default: