diff --git a/renderdoc/driver/vulkan/vk_serialise.cpp b/renderdoc/driver/vulkan/vk_serialise.cpp index 7dfdd3efa..23ae5f065 100644 --- a/renderdoc/driver/vulkan/vk_serialise.cpp +++ b/renderdoc/driver/vulkan/vk_serialise.cpp @@ -1600,6 +1600,16 @@ SERIALISE_VK_HANDLES(); static const rdcliteral pNextName = "pNext"_lit; static const rdcliteral pNextTypeName = "pNextType"_lit; +template +static void SerialiseNextError(SerialiserType &ser, const char *sType, const void *&pNext) +{ + RDResult res; + SET_ERROR_RESULT(res, ResultCode::APIUnsupported, "No support for %s is available in this build", + sType); + pNext = NULL; + ser.SetError(res); +} + template static void SerialiseNext(SerialiserType &ser, VkStructureType &sType, const void *&pNext) { @@ -1631,16 +1641,8 @@ static void SerialiseNext(SerialiserType &ser, VkStructureType &sType, const voi // if we encounter an unsupported struct on read we *cannot* continue since we don't know the // members that got serialised after it -#define PNEXT_UNSUPPORTED(StructType) \ - case StructType: \ - { \ - RDResult res; \ - SET_ERROR_RESULT(res, ResultCode::APIUnsupported, \ - "No support for " #StructType " is available in this build"); \ - pNext = NULL; \ - ser.SetError(res); \ - return; \ - } +#define PNEXT_UNSUPPORTED(StructType) \ + case StructType: return SerialiseNextError(ser, #StructType, pNext); // if we come across a struct we should process, then serialise a pointer to it. #define PNEXT_STRUCT(StructType, StructName) \