Make sure to init creation info for replay-time object creation

This commit is contained in:
baldurk
2015-10-22 23:43:18 +02:00
parent 07777e0e41
commit 30c30ca807
4 changed files with 45 additions and 3 deletions
@@ -185,6 +185,8 @@ VkResult WrappedVulkan::vkCreateDescriptorSetLayout(
else
{
GetResourceManager()->AddLiveResource(id, *pSetLayout);
m_CreationInfo.m_DescSetLayout[id].Init(&unwrappedInfo);
}
}
@@ -364,6 +364,8 @@ VkResult WrappedVulkan::vkCreateFramebuffer(
else
{
GetResourceManager()->AddLiveResource(id, *pFramebuffer);
m_CreationInfo.m_Framebuffer[id].Init(&unwrappedInfo);
}
}
@@ -459,6 +461,33 @@ VkResult WrappedVulkan::vkCreateRenderPass(
else
{
GetResourceManager()->AddLiveResource(id, *pRenderPass);
VulkanCreationInfo::RenderPass rpinfo;
rpinfo.Init(pCreateInfo);
VkRenderPassCreateInfo info = *pCreateInfo;
VkAttachmentDescription atts[16];
RDCASSERT(ARRAY_COUNT(atts) >= (size_t)info.attachmentCount);
// make a version of the render pass that loads from its attachments,
// so it can be used for replaying a single draw after a render pass
// without doing a clear or a DONT_CARE load.
for(uint32_t i=0; i < info.attachmentCount; i++)
{
atts[i] = info.pAttachments[i];
atts[i].loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
atts[i].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
}
info.pAttachments = atts;
ret = ObjDisp(device)->CreateRenderPass(Unwrap(device), &info, &rpinfo.loadRP);
RDCASSERT(ret == VK_SUCCESS);
GetResourceManager()->WrapResource(Unwrap(device), rpinfo.loadRP);
m_CreationInfo.m_RenderPass[id] = rpinfo;
}
}
@@ -679,6 +679,8 @@ VkResult WrappedVulkan::vkCreateBuffer(
else
{
GetResourceManager()->AddLiveResource(id, *pBuffer);
m_CreationInfo.m_Buffer[id].Init(pCreateInfo);
}
}
@@ -751,6 +753,8 @@ VkResult WrappedVulkan::vkCreateBufferView(
else
{
GetResourceManager()->AddLiveResource(id, *pView);
m_CreationInfo.m_BufferView[id].Init(&unwrappedInfo);
}
}
@@ -944,6 +948,8 @@ VkResult WrappedVulkan::vkCreateImageView(
else
{
GetResourceManager()->AddLiveResource(id, *pView);
m_CreationInfo.m_ImageView[id].Init(&unwrappedInfo);
}
}
@@ -104,7 +104,7 @@ VkResult WrappedVulkan::vkCreatePipelineLayout(
{
GetResourceManager()->AddLiveResource(id, *pPipelineLayout);
m_CreationInfo.m_PipelineLayout[id].Init(pCreateInfo);
m_CreationInfo.m_PipelineLayout[id].Init(&unwrappedInfo);
}
}
@@ -174,6 +174,8 @@ VkResult WrappedVulkan::vkCreateShaderModule(
else
{
GetResourceManager()->AddLiveResource(id, *pShaderModule);
m_CreationInfo.m_ShaderModule[id].Init(pCreateInfo);
}
}
@@ -249,6 +251,9 @@ VkResult WrappedVulkan::vkCreateShader(
else
{
GetResourceManager()->AddLiveResource(id, *pShader);
ResourceId moduleid = GetResID(pCreateInfo->module);
m_CreationInfo.m_Shader[id].Init(&unwrappedInfo, m_CreationInfo.m_ShaderModule[moduleid]);
}
}
@@ -433,7 +438,7 @@ VkResult WrappedVulkan::vkCreateGraphicsPipelines(
{
GetResourceManager()->AddLiveResource(id, pPipelines[i]);
m_CreationInfo.m_Pipeline[id].Init(&pCreateInfos[i]);
m_CreationInfo.m_Pipeline[id].Init(&unwrappedInfos[i]);
}
}
}
@@ -533,7 +538,7 @@ VkResult WrappedVulkan::vkCreateComputePipelines(
{
GetResourceManager()->AddLiveResource(id, pPipelines[i]);
m_CreationInfo.m_Pipeline[id].Init(&pCreateInfos[i]);
m_CreationInfo.m_Pipeline[id].Init(&unwrapped[i]);
}
}
}