diff --git a/renderdoc/driver/vulkan/vk_dispatchtables.cpp b/renderdoc/driver/vulkan/vk_dispatchtables.cpp index 6f2402c7bd..b2fcc81271 100644 --- a/renderdoc/driver/vulkan/vk_dispatchtables.cpp +++ b/renderdoc/driver/vulkan/vk_dispatchtables.cpp @@ -91,14 +91,14 @@ void InitInstanceExtensionTables(VkInstance instance, InstanceDeviceInfo *info) #undef HookInitPromotedExtension #define HookInitPromotedExtension(cond, func, suffix) \ - if(cond) \ - { \ - InstanceGPA(func); \ - InstanceGPA(CONCAT(func, suffix)); \ - if(table->func == NULL) \ - table->func = table->CONCAT(func, suffix); \ - if(table->CONCAT(func, suffix) == NULL) \ - table->CONCAT(func, suffix) = table->func; \ + if(cond) \ + { \ + InstanceGPA(func); \ + InstanceGPA(CONCAT(func, suffix)); \ + if(table->func == NULL) \ + table->func = table->CONCAT(func, suffix); \ + if(table->CONCAT(func, suffix) == NULL) \ + table->CONCAT(func, suffix) = table->func; \ } #undef HookInitExtensionEXTtoKHR @@ -141,14 +141,14 @@ void InitDeviceExtensionTables(VkDevice device, InstanceDeviceInfo *info) #undef HookInitPromotedExtension #define HookInitPromotedExtension(cond, func, suffix) \ - if(cond) \ - { \ - DeviceGPA(func); \ - DeviceGPA(CONCAT(func, suffix)); \ - if(table->func == NULL) \ - table->func = table->CONCAT(func, suffix); \ - if(table->CONCAT(func, suffix) == NULL) \ - table->CONCAT(func, suffix) = table->func; \ + if(cond) \ + { \ + DeviceGPA(func); \ + DeviceGPA(CONCAT(func, suffix)); \ + if(table->func == NULL) \ + table->func = table->CONCAT(func, suffix); \ + if(table->CONCAT(func, suffix) == NULL) \ + table->CONCAT(func, suffix) = table->func; \ } #undef HookInitExtensionEXTtoKHR diff --git a/renderdoc/driver/vulkan/vk_dispatchtables.h b/renderdoc/driver/vulkan/vk_dispatchtables.h index c884f915bc..1e7ed5cc48 100644 --- a/renderdoc/driver/vulkan/vk_dispatchtables.h +++ b/renderdoc/driver/vulkan/vk_dispatchtables.h @@ -39,7 +39,8 @@ void InitReplayTables(void *vulkanModule); // bitmask of extension enabled status -enum ExtensionStatusFlagBits { +enum ExtensionStatusFlagBits +{ NotEnabled = 0, ExplicitEnabled = 1 << 0, PromotionEnabled = 1 << 1, diff --git a/renderdoc/driver/vulkan/vk_layer.cpp b/renderdoc/driver/vulkan/vk_layer.cpp index d1462517ef..a803141834 100644 --- a/renderdoc/driver/vulkan/vk_layer.cpp +++ b/renderdoc/driver/vulkan/vk_layer.cpp @@ -374,12 +374,13 @@ VK_LAYER_RENDERDOC_CaptureEnumerateInstanceExtensionProperties( } #undef DeclExt -#define DeclExt(name) \ - ExtensionStatusFlags name = ExtensionStatusFlagBits::NotEnabled; \ +#define DeclExt(name) \ + ExtensionStatusFlags name = ExtensionStatusFlagBits::NotEnabled; \ (void)name; #undef CheckExt -#define CheckExt(name, ver) name = instDevInfo == NULL ? ExtensionStatusFlagBits::NotEnabled : instDevInfo->ext_##name; +#define CheckExt(name, ver) \ + name = instDevInfo == NULL ? ExtensionStatusFlagBits::NotEnabled : instDevInfo->ext_##name; #undef HookInit #define HookInit(function) \ @@ -396,7 +397,7 @@ VK_LAYER_RENDERDOC_CaptureEnumerateInstanceExtensionProperties( // for promoted extensions, we return the function pointer for either name as an alias. #undef HookInitPromotedExtension -#define HookInitPromotedExtension(cond, function, suffix) \ +#define HookInitPromotedExtension(cond, function, suffix) \ if(!strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \ { \ if(ExtensionStatusFlagBits::ExplicitEnabled & cond) \ @@ -515,9 +516,9 @@ VK_LAYER_RENDERDOC_CaptureGetInstanceProcAddr(VkInstance instance, const char *p return (PFN_vkVoidFunction)&CONCAT(hooked_vk, function); #undef HookInitPromotedExtension -#define HookInitPromotedExtension(cond, function, suffix) \ +#define HookInitPromotedExtension(cond, function, suffix) \ if(!strcmp(pName, STRINGIZE(CONCAT(vk, function))) || \ - !strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \ + !strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \ return (PFN_vkVoidFunction)&CONCAT(hooked_vk, function); #undef HookInitExtensionEXTtoKHR @@ -596,7 +597,7 @@ VK_LAYER_RENDERDOC_Capture_layerGetPhysicalDeviceProcAddr(VkInstance instance, c return NULL; #undef HookInitPromotedExtension -#define HookInitPromotedExtension(cond, function, suffix) \ +#define HookInitPromotedExtension(cond, function, suffix) \ if(!strcmp(pName, STRINGIZE(CONCAT(vk, function))) || \ !strcmp(pName, STRINGIZE(CONCAT(vk, CONCAT(function, suffix))))) \ return NULL; diff --git a/renderdoc/driver/vulkan/vk_state.cpp b/renderdoc/driver/vulkan/vk_state.cpp index cec05b53e2..5467554cf5 100644 --- a/renderdoc/driver/vulkan/vk_state.cpp +++ b/renderdoc/driver/vulkan/vk_state.cpp @@ -663,18 +663,18 @@ void VulkanRenderState::BindDynamicState(WrappedVulkan *vk, VkCommandBuffer cmd) else if(ibuffer.bytewidth == 1) type = VK_INDEX_TYPE_UINT8_KHR; - VkBuffer idxBufferUnwrapped = - Unwrap(vk->GetResourceManager()->GetCurrentHandle(ibuffer.buf)); - if(ibuffer.size == VK_WHOLE_SIZE) - { - ObjDisp(cmd)->CmdBindIndexBuffer(Unwrap(cmd), idxBufferUnwrapped, ibuffer.offs, type); - } - else - { - ObjDisp(cmd)->CmdBindIndexBuffer2KHR(Unwrap(cmd), idxBufferUnwrapped, ibuffer.offs, - ibuffer.size, type); - } + VkBuffer idxBufferUnwrapped = + Unwrap(vk->GetResourceManager()->GetCurrentHandle(ibuffer.buf)); + if(ibuffer.size == VK_WHOLE_SIZE) + { + ObjDisp(cmd)->CmdBindIndexBuffer(Unwrap(cmd), idxBufferUnwrapped, ibuffer.offs, type); } + else + { + ObjDisp(cmd)->CmdBindIndexBuffer2KHR(Unwrap(cmd), idxBufferUnwrapped, ibuffer.offs, + ibuffer.size, type); + } + } if((vk->DynamicVertexInput() || vk->ShaderObject()) && dynamicStates[VkDynamicVertexInputEXT]) {