mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-22 22:46:41 +00:00
Add Deserialise support for all objects created with SerialiseComplexArray
and SerialiseOptionalObject.
This commit is contained in:
@@ -2225,8 +2225,11 @@ Serialiser::Deserialise<VkDeviceCreateInfo>::~Deserialise()
|
||||
{
|
||||
if(m_Mode == READING)
|
||||
{
|
||||
RDCASSERT(pNext == NULL); // otherwise delete
|
||||
delete [] pRequestedQueues;
|
||||
delete ppEnabledExtensionNames;
|
||||
delete ppEnabledLayerNames;
|
||||
delete pEnabledFeatures;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2329,6 +2332,16 @@ void Serialiser::Serialise(const char *name, VkFramebufferCreateInfo &el)
|
||||
SerialiseObject(VkImageView, "pAttachments", attaches[i]);
|
||||
}
|
||||
|
||||
template<>
|
||||
Serialiser::Deserialise<VkFramebufferCreateInfo>::~Deserialise()
|
||||
{
|
||||
if(m_Mode == READING)
|
||||
{
|
||||
RDCASSERT(pNext == NULL); // otherwise delete
|
||||
delete [] pAttachments;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
void Serialiser::Serialise(const char *name, VkAttachmentDescription &el)
|
||||
{
|
||||
@@ -2414,6 +2427,34 @@ void Serialiser::Serialise(const char *name, VkRenderPassCreateInfo &el)
|
||||
SerialiseComplexArray("pDependencies", (VkSubpassDependency *&)el.pDependencies, el.dependencyCount);
|
||||
}
|
||||
|
||||
template<>
|
||||
Serialiser::Deserialise<VkRenderPassCreateInfo>::~Deserialise()
|
||||
{
|
||||
if(m_Mode == READING)
|
||||
{
|
||||
RDCASSERT(pNext == NULL); // otherwise delete
|
||||
for (uint32_t i=0; i<attachmentCount; i++)
|
||||
{
|
||||
RDCASSERT(pAttachments[i].pNext == NULL); // otherwise delete
|
||||
}
|
||||
delete [] pAttachments;
|
||||
for (uint32_t i=0; i<subpassCount; i++)
|
||||
{
|
||||
RDCASSERT(pSubpasses[i].pNext == NULL); // otherwise delete
|
||||
delete pSubpasses[i].inputAttachments;
|
||||
delete pSubpasses[i].colorAttachments;
|
||||
delete pSubpasses[i].resolveAttachments;
|
||||
delete pSubpasses[i].preserveAttachments;
|
||||
}
|
||||
delete [] pSubpasses;
|
||||
for (uint32_t i=0; i<dependencyCount; i++)
|
||||
{
|
||||
RDCASSERT(pDependencies[i].pNext == NULL); // otherwise delete
|
||||
}
|
||||
delete [] pDependencies;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
void Serialiser::Serialise(const char *name, VkRenderPassBeginInfo &el)
|
||||
{
|
||||
@@ -2845,7 +2886,11 @@ template<>
|
||||
Serialiser::Deserialise<VkPipelineLayoutCreateInfo>::~Deserialise()
|
||||
{
|
||||
if(m_Mode == READING)
|
||||
delete pSetLayouts;
|
||||
{
|
||||
RDCASSERT(pNext == NULL); // otherwise delete
|
||||
delete [] pSetLayouts;
|
||||
delete [] pPushConstantRanges;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
@@ -3030,6 +3075,69 @@ void Serialiser::Serialise(const char *name, VkGraphicsPipelineCreateInfo &el)
|
||||
SerialiseComplexArray("pStages", (VkPipelineShaderStageCreateInfo *&)el.pStages, el.stageCount);
|
||||
}
|
||||
|
||||
template<>
|
||||
Serialiser::Deserialise<VkGraphicsPipelineCreateInfo>::~Deserialise()
|
||||
{
|
||||
if(m_Mode == READING)
|
||||
{
|
||||
RDCASSERT(pNext == NULL); // otherwise delete
|
||||
if (pVertexInputState)
|
||||
{
|
||||
RDCASSERT(pVertexInputState->pNext == NULL); // otherwise delete
|
||||
delete pVertexInputState->pVertexBindingDescriptions;
|
||||
delete pVertexInputState->pVertexAttributeDescriptions;
|
||||
delete pVertexInputState;
|
||||
}
|
||||
if (pInputAssemblyState)
|
||||
{
|
||||
RDCASSERT(pInputAssemblyState->pNext == NULL); // otherwise delete
|
||||
delete pInputAssemblyState;
|
||||
}
|
||||
if (pTessellationState)
|
||||
{
|
||||
RDCASSERT(pTessellationState->pNext == NULL); // otherwise delete
|
||||
delete pTessellationState;
|
||||
}
|
||||
if (pViewportState)
|
||||
{
|
||||
RDCASSERT(pViewportState->pNext == NULL); // otherwise delete
|
||||
delete pViewportState;
|
||||
}
|
||||
if (pRasterState)
|
||||
{
|
||||
RDCASSERT(pRasterState->pNext == NULL); // otherwise delete
|
||||
delete pRasterState;
|
||||
}
|
||||
if (pMultisampleState)
|
||||
{
|
||||
RDCASSERT(pMultisampleState->pNext == NULL); // otherwise delete
|
||||
delete pMultisampleState;
|
||||
}
|
||||
if (pDepthStencilState)
|
||||
{
|
||||
RDCASSERT(pDepthStencilState->pNext == NULL); // otherwise delete
|
||||
delete pDepthStencilState;
|
||||
}
|
||||
if (pColorBlendState)
|
||||
{
|
||||
RDCASSERT(pColorBlendState->pNext == NULL); // otherwise delete
|
||||
delete [] pColorBlendState->pAttachments;
|
||||
delete pColorBlendState;
|
||||
}
|
||||
for (uint32_t i=0; i<stageCount; i++)
|
||||
{
|
||||
RDCASSERT(pStages[i].pNext == NULL); // otherwise delete
|
||||
if (pStages[i].pSpecializationInfo)
|
||||
{
|
||||
delete [] (byte *)pStages[i].pSpecializationInfo->pData;
|
||||
delete [] pStages[i].pSpecializationInfo->pMap;
|
||||
delete pStages[i].pSpecializationInfo;
|
||||
}
|
||||
}
|
||||
delete [] pStages;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
void Serialiser::Serialise(const char *name, VkComputePipelineCreateInfo &el)
|
||||
{
|
||||
@@ -3069,6 +3177,16 @@ void Serialiser::Serialise(const char *name, VkDescriptorPoolCreateInfo &el)
|
||||
SerialiseComplexArray("pTypeCount", (VkDescriptorTypeCount*&)el.pTypeCount, el.count);
|
||||
}
|
||||
|
||||
template<>
|
||||
Serialiser::Deserialise<VkDescriptorPoolCreateInfo>::~Deserialise()
|
||||
{
|
||||
if(m_Mode == READING)
|
||||
{
|
||||
RDCASSERT(pNext == NULL); // otherwise delete
|
||||
delete [] pTypeCount;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
void Serialiser::Serialise(const char *name, VkDescriptorInfo &el)
|
||||
{
|
||||
@@ -3100,6 +3218,16 @@ void Serialiser::Serialise(const char *name, VkWriteDescriptorSet &el)
|
||||
SerialiseComplexArray("pDescriptors", (VkDescriptorInfo*&)el.pDescriptors, el.count);
|
||||
}
|
||||
|
||||
template<>
|
||||
Serialiser::Deserialise<VkWriteDescriptorSet>::~Deserialise()
|
||||
{
|
||||
if(m_Mode == READING)
|
||||
{
|
||||
RDCASSERT(pNext == NULL); // otherwise delete
|
||||
delete [] pDescriptors;
|
||||
}
|
||||
}
|
||||
|
||||
template<>
|
||||
void Serialiser::Serialise(const char *name, VkCopyDescriptorSet &el)
|
||||
{
|
||||
@@ -3176,11 +3304,12 @@ Serialiser::Deserialise<VkDescriptorSetLayoutCreateInfo>::~Deserialise()
|
||||
{
|
||||
if(m_Mode == READING)
|
||||
{
|
||||
RDCASSERT(pNext == NULL); // otherwise delete
|
||||
for (uint32_t i=0; i<count; i++)
|
||||
{
|
||||
delete pBinding[i].pImmutableSamplers;
|
||||
delete [] pBinding[i].pImmutableSamplers;
|
||||
}
|
||||
delete pBinding;
|
||||
delete [] pBinding;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ bool WrappedVulkan::Serialise_vkCreateDescriptorPool(
|
||||
VkDescriptorPool* pDescriptorPool)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, devId, GetResID(device));
|
||||
SERIALISE_ELEMENT(VkDescriptorPoolCreateInfo, info, *pCreateInfo);
|
||||
SERIALISE_ELEMENT_CLASS(VkDescriptorPoolCreateInfo, info, *pCreateInfo);
|
||||
SERIALISE_ELEMENT(ResourceId, id, GetResID(*pDescriptorPool));
|
||||
|
||||
if(m_State == READING)
|
||||
@@ -337,7 +337,7 @@ bool WrappedVulkan::Serialise_vkUpdateDescriptorSets(
|
||||
VkCopyDescriptorSet copyDesc;
|
||||
if(writes)
|
||||
{
|
||||
SERIALISE_ELEMENT(VkWriteDescriptorSet, w, *pDescriptorWrites);
|
||||
SERIALISE_ELEMENT_CLASS(VkWriteDescriptorSet, w, *pDescriptorWrites);
|
||||
writeDesc = w;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -201,7 +201,6 @@ bool WrappedVulkan::Serialise_vkCreateDevice(
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, physId, GetResID(physicalDevice));
|
||||
SERIALISE_ELEMENT_CLASS(VkDeviceCreateInfo, createInfo, *pCreateInfo);
|
||||
//SERIALISE_ELEMENT(VkDeviceCreateInfo, createInfo, *pCreateInfo);
|
||||
SERIALISE_ELEMENT(ResourceId, devId, GetResID(*pDevice));
|
||||
|
||||
if(m_State == READING)
|
||||
|
||||
@@ -367,7 +367,7 @@ bool WrappedVulkan::Serialise_vkCreateFramebuffer(
|
||||
VkFramebuffer* pFramebuffer)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, devId, GetResID(device));
|
||||
SERIALISE_ELEMENT(VkFramebufferCreateInfo, info, *pCreateInfo);
|
||||
SERIALISE_ELEMENT_CLASS(VkFramebufferCreateInfo, info, *pCreateInfo);
|
||||
SERIALISE_ELEMENT(ResourceId, id, GetResID(*pFramebuffer));
|
||||
|
||||
if(m_State == READING)
|
||||
@@ -558,7 +558,7 @@ bool WrappedVulkan::Serialise_vkCreateRenderPass(
|
||||
VkRenderPass* pRenderPass)
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, devId, GetResID(device));
|
||||
SERIALISE_ELEMENT(VkRenderPassCreateInfo, info, *pCreateInfo);
|
||||
SERIALISE_ELEMENT_CLASS(VkRenderPassCreateInfo, info, *pCreateInfo);
|
||||
SERIALISE_ELEMENT(ResourceId, id, GetResID(*pRenderPass));
|
||||
|
||||
if(m_State == READING)
|
||||
|
||||
@@ -337,7 +337,7 @@ bool WrappedVulkan::Serialise_vkCreateGraphicsPipelines(
|
||||
{
|
||||
SERIALISE_ELEMENT(ResourceId, devId, GetResID(device));
|
||||
SERIALISE_ELEMENT(ResourceId, cacheId, GetResID(pipelineCache));
|
||||
SERIALISE_ELEMENT(VkGraphicsPipelineCreateInfo, info, *pCreateInfos);
|
||||
SERIALISE_ELEMENT_CLASS(VkGraphicsPipelineCreateInfo, info, *pCreateInfos);
|
||||
SERIALISE_ELEMENT(ResourceId, id, GetResID(*pPipelines));
|
||||
|
||||
if(m_State == READING)
|
||||
|
||||
Reference in New Issue
Block a user