From 8e23c8afda6b27a4325c0f1b25fd68d6f5167236 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Thu, 28 Dec 2023 16:13:29 -0600 Subject: [PATCH] Manually guard vkCmdSetExclusiveScissorEnableNV vkCmdSetExclusiveScissorEnableNV was added to an existing extension in 1.3.241. Guard it against users with older headers. --- script/generate_dispatch.py | 1 + src/VkBootstrapDispatch.h | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/script/generate_dispatch.py b/script/generate_dispatch.py index 98914b1..16a5676 100644 --- a/script/generate_dispatch.py +++ b/script/generate_dispatch.py @@ -107,6 +107,7 @@ HEADER_VERSION_WORKAROUNDS = { 'vkGetLatencyTimingsNV': '271', # Changed API parameters 'vkCmdSetDiscardRectangleEnableEXT': '241', # new function in older extension 'vkCmdSetDiscardRectangleModeEXT': '241', # new function in older extension + 'vkCmdSetExclusiveScissorEnableNV': '241', # new function in older extension } def get_macro_guard(reqs_collection, command_name): diff --git a/src/VkBootstrapDispatch.h b/src/VkBootstrapDispatch.h index 63b8f40..1b4eff2 100644 --- a/src/VkBootstrapDispatch.h +++ b/src/VkBootstrapDispatch.h @@ -1873,7 +1873,7 @@ struct DispatchTable { #if (defined(VK_NV_scissor_exclusive)) fp_vkCmdSetExclusiveScissorNV = reinterpret_cast(procAddr(device, "vkCmdSetExclusiveScissorNV")); #endif -#if (defined(VK_NV_scissor_exclusive)) +#if ((defined(VK_NV_scissor_exclusive))) && VK_HEADER_VERSION >= 241 fp_vkCmdSetExclusiveScissorEnableNV = reinterpret_cast(procAddr(device, "vkCmdSetExclusiveScissorEnableNV")); #endif #if (defined(VK_NV_shading_rate_image)) @@ -3862,7 +3862,7 @@ struct DispatchTable { fp_vkCmdSetExclusiveScissorNV(commandBuffer, firstExclusiveScissor, exclusiveScissorCount, pExclusiveScissors); } #endif -#if (defined(VK_NV_scissor_exclusive)) +#if ((defined(VK_NV_scissor_exclusive))) && VK_HEADER_VERSION >= 241 void cmdSetExclusiveScissorEnableNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkBool32* pExclusiveScissorEnables) const noexcept { fp_vkCmdSetExclusiveScissorEnableNV(commandBuffer, firstExclusiveScissor, exclusiveScissorCount, pExclusiveScissorEnables); } @@ -6246,7 +6246,7 @@ struct DispatchTable { #else void * fp_vkCmdSetExclusiveScissorNV{}; #endif -#if (defined(VK_NV_scissor_exclusive)) +#if ((defined(VK_NV_scissor_exclusive))) && VK_HEADER_VERSION >= 241 PFN_vkCmdSetExclusiveScissorEnableNV fp_vkCmdSetExclusiveScissorEnableNV = nullptr; #else void * fp_vkCmdSetExclusiveScissorEnableNV{};