From 144b3a8a98ed03574a18ef79fb31c4e16f64545d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 28 Jul 2024 08:08:48 -0600 Subject: [PATCH] Vulkan validation error cleanups --- Common/GPU/Vulkan/VulkanContext.cpp | 8 ++++++-- Common/GPU/Vulkan/VulkanRenderManager.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Common/GPU/Vulkan/VulkanContext.cpp b/Common/GPU/Vulkan/VulkanContext.cpp index c301a7e074..127d1ccea1 100644 --- a/Common/GPU/Vulkan/VulkanContext.cpp +++ b/Common/GPU/Vulkan/VulkanContext.cpp @@ -780,8 +780,12 @@ VkResult VulkanContext::CreateDevice(int physical_device) { device_info.pNext = &features2; features2.features = deviceFeatures_.enabled.standard; ChainStruct(features2, &deviceFeatures_.enabled.multiview); - ChainStruct(features2, &deviceFeatures_.enabled.presentWait); - ChainStruct(features2, &deviceFeatures_.enabled.presentId); + if (extensionsLookup_.KHR_present_wait) { + ChainStruct(features2, &deviceFeatures_.enabled.presentWait); + } + if (extensionsLookup_.KHR_present_id) { + ChainStruct(features2, &deviceFeatures_.enabled.presentId); + } if (extensionsLookup_.EXT_provoking_vertex) { ChainStruct(features2, &deviceFeatures_.enabled.provokingVertex); } diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index cd74de27a1..102595dc93 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -901,10 +901,6 @@ void VulkanRenderManager::EndCurRenderStep() { void VulkanRenderManager::BindFramebufferAsRenderTarget(VKRFramebuffer *fb, VKRRenderPassLoadAction color, VKRRenderPassLoadAction depth, VKRRenderPassLoadAction stencil, uint32_t clearColor, float clearDepth, uint8_t clearStencil, const char *tag) { _dbg_assert_(insideFrame_); -#ifdef _DEBUG - SanityCheckPassesOnAdd(); -#endif - // Eliminate dupes (bind of the framebuffer we already are rendering to), instantly convert to a clear if possible. if (!steps_.empty() && steps_.back()->stepType == VKRStepType::RENDER && steps_.back()->render.framebuffer == fb) { u32 clearMask = 0; @@ -949,6 +945,10 @@ void VulkanRenderManager::BindFramebufferAsRenderTarget(VKRFramebuffer *fb, VKRR } } +#ifdef _DEBUG + SanityCheckPassesOnAdd(); +#endif + // More redundant bind elimination. if (curRenderStep_) { if (curRenderStep_->commands.empty()) {