mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-08 16:50:44 +00:00
Use live ID instead of original ID to index maps like creation info etc
This commit is contained in:
@@ -196,6 +196,8 @@ bool WrappedVulkan::Serialise_InitialState(WrappedVkRes *res)
|
||||
{
|
||||
RDCASSERT(res != NULL);
|
||||
|
||||
ResourceId liveid = GetResourceManager()->GetLiveID(id);
|
||||
|
||||
if(type == eResDescriptorSet)
|
||||
{
|
||||
uint32_t numElems;
|
||||
@@ -203,7 +205,7 @@ bool WrappedVulkan::Serialise_InitialState(WrappedVkRes *res)
|
||||
|
||||
m_pSerialiser->SerialiseComplexArray("Bindings", bindings, numElems);
|
||||
|
||||
const DescSetLayout &layout = m_CreationInfo.m_DescSetLayout[ m_DescriptorSetState[id].layout ];
|
||||
const DescSetLayout &layout = m_CreationInfo.m_DescSetLayout[ m_DescriptorSetState[liveid].layout ];
|
||||
|
||||
uint32_t numBinds = (uint32_t)layout.bindings.size();
|
||||
|
||||
@@ -445,7 +447,7 @@ void WrappedVulkan::Apply_InitialState(WrappedVkRes *live, VulkanResourceManager
|
||||
|
||||
// need to blat over the current descriptor set contents, so these are available
|
||||
// when we want to fetch pipeline state
|
||||
vector<VkDescriptorInfo *> &bindings = m_DescriptorSetState[GetResourceManager()->GetOriginalID(id)].currentBindings;
|
||||
vector<VkDescriptorInfo *> &bindings = m_DescriptorSetState[id].currentBindings;
|
||||
|
||||
for(uint32_t i=0; i < initial.num; i++)
|
||||
{
|
||||
|
||||
@@ -672,7 +672,7 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn
|
||||
const VkLayerDispatchTable *vt = ObjDisp(dev);
|
||||
|
||||
ImageLayouts &layouts = m_pDriver->m_ImageLayouts[cfg.texid];
|
||||
VulkanCreationInfo::Image &iminfo = m_pDriver->m_CreationInfo.m_Image[m_pDriver->GetResourceManager()->GetOriginalID(cfg.texid)];
|
||||
VulkanCreationInfo::Image &iminfo = m_pDriver->m_CreationInfo.m_Image[cfg.texid];
|
||||
VkImage liveIm = m_pDriver->GetResourceManager()->GetCurrentHandle<VkImage>(cfg.texid);
|
||||
|
||||
// VKTODOMED handle multiple subresources with different layouts etc
|
||||
@@ -1193,18 +1193,16 @@ vector<byte> VulkanReplay::GetBufferData(ResourceId buff, uint32_t offset, uint3
|
||||
const VkLayerDispatchTable *vt = ObjDisp(dev);
|
||||
|
||||
VkBuffer srcBuf = m_pDriver->GetResourceManager()->GetCurrentHandle<VkBuffer>(buff);
|
||||
|
||||
ResourceId origid = m_pDriver->GetResourceManager()->GetOriginalID(buff);
|
||||
|
||||
if(len == 0)
|
||||
{
|
||||
len = uint32_t(m_pDriver->m_CreationInfo.m_Buffer[origid].size - offset);
|
||||
len = uint32_t(m_pDriver->m_CreationInfo.m_Buffer[buff].size - offset);
|
||||
}
|
||||
|
||||
if(len > 0 && VkDeviceSize(offset+len) > m_pDriver->m_CreationInfo.m_Buffer[origid].size)
|
||||
if(len > 0 && VkDeviceSize(offset+len) > m_pDriver->m_CreationInfo.m_Buffer[buff].size)
|
||||
{
|
||||
RDCWARN("Attempting to read off the end of the array. Will be clamped");
|
||||
len = RDCMIN(len, uint32_t(m_pDriver->m_CreationInfo.m_Buffer[origid].size - offset));
|
||||
len = RDCMIN(len, uint32_t(m_pDriver->m_CreationInfo.m_Buffer[buff].size - offset));
|
||||
}
|
||||
|
||||
vector<byte> ret;
|
||||
@@ -1294,11 +1292,10 @@ void VulkanReplay::FileChanged()
|
||||
|
||||
FetchTexture VulkanReplay::GetTexture(ResourceId id)
|
||||
{
|
||||
VulkanCreationInfo::Image &iminfo = m_pDriver->m_CreationInfo.m_Image[id];
|
||||
|
||||
FetchTexture ret;
|
||||
ret.ID = m_pDriver->GetResourceManager()->GetOriginalID(id);
|
||||
|
||||
VulkanCreationInfo::Image &iminfo = m_pDriver->m_CreationInfo.m_Image[ret.ID];
|
||||
|
||||
ret.arraysize = iminfo.arraySize;
|
||||
ret.creationFlags = iminfo.creationFlags;
|
||||
ret.cubemap = iminfo.cube;
|
||||
@@ -1383,7 +1380,7 @@ FetchBuffer VulkanReplay::GetBuffer(ResourceId id)
|
||||
|
||||
ShaderReflection *VulkanReplay::GetShader(ResourceId id)
|
||||
{
|
||||
auto shad = m_pDriver->m_CreationInfo.m_Shader.find(m_pDriver->GetResourceManager()->GetOriginalID(id));
|
||||
auto shad = m_pDriver->m_CreationInfo.m_Shader.find(id);
|
||||
|
||||
if(shad == m_pDriver->m_CreationInfo.m_Shader.end())
|
||||
{
|
||||
@@ -1394,7 +1391,7 @@ ShaderReflection *VulkanReplay::GetShader(ResourceId id)
|
||||
// disassemble lazily on demand
|
||||
if(shad->second.refl.Disassembly.count == 0)
|
||||
{
|
||||
auto &shadmod = m_pDriver->m_CreationInfo.m_ShaderModule[m_pDriver->GetResourceManager()->GetOriginalID(shad->second.module)];
|
||||
auto &shadmod = m_pDriver->m_CreationInfo.m_ShaderModule[shad->second.module];
|
||||
|
||||
if(shadmod.spirv.m_Disassembly.empty())
|
||||
shadmod.spirv.Disassemble();
|
||||
@@ -1418,8 +1415,8 @@ void VulkanReplay::SavePipelineState()
|
||||
m_VulkanPipelineState = VulkanPipelineState();
|
||||
|
||||
// General pipeline properties
|
||||
m_VulkanPipelineState.compute.obj = state.compute.pipeline;
|
||||
m_VulkanPipelineState.graphics.obj = state.graphics.pipeline;
|
||||
m_VulkanPipelineState.compute.obj = rm->GetOriginalID(state.compute.pipeline);
|
||||
m_VulkanPipelineState.graphics.obj = rm->GetOriginalID(state.graphics.pipeline);
|
||||
|
||||
if(state.compute.pipeline != ResourceId())
|
||||
m_VulkanPipelineState.compute.flags = c.m_Pipeline[state.compute.pipeline].flags;
|
||||
@@ -1431,7 +1428,7 @@ void VulkanReplay::SavePipelineState()
|
||||
m_VulkanPipelineState.graphics.flags = p.flags;
|
||||
|
||||
// Input Assembly
|
||||
m_VulkanPipelineState.IA.ibuffer.buf = state.ibuffer.buf;
|
||||
m_VulkanPipelineState.IA.ibuffer.buf = rm->GetOriginalID(state.ibuffer.buf);
|
||||
m_VulkanPipelineState.IA.ibuffer.offs = state.ibuffer.offs;
|
||||
m_VulkanPipelineState.IA.primitiveRestartEnable = p.primitiveRestartEnable;
|
||||
|
||||
@@ -1456,7 +1453,7 @@ void VulkanReplay::SavePipelineState()
|
||||
create_array_uninit(m_VulkanPipelineState.VI.vbuffers, state.vbuffers.size());
|
||||
for(size_t i=0; i < state.vbuffers.size(); i++)
|
||||
{
|
||||
m_VulkanPipelineState.VI.vbuffers[i].buffer = state.vbuffers[i].buf;
|
||||
m_VulkanPipelineState.VI.vbuffers[i].buffer = rm->GetOriginalID(state.vbuffers[i].buf);
|
||||
m_VulkanPipelineState.VI.vbuffers[i].offset = state.vbuffers[i].offs;
|
||||
}
|
||||
|
||||
@@ -1477,92 +1474,7 @@ void VulkanReplay::SavePipelineState()
|
||||
stages[i]->customName = false;
|
||||
stages[i]->ShaderName = StringFormat::Fmt("Shader %llu", stages[i]->Shader);
|
||||
stages[i]->stage = ShaderStageType(eShaderStage_Vertex + i);
|
||||
stages[i]->BindpointMapping = m_pDriver->m_CreationInfo.m_Shader[stages[i]->Shader].mapping;
|
||||
}
|
||||
|
||||
// Descriptor sets
|
||||
create_array_uninit(m_VulkanPipelineState.graphics.DescSets, state.graphics.descSets.size());
|
||||
create_array_uninit(m_VulkanPipelineState.compute.DescSets, state.compute.descSets.size());
|
||||
|
||||
{
|
||||
rdctype::array<VulkanPipelineState::Pipeline::DescriptorSet> *dsts[] = {
|
||||
&m_VulkanPipelineState.graphics.DescSets,
|
||||
&m_VulkanPipelineState.compute.DescSets,
|
||||
};
|
||||
|
||||
const vector<ResourceId> *srcs[] = {
|
||||
&state.graphics.descSets,
|
||||
&state.compute.descSets,
|
||||
};
|
||||
|
||||
for(size_t p=0; p < ARRAY_COUNT(srcs); p++)
|
||||
{
|
||||
for(size_t i=0; i < srcs[p]->size(); i++)
|
||||
{
|
||||
ResourceId src = (*srcs[p])[i];
|
||||
VulkanPipelineState::Pipeline::DescriptorSet &dst = (*dsts[p])[i];
|
||||
|
||||
dst.descset = src;
|
||||
dst.layout = m_pDriver->m_DescriptorSetState[src].layout;
|
||||
create_array_uninit(dst.bindings, m_pDriver->m_DescriptorSetState[src].currentBindings.size());
|
||||
for(size_t b=0; b < m_pDriver->m_DescriptorSetState[src].currentBindings.size(); b++)
|
||||
{
|
||||
VkDescriptorInfo *info = m_pDriver->m_DescriptorSetState[src].currentBindings[b];
|
||||
const DescSetLayout::Binding &layoutBind = c.m_DescSetLayout[dst.layout].bindings[b];
|
||||
|
||||
dst.bindings[b].arraySize = layoutBind.arraySize;
|
||||
dst.bindings[b].stageFlags = (ShaderStageBits)layoutBind.stageFlags;
|
||||
switch(layoutBind.descriptorType)
|
||||
{
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLER: dst.bindings[b].type = eBindType_Sampler; break;
|
||||
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: dst.bindings[b].type = eBindType_ImageSampler; break;
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: dst.bindings[b].type = eBindType_ReadOnlyImage; break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: dst.bindings[b].type = eBindType_ReadWriteImage; break;
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: dst.bindings[b].type = eBindType_ReadOnlyTBuffer; break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: dst.bindings[b].type = eBindType_ReadWriteTBuffer; break;
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: dst.bindings[b].type = eBindType_ReadOnlyBuffer; break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: dst.bindings[b].type = eBindType_ReadWriteBuffer; break;
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: dst.bindings[b].type = eBindType_ReadOnlyBuffer; break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: dst.bindings[b].type = eBindType_ReadWriteBuffer; break;
|
||||
case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: dst.bindings[b].type = eBindType_InputAttachment; break;
|
||||
default:
|
||||
dst.bindings[b].type = eBindType_Unknown;
|
||||
RDCERR("Unexpected descriptor type");
|
||||
}
|
||||
|
||||
create_array_uninit(dst.bindings[b].binds, layoutBind.arraySize);
|
||||
for(uint32_t a=0; a < layoutBind.arraySize; a++)
|
||||
{
|
||||
if(layoutBind.immutableSampler)
|
||||
dst.bindings[b].binds[a].sampler = layoutBind.immutableSampler[a];
|
||||
else if(info->sampler != VK_NULL_HANDLE)
|
||||
dst.bindings[b].binds[a].sampler = rm->GetOriginalID(VKMGR()->GetNonDispWrapper(info->sampler)->id);
|
||||
|
||||
// only one of these is ever set
|
||||
if(info->imageView != VK_NULL_HANDLE)
|
||||
{
|
||||
dst.bindings[b].binds[a].view = rm->GetOriginalID(VKMGR()->GetNonDispWrapper(info->imageView)->id);
|
||||
dst.bindings[b].binds[a].res = rm->GetOriginalID(c.m_ImageView[dst.bindings[b].binds[a].view].image);
|
||||
}
|
||||
if(info->bufferView != VK_NULL_HANDLE)
|
||||
{
|
||||
dst.bindings[b].binds[a].view = rm->GetOriginalID(VKMGR()->GetNonDispWrapper(info->bufferView)->id);
|
||||
dst.bindings[b].binds[a].res = rm->GetOriginalID(c.m_BufferView[dst.bindings[b].binds[a].view].buffer);
|
||||
dst.bindings[b].binds[a].offset = *(uint32_t *)&info->imageLayout;
|
||||
dst.bindings[b].binds[a].offset += c.m_BufferView[dst.bindings[b].binds[a].view].offset;
|
||||
dst.bindings[b].binds[a].size = c.m_BufferView[dst.bindings[b].binds[a].view].size;
|
||||
}
|
||||
if(info->bufferInfo.buffer != VK_NULL_HANDLE)
|
||||
{
|
||||
dst.bindings[b].binds[a].view = ResourceId();
|
||||
dst.bindings[b].binds[a].res = rm->GetOriginalID(VKMGR()->GetNonDispWrapper(info->bufferInfo.buffer)->id);
|
||||
dst.bindings[b].binds[a].offset = info->bufferInfo.offset;
|
||||
dst.bindings[b].binds[a].size = info->bufferInfo.range;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stages[i]->BindpointMapping = c.m_Shader[p.shaders[i]].mapping;
|
||||
}
|
||||
|
||||
// Tessellation
|
||||
@@ -1677,12 +1589,12 @@ void VulkanReplay::SavePipelineState()
|
||||
m_VulkanPipelineState.DS.back.writeMask = state.back.write;
|
||||
|
||||
// Renderpass
|
||||
m_VulkanPipelineState.Pass.renderpass.obj = state.renderPass;
|
||||
m_VulkanPipelineState.Pass.renderpass.obj = rm->GetOriginalID(state.renderPass);
|
||||
m_VulkanPipelineState.Pass.renderpass.inputAttachments = c.m_RenderPass[state.renderPass].inputAttachments;
|
||||
m_VulkanPipelineState.Pass.renderpass.colorAttachments = c.m_RenderPass[state.renderPass].colorAttachments;
|
||||
m_VulkanPipelineState.Pass.renderpass.depthstencilAttachment = c.m_RenderPass[state.renderPass].depthstencilAttachment;
|
||||
|
||||
m_VulkanPipelineState.Pass.framebuffer.obj = state.framebuffer;
|
||||
m_VulkanPipelineState.Pass.framebuffer.obj = rm->GetOriginalID(state.framebuffer);
|
||||
|
||||
m_VulkanPipelineState.Pass.framebuffer.width = c.m_Framebuffer[state.framebuffer].width;
|
||||
m_VulkanPipelineState.Pass.framebuffer.height = c.m_Framebuffer[state.framebuffer].height;
|
||||
@@ -1691,9 +1603,9 @@ void VulkanReplay::SavePipelineState()
|
||||
create_array_uninit(m_VulkanPipelineState.Pass.framebuffer.attachments, c.m_Framebuffer[state.framebuffer].attachments.size());
|
||||
for(size_t i=0; i < c.m_Framebuffer[state.framebuffer].attachments.size(); i++)
|
||||
{
|
||||
ResourceId viewid = rm->GetOriginalID(c.m_Framebuffer[state.framebuffer].attachments[i].view);
|
||||
ResourceId viewid = c.m_Framebuffer[state.framebuffer].attachments[i].view;
|
||||
|
||||
m_VulkanPipelineState.Pass.framebuffer.attachments[i].view = viewid;
|
||||
m_VulkanPipelineState.Pass.framebuffer.attachments[i].view = rm->GetOriginalID(viewid);
|
||||
m_VulkanPipelineState.Pass.framebuffer.attachments[i].img = rm->GetOriginalID(c.m_ImageView[viewid].image);
|
||||
}
|
||||
|
||||
@@ -1702,6 +1614,97 @@ void VulkanReplay::SavePipelineState()
|
||||
m_VulkanPipelineState.Pass.renderArea.width = state.renderArea.extent.width;
|
||||
m_VulkanPipelineState.Pass.renderArea.height = state.renderArea.extent.height;
|
||||
}
|
||||
|
||||
// Descriptor sets
|
||||
create_array_uninit(m_VulkanPipelineState.graphics.DescSets, state.graphics.descSets.size());
|
||||
create_array_uninit(m_VulkanPipelineState.compute.DescSets, state.compute.descSets.size());
|
||||
|
||||
{
|
||||
rdctype::array<VulkanPipelineState::Pipeline::DescriptorSet> *dsts[] = {
|
||||
&m_VulkanPipelineState.graphics.DescSets,
|
||||
&m_VulkanPipelineState.compute.DescSets,
|
||||
};
|
||||
|
||||
const vector<ResourceId> *srcs[] = {
|
||||
&state.graphics.descSets,
|
||||
&state.compute.descSets,
|
||||
};
|
||||
|
||||
for(size_t p=0; p < ARRAY_COUNT(srcs); p++)
|
||||
{
|
||||
for(size_t i=0; i < srcs[p]->size(); i++)
|
||||
{
|
||||
ResourceId src = (*srcs[p])[i];
|
||||
VulkanPipelineState::Pipeline::DescriptorSet &dst = (*dsts[p])[i];
|
||||
|
||||
ResourceId layoutId = m_pDriver->m_DescriptorSetState[src].layout;
|
||||
|
||||
dst.descset = rm->GetOriginalID(src);
|
||||
dst.layout = rm->GetOriginalID(layoutId);
|
||||
create_array_uninit(dst.bindings, m_pDriver->m_DescriptorSetState[src].currentBindings.size());
|
||||
for(size_t b=0; b < m_pDriver->m_DescriptorSetState[src].currentBindings.size(); b++)
|
||||
{
|
||||
VkDescriptorInfo *info = m_pDriver->m_DescriptorSetState[src].currentBindings[b];
|
||||
const DescSetLayout::Binding &layoutBind = c.m_DescSetLayout[layoutId].bindings[b];
|
||||
|
||||
dst.bindings[b].arraySize = layoutBind.arraySize;
|
||||
dst.bindings[b].stageFlags = (ShaderStageBits)layoutBind.stageFlags;
|
||||
switch(layoutBind.descriptorType)
|
||||
{
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLER: dst.bindings[b].type = eBindType_Sampler; break;
|
||||
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER: dst.bindings[b].type = eBindType_ImageSampler; break;
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: dst.bindings[b].type = eBindType_ReadOnlyImage; break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: dst.bindings[b].type = eBindType_ReadWriteImage; break;
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: dst.bindings[b].type = eBindType_ReadOnlyTBuffer; break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: dst.bindings[b].type = eBindType_ReadWriteTBuffer; break;
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: dst.bindings[b].type = eBindType_ReadOnlyBuffer; break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: dst.bindings[b].type = eBindType_ReadWriteBuffer; break;
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: dst.bindings[b].type = eBindType_ReadOnlyBuffer; break;
|
||||
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: dst.bindings[b].type = eBindType_ReadWriteBuffer; break;
|
||||
case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT: dst.bindings[b].type = eBindType_InputAttachment; break;
|
||||
default:
|
||||
dst.bindings[b].type = eBindType_Unknown;
|
||||
RDCERR("Unexpected descriptor type");
|
||||
}
|
||||
|
||||
create_array_uninit(dst.bindings[b].binds, layoutBind.arraySize);
|
||||
for(uint32_t a=0; a < layoutBind.arraySize; a++)
|
||||
{
|
||||
if(layoutBind.immutableSampler)
|
||||
dst.bindings[b].binds[a].sampler = layoutBind.immutableSampler[a];
|
||||
else if(info->sampler != VK_NULL_HANDLE)
|
||||
dst.bindings[b].binds[a].sampler = rm->GetOriginalID(rm->GetNonDispWrapper(info->sampler)->id);
|
||||
|
||||
// only one of these is ever set
|
||||
if(info->imageView != VK_NULL_HANDLE)
|
||||
{
|
||||
ResourceId viewid = rm->GetNonDispWrapper(info->imageView)->id;
|
||||
|
||||
dst.bindings[b].binds[a].view = rm->GetOriginalID(viewid);
|
||||
dst.bindings[b].binds[a].res = rm->GetOriginalID(c.m_ImageView[viewid].image);
|
||||
}
|
||||
if(info->bufferView != VK_NULL_HANDLE)
|
||||
{
|
||||
ResourceId viewid = rm->GetNonDispWrapper(info->bufferView)->id;
|
||||
|
||||
dst.bindings[b].binds[a].view = rm->GetOriginalID(viewid);
|
||||
dst.bindings[b].binds[a].res = rm->GetOriginalID(c.m_BufferView[viewid].buffer);
|
||||
dst.bindings[b].binds[a].offset = *(uint32_t *)&info->imageLayout;
|
||||
dst.bindings[b].binds[a].offset += c.m_BufferView[viewid].offset;
|
||||
dst.bindings[b].binds[a].size = c.m_BufferView[viewid].size;
|
||||
}
|
||||
if(info->bufferInfo.buffer != VK_NULL_HANDLE)
|
||||
{
|
||||
dst.bindings[b].binds[a].view = ResourceId();
|
||||
dst.bindings[b].binds[a].res = rm->GetOriginalID(rm->GetNonDispWrapper(info->bufferInfo.buffer)->id);
|
||||
dst.bindings[b].binds[a].offset = info->bufferInfo.offset;
|
||||
dst.bindings[b].binds[a].size = info->bufferInfo.range;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1950,7 +1953,7 @@ void VulkanReplay::FillCBufferVariables(ResourceId shader, uint32_t cbufSlot, ve
|
||||
// Correct SPIR-V will ultimately need to set explicit layout information for each type.
|
||||
// For now, just assume D3D11 packing (float4 alignment on float4s, float3s, matrices, arrays and structures)
|
||||
|
||||
auto it = m_pDriver->m_CreationInfo.m_Shader.find(m_pDriver->GetResourceManager()->GetOriginalID(shader));
|
||||
auto it = m_pDriver->m_CreationInfo.m_Shader.find(shader);
|
||||
|
||||
if(it == m_pDriver->m_CreationInfo.m_Shader.end())
|
||||
{
|
||||
|
||||
@@ -545,8 +545,8 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass(
|
||||
m_PartialReplayData.renderPassActive = true;
|
||||
ObjDisp(cmdBuffer)->CmdBeginRenderPass(Unwrap(cmdBuffer), &beginInfo, cont);
|
||||
|
||||
m_PartialReplayData.state.renderPass = GetResourceManager()->GetOriginalID(VKMGR()->GetNonDispWrapper(beginInfo.renderPass)->id);
|
||||
m_PartialReplayData.state.framebuffer = GetResourceManager()->GetOriginalID(VKMGR()->GetNonDispWrapper(beginInfo.framebuffer)->id);
|
||||
m_PartialReplayData.state.renderPass = VKMGR()->GetNonDispWrapper(beginInfo.renderPass)->id;
|
||||
m_PartialReplayData.state.framebuffer = VKMGR()->GetNonDispWrapper(beginInfo.framebuffer)->id;
|
||||
m_PartialReplayData.state.renderArea = beginInfo.renderArea;
|
||||
}
|
||||
}
|
||||
@@ -780,52 +780,55 @@ bool WrappedVulkan::Serialise_vkCmdBindPipeline(
|
||||
cmdBuffer = PartialCmdBuf();
|
||||
|
||||
ObjDisp(cmdBuffer)->CmdBindPipeline(Unwrap(cmdBuffer), bind, Unwrap(pipeline));
|
||||
if(bind == VK_PIPELINE_BIND_POINT_GRAPHICS)
|
||||
m_PartialReplayData.state.graphics.pipeline = pipeid;
|
||||
else
|
||||
m_PartialReplayData.state.compute.pipeline = pipeid;
|
||||
|
||||
if(!m_CreationInfo.m_Pipeline[pipeid].dynamicStates[VK_DYNAMIC_STATE_VIEWPORT])
|
||||
ResourceId liveid = GetResID(pipeline);
|
||||
|
||||
if(bind == VK_PIPELINE_BIND_POINT_GRAPHICS)
|
||||
m_PartialReplayData.state.graphics.pipeline = liveid;
|
||||
else
|
||||
m_PartialReplayData.state.compute.pipeline = liveid;
|
||||
|
||||
if(!m_CreationInfo.m_Pipeline[liveid].dynamicStates[VK_DYNAMIC_STATE_VIEWPORT])
|
||||
{
|
||||
m_PartialReplayData.state.views = m_CreationInfo.m_Pipeline[pipeid].viewports;
|
||||
m_PartialReplayData.state.views = m_CreationInfo.m_Pipeline[liveid].viewports;
|
||||
}
|
||||
if(!m_CreationInfo.m_Pipeline[pipeid].dynamicStates[VK_DYNAMIC_STATE_SCISSOR])
|
||||
if(!m_CreationInfo.m_Pipeline[liveid].dynamicStates[VK_DYNAMIC_STATE_SCISSOR])
|
||||
{
|
||||
m_PartialReplayData.state.scissors = m_CreationInfo.m_Pipeline[pipeid].scissors;
|
||||
m_PartialReplayData.state.scissors = m_CreationInfo.m_Pipeline[liveid].scissors;
|
||||
}
|
||||
if(!m_CreationInfo.m_Pipeline[pipeid].dynamicStates[VK_DYNAMIC_STATE_LINE_WIDTH])
|
||||
if(!m_CreationInfo.m_Pipeline[liveid].dynamicStates[VK_DYNAMIC_STATE_LINE_WIDTH])
|
||||
{
|
||||
m_PartialReplayData.state.lineWidth = m_CreationInfo.m_Pipeline[pipeid].lineWidth;
|
||||
m_PartialReplayData.state.lineWidth = m_CreationInfo.m_Pipeline[liveid].lineWidth;
|
||||
}
|
||||
if(!m_CreationInfo.m_Pipeline[pipeid].dynamicStates[VK_DYNAMIC_STATE_DEPTH_BIAS])
|
||||
if(!m_CreationInfo.m_Pipeline[liveid].dynamicStates[VK_DYNAMIC_STATE_DEPTH_BIAS])
|
||||
{
|
||||
m_PartialReplayData.state.bias.depth = m_CreationInfo.m_Pipeline[pipeid].depthBias;
|
||||
m_PartialReplayData.state.bias.biasclamp = m_CreationInfo.m_Pipeline[pipeid].depthBiasClamp;
|
||||
m_PartialReplayData.state.bias.slope = m_CreationInfo.m_Pipeline[pipeid].slopeScaledDepthBias;
|
||||
m_PartialReplayData.state.bias.depth = m_CreationInfo.m_Pipeline[liveid].depthBias;
|
||||
m_PartialReplayData.state.bias.biasclamp = m_CreationInfo.m_Pipeline[liveid].depthBiasClamp;
|
||||
m_PartialReplayData.state.bias.slope = m_CreationInfo.m_Pipeline[liveid].slopeScaledDepthBias;
|
||||
}
|
||||
if(!m_CreationInfo.m_Pipeline[pipeid].dynamicStates[VK_DYNAMIC_STATE_BLEND_CONSTANTS])
|
||||
if(!m_CreationInfo.m_Pipeline[liveid].dynamicStates[VK_DYNAMIC_STATE_BLEND_CONSTANTS])
|
||||
{
|
||||
memcpy(m_PartialReplayData.state.blendConst, m_CreationInfo.m_Pipeline[pipeid].blendConst, sizeof(float)*4);
|
||||
memcpy(m_PartialReplayData.state.blendConst, m_CreationInfo.m_Pipeline[liveid].blendConst, sizeof(float)*4);
|
||||
}
|
||||
if(!m_CreationInfo.m_Pipeline[pipeid].dynamicStates[VK_DYNAMIC_STATE_DEPTH_BOUNDS])
|
||||
if(!m_CreationInfo.m_Pipeline[liveid].dynamicStates[VK_DYNAMIC_STATE_DEPTH_BOUNDS])
|
||||
{
|
||||
m_PartialReplayData.state.mindepth = m_CreationInfo.m_Pipeline[pipeid].minDepthBounds;
|
||||
m_PartialReplayData.state.maxdepth = m_CreationInfo.m_Pipeline[pipeid].maxDepthBounds;
|
||||
m_PartialReplayData.state.mindepth = m_CreationInfo.m_Pipeline[liveid].minDepthBounds;
|
||||
m_PartialReplayData.state.maxdepth = m_CreationInfo.m_Pipeline[liveid].maxDepthBounds;
|
||||
}
|
||||
if(!m_CreationInfo.m_Pipeline[pipeid].dynamicStates[VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK])
|
||||
if(!m_CreationInfo.m_Pipeline[liveid].dynamicStates[VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK])
|
||||
{
|
||||
m_PartialReplayData.state.front.compare = m_CreationInfo.m_Pipeline[pipeid].front.stencilCompareMask;
|
||||
m_PartialReplayData.state.back.compare = m_CreationInfo.m_Pipeline[pipeid].back.stencilCompareMask;
|
||||
m_PartialReplayData.state.front.compare = m_CreationInfo.m_Pipeline[liveid].front.stencilCompareMask;
|
||||
m_PartialReplayData.state.back.compare = m_CreationInfo.m_Pipeline[liveid].back.stencilCompareMask;
|
||||
}
|
||||
if(!m_CreationInfo.m_Pipeline[pipeid].dynamicStates[VK_DYNAMIC_STATE_STENCIL_WRITE_MASK])
|
||||
if(!m_CreationInfo.m_Pipeline[liveid].dynamicStates[VK_DYNAMIC_STATE_STENCIL_WRITE_MASK])
|
||||
{
|
||||
m_PartialReplayData.state.front.write = m_CreationInfo.m_Pipeline[pipeid].front.stencilWriteMask;
|
||||
m_PartialReplayData.state.back.write = m_CreationInfo.m_Pipeline[pipeid].back.stencilWriteMask;
|
||||
m_PartialReplayData.state.front.write = m_CreationInfo.m_Pipeline[liveid].front.stencilWriteMask;
|
||||
m_PartialReplayData.state.back.write = m_CreationInfo.m_Pipeline[liveid].back.stencilWriteMask;
|
||||
}
|
||||
if(!m_CreationInfo.m_Pipeline[pipeid].dynamicStates[VK_DYNAMIC_STATE_STENCIL_REFERENCE])
|
||||
if(!m_CreationInfo.m_Pipeline[liveid].dynamicStates[VK_DYNAMIC_STATE_STENCIL_REFERENCE])
|
||||
{
|
||||
m_PartialReplayData.state.front.ref = m_CreationInfo.m_Pipeline[pipeid].front.stencilReference;
|
||||
m_PartialReplayData.state.back.ref = m_CreationInfo.m_Pipeline[pipeid].back.stencilReference;
|
||||
m_PartialReplayData.state.front.ref = m_CreationInfo.m_Pipeline[liveid].front.stencilReference;
|
||||
m_PartialReplayData.state.back.ref = m_CreationInfo.m_Pipeline[liveid].back.stencilReference;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -836,9 +839,9 @@ bool WrappedVulkan::Serialise_vkCmdBindPipeline(
|
||||
|
||||
// track this while reading, as we need to bind current topology & index byte width to draws
|
||||
if(bind == VK_PIPELINE_BIND_POINT_GRAPHICS)
|
||||
m_PartialReplayData.state.graphics.pipeline = pipeid;
|
||||
m_PartialReplayData.state.graphics.pipeline = GetResID(pipeline);
|
||||
else
|
||||
m_PartialReplayData.state.compute.pipeline = pipeid;
|
||||
m_PartialReplayData.state.compute.pipeline = GetResID(pipeline);
|
||||
|
||||
ObjDisp(cmdBuffer)->CmdBindPipeline(Unwrap(cmdBuffer), bind, Unwrap(pipeline));
|
||||
}
|
||||
@@ -896,9 +899,17 @@ bool WrappedVulkan::Serialise_vkCmdBindDescriptorSets(
|
||||
|
||||
for(uint32_t i=0; i < numSets; i++)
|
||||
{
|
||||
if(m_State >= WRITING) descriptorIDs[i] = GetResID(sets[i]);
|
||||
if(m_State >= WRITING)
|
||||
descriptorIDs[i] = GetResID(sets[i]);
|
||||
|
||||
localSerialiser->Serialise("DescriptorSet", descriptorIDs[i]);
|
||||
if(m_State < WRITING) sets[i] = Unwrap(GetResourceManager()->GetLiveHandle<VkDescriptorSet>(descriptorIDs[i]));
|
||||
|
||||
if(m_State < WRITING)
|
||||
{
|
||||
sets[i] = GetResourceManager()->GetLiveHandle<VkDescriptorSet>(descriptorIDs[i]);
|
||||
descriptorIDs[i] = GetResID(sets[i]);
|
||||
sets[i] = Unwrap(sets[i]);
|
||||
}
|
||||
}
|
||||
|
||||
SERIALISE_ELEMENT(uint32_t, offsCount, dynamicOffsetCount);
|
||||
@@ -1041,8 +1052,9 @@ bool WrappedVulkan::Serialise_vkCmdBindVertexBuffers(
|
||||
|
||||
if(m_State < WRITING)
|
||||
{
|
||||
bufids.push_back(id);
|
||||
bufs.push_back(Unwrap(GetResourceManager()->GetLiveHandle<VkBuffer>(id)));
|
||||
VkBuffer buf = GetResourceManager()->GetLiveHandle<VkBuffer>(id);
|
||||
bufids.push_back(GetResID(buf));
|
||||
bufs.push_back(Unwrap(buf));
|
||||
offs.push_back(o);
|
||||
}
|
||||
}
|
||||
@@ -1126,7 +1138,7 @@ bool WrappedVulkan::Serialise_vkCmdBindIndexBuffer(
|
||||
cmdBuffer = PartialCmdBuf();
|
||||
ObjDisp(cmdBuffer)->CmdBindIndexBuffer(Unwrap(cmdBuffer), Unwrap(buffer), offs, idxType);
|
||||
|
||||
m_PartialReplayData.state.ibuffer.buf = bufid;
|
||||
m_PartialReplayData.state.ibuffer.buf = GetResID(buffer);
|
||||
m_PartialReplayData.state.ibuffer.offs = offs;
|
||||
m_PartialReplayData.state.ibuffer.bytewidth = idxType == VK_INDEX_TYPE_UINT32 ? 4 : 2;
|
||||
}
|
||||
|
||||
@@ -107,8 +107,6 @@ bool WrappedVulkan::Serialise_vkCreateDescriptorSetLayout(
|
||||
VkDescriptorSetLayout layout = VK_NULL_HANDLE;
|
||||
|
||||
device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
|
||||
|
||||
m_CreationInfo.m_DescSetLayout[id].Init(&info);
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateDescriptorSetLayout(Unwrap(device), &info, &layout);
|
||||
|
||||
@@ -120,6 +118,8 @@ bool WrappedVulkan::Serialise_vkCreateDescriptorSetLayout(
|
||||
{
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), layout);
|
||||
GetResourceManager()->AddLiveResource(id, layout);
|
||||
|
||||
m_CreationInfo.m_DescSetLayout[live].Init(&info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,8 +225,8 @@ bool WrappedVulkan::Serialise_vkAllocDescriptorSets(
|
||||
GetResourceManager()->AddLiveResource(id, descset);
|
||||
|
||||
// this is stored in the resource record on capture, we need to be able to look to up
|
||||
m_DescriptorSetState[id].layout = layoutId;
|
||||
m_CreationInfo.m_DescSetLayout[layoutId].CreateBindingsArray(m_DescriptorSetState[id].currentBindings);
|
||||
m_DescriptorSetState[live].layout = GetResID(layout);
|
||||
m_CreationInfo.m_DescSetLayout[GetResID(layout)].CreateBindingsArray(m_DescriptorSetState[live].currentBindings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,7 +437,7 @@ bool WrappedVulkan::Serialise_vkUpdateDescriptorSets(
|
||||
ObjDisp(device)->UpdateDescriptorSets(Unwrap(device), 1, &writeDesc, 0, NULL);
|
||||
|
||||
// update our local tracking
|
||||
vector<VkDescriptorInfo *> &bindings = m_DescriptorSetState[GetResourceManager()->GetOriginalID(GetResourceManager()->GetNonDispWrapper(writeDesc.destSet)->id)].currentBindings;
|
||||
vector<VkDescriptorInfo *> &bindings = m_DescriptorSetState[GetResourceManager()->GetNonDispWrapper(writeDesc.destSet)->id].currentBindings;
|
||||
|
||||
{
|
||||
RDCASSERT(writeDesc.destBinding < bindings.size());
|
||||
|
||||
@@ -300,9 +300,6 @@ bool WrappedVulkan::Serialise_vkCreateFramebuffer(
|
||||
{
|
||||
device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
|
||||
VkFramebuffer fb = VK_NULL_HANDLE;
|
||||
|
||||
// use original ID
|
||||
m_CreationInfo.m_Framebuffer[id].Init(&info);
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateFramebuffer(Unwrap(device), &info, &fb);
|
||||
|
||||
@@ -314,6 +311,8 @@ bool WrappedVulkan::Serialise_vkCreateFramebuffer(
|
||||
{
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), fb);
|
||||
GetResourceManager()->AddLiveResource(id, fb);
|
||||
|
||||
m_CreationInfo.m_Framebuffer[live].Init(&info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,9 +384,6 @@ bool WrappedVulkan::Serialise_vkCreateRenderPass(
|
||||
{
|
||||
device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
|
||||
VkRenderPass rp = VK_NULL_HANDLE;
|
||||
|
||||
// use original ID
|
||||
m_CreationInfo.m_RenderPass[id].Init(&info);
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateRenderPass(Unwrap(device), &info, &rp);
|
||||
|
||||
@@ -399,6 +395,8 @@ bool WrappedVulkan::Serialise_vkCreateRenderPass(
|
||||
{
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), rp);
|
||||
GetResourceManager()->AddLiveResource(id, rp);
|
||||
|
||||
m_CreationInfo.m_RenderPass[live].Init(&info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -624,13 +624,15 @@ bool WrappedVulkan::Serialise_vkCreateBuffer(
|
||||
device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
|
||||
VkBuffer buf = VK_NULL_HANDLE;
|
||||
|
||||
m_CreationInfo.m_Buffer[id].Init(&info);
|
||||
VkBufferUsageFlags origusage = info.usage;
|
||||
|
||||
// ensure we can always readback from buffers
|
||||
info.usage |= VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT;
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateBuffer(Unwrap(device), &info, &buf);
|
||||
|
||||
info.usage = origusage;
|
||||
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: 0x%08x", ret);
|
||||
@@ -639,6 +641,8 @@ bool WrappedVulkan::Serialise_vkCreateBuffer(
|
||||
{
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), buf);
|
||||
GetResourceManager()->AddLiveResource(id, buf);
|
||||
|
||||
m_CreationInfo.m_Buffer[live].Init(&info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -695,9 +699,6 @@ bool WrappedVulkan::Serialise_vkCreateBufferView(
|
||||
{
|
||||
device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
|
||||
VkBufferView view = VK_NULL_HANDLE;
|
||||
|
||||
// use original ID
|
||||
m_CreationInfo.m_BufferView[id].Init(&info);
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateBufferView(Unwrap(device), &info, &view);
|
||||
|
||||
@@ -709,6 +710,8 @@ bool WrappedVulkan::Serialise_vkCreateBufferView(
|
||||
{
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), view);
|
||||
GetResourceManager()->AddLiveResource(id, view);
|
||||
|
||||
m_CreationInfo.m_BufferView[live].Init(&info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -769,13 +772,15 @@ bool WrappedVulkan::Serialise_vkCreateImage(
|
||||
device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
|
||||
VkImage img = VK_NULL_HANDLE;
|
||||
|
||||
m_CreationInfo.m_Image[id].Init(&info);
|
||||
VkImageUsageFlags origusage = info.usage;
|
||||
|
||||
// ensure we can always display and copy from textures
|
||||
info.usage |= VK_IMAGE_USAGE_SAMPLED_BIT|VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT;
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateImage(Unwrap(device), &info, &img);
|
||||
|
||||
info.usage = origusage;
|
||||
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: 0x%08x", ret);
|
||||
@@ -784,7 +789,8 @@ bool WrappedVulkan::Serialise_vkCreateImage(
|
||||
{
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), img);
|
||||
GetResourceManager()->AddLiveResource(id, img);
|
||||
|
||||
|
||||
m_CreationInfo.m_Image[live].Init(&info);
|
||||
|
||||
VkImageSubresourceRange range;
|
||||
range.baseMipLevel = range.baseArrayLayer = 0;
|
||||
@@ -884,9 +890,6 @@ bool WrappedVulkan::Serialise_vkCreateImageView(
|
||||
{
|
||||
device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
|
||||
VkImageView view = VK_NULL_HANDLE;
|
||||
|
||||
// use original ID
|
||||
m_CreationInfo.m_ImageView[id].Init(&info);
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateImageView(Unwrap(device), &info, &view);
|
||||
|
||||
@@ -898,6 +901,8 @@ bool WrappedVulkan::Serialise_vkCreateImageView(
|
||||
{
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), view);
|
||||
GetResourceManager()->AddLiveResource(id, view);
|
||||
|
||||
m_CreationInfo.m_ImageView[live].Init(&info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,8 +122,6 @@ bool WrappedVulkan::Serialise_vkCreateShaderModule(
|
||||
device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
|
||||
VkShaderModule sh = VK_NULL_HANDLE;
|
||||
|
||||
m_CreationInfo.m_ShaderModule[id].Init(&info);
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateShaderModule(Unwrap(device), &info, &sh);
|
||||
|
||||
if(ret != VK_SUCCESS)
|
||||
@@ -134,6 +132,8 @@ bool WrappedVulkan::Serialise_vkCreateShaderModule(
|
||||
{
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), sh);
|
||||
GetResourceManager()->AddLiveResource(id, sh);
|
||||
|
||||
m_CreationInfo.m_ShaderModule[live].Init(&info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,9 +193,6 @@ bool WrappedVulkan::Serialise_vkCreateShader(
|
||||
|
||||
VkResult ret = ObjDisp(device)->CreateShader(Unwrap(device), &info, &sh);
|
||||
|
||||
ResourceId moduleid = GetResourceManager()->GetNonDispWrapper(info.module)->id;
|
||||
m_CreationInfo.m_Shader[id].Init(&info, m_CreationInfo.m_ShaderModule[GetResourceManager()->GetOriginalID(moduleid)]);
|
||||
|
||||
if(ret != VK_SUCCESS)
|
||||
{
|
||||
RDCERR("Failed on resource serialise-creation, VkResult: 0x%08x", ret);
|
||||
@@ -204,6 +201,9 @@ bool WrappedVulkan::Serialise_vkCreateShader(
|
||||
{
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), sh);
|
||||
GetResourceManager()->AddLiveResource(id, sh);
|
||||
|
||||
ResourceId moduleid = GetResourceManager()->GetNonDispWrapper(info.module)->id;
|
||||
m_CreationInfo.m_Shader[live].Init(&info, m_CreationInfo.m_ShaderModule[moduleid]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,9 +336,6 @@ bool WrappedVulkan::Serialise_vkCreateGraphicsPipelines(
|
||||
if(m_State == READING)
|
||||
{
|
||||
VkPipeline pipe = VK_NULL_HANDLE;
|
||||
|
||||
// use original ID
|
||||
m_CreationInfo.m_Pipeline[id].Init(&info);
|
||||
|
||||
device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
|
||||
pipelineCache = GetResourceManager()->GetLiveHandle<VkPipelineCache>(cacheId);
|
||||
@@ -353,6 +350,8 @@ bool WrappedVulkan::Serialise_vkCreateGraphicsPipelines(
|
||||
{
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), pipe);
|
||||
GetResourceManager()->AddLiveResource(id, pipe);
|
||||
|
||||
m_CreationInfo.m_Pipeline[live].Init(&info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,9 +451,6 @@ bool WrappedVulkan::Serialise_vkCreateComputePipelines(
|
||||
if(m_State == READING)
|
||||
{
|
||||
VkPipeline pipe = VK_NULL_HANDLE;
|
||||
|
||||
// use original ID
|
||||
m_CreationInfo.m_Pipeline[id].Init(&info);
|
||||
|
||||
device = GetResourceManager()->GetLiveHandle<VkDevice>(devId);
|
||||
pipelineCache = GetResourceManager()->GetLiveHandle<VkPipelineCache>(cacheId);
|
||||
@@ -469,6 +465,8 @@ bool WrappedVulkan::Serialise_vkCreateComputePipelines(
|
||||
{
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), pipe);
|
||||
GetResourceManager()->AddLiveResource(id, pipe);
|
||||
|
||||
m_CreationInfo.m_Pipeline[live].Init(&info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,11 +89,14 @@ bool WrappedVulkan::Serialise_vkGetSwapchainImagesKHR(
|
||||
|
||||
if(m_State == READING)
|
||||
{
|
||||
// VKTODOLOW what if num images is less than on capture?
|
||||
RDCASSERT(idx < m_CreationInfo.m_SwapChain[swapId].images.size());
|
||||
GetResourceManager()->AddLiveResource(id, m_CreationInfo.m_SwapChain[swapId].images[idx].im);
|
||||
// use original ID because we don't create a live version of the swapchain
|
||||
auto &swapInfo = m_CreationInfo.m_SwapChain[swapId];
|
||||
|
||||
m_CreationInfo.m_Image[id] = m_CreationInfo.m_Image[swapId];
|
||||
// VKTODOLOW what if num images is less than on capture?
|
||||
RDCASSERT(idx < swapInfo.images.size());
|
||||
GetResourceManager()->AddLiveResource(id, swapInfo.images[idx].im);
|
||||
|
||||
m_CreationInfo.m_Image[GetResID(swapInfo.images[idx].im)] = m_CreationInfo.m_Image[swapId];
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -214,6 +217,7 @@ bool WrappedVulkan::Serialise_vkCreateSwapchainKHR(
|
||||
|
||||
if(m_State == READING)
|
||||
{
|
||||
// use original ID because we don't create a live version of the swapchain
|
||||
SwapchainInfo &swapinfo = m_CreationInfo.m_SwapChain[id];
|
||||
|
||||
swapinfo.format = info.imageFormat;
|
||||
@@ -279,6 +283,10 @@ bool WrappedVulkan::Serialise_vkCreateSwapchainKHR(
|
||||
swapinfo.images[i].im = im;
|
||||
|
||||
// fill out image info so we track resource state transitions
|
||||
// sneaky-cheeky use of the swapchain's ID here (it's not a live ID because
|
||||
// we don't create a live swapchain). This will be picked up in
|
||||
// Serialise_vkGetSwapchainImagesKHR to set the data for the live IDs on the
|
||||
// swapchain images.
|
||||
VulkanCreationInfo::Image &iminfo = m_CreationInfo.m_Image[id];
|
||||
iminfo.type = VK_IMAGE_TYPE_2D;
|
||||
iminfo.format = info.imageFormat;
|
||||
|
||||
Reference in New Issue
Block a user