mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-14 18:46:48 +00:00
Remove singleton from VulkanResourceManager, pass it where needed
This commit is contained in:
@@ -2101,10 +2101,11 @@ string ToStrHelper<false, VkPresentModeKHR>::Get(const VkPresentModeKHR &el)
|
||||
// we know the object will be a non-dispatchable object type
|
||||
#define SerialiseObject(type, name, obj) \
|
||||
{ \
|
||||
VulkanResourceManager *rm = (VulkanResourceManager *)GetUserData(); \
|
||||
ResourceId id; \
|
||||
if(m_Mode >= WRITING) id = GetResID(obj); \
|
||||
Serialise(name, id); \
|
||||
if(m_Mode < WRITING) obj = (id == ResourceId() || !VKMGR()->HasLiveResource(id)) ? VK_NULL_HANDLE : Unwrap(VKMGR()->GetLiveHandle<type>(id)); \
|
||||
if(m_Mode < WRITING) obj = (id == ResourceId() || !rm->HasLiveResource(id)) ? VK_NULL_HANDLE : Unwrap(rm->GetLiveHandle<type>(id)); \
|
||||
}
|
||||
|
||||
static void SerialiseNext(Serialiser *ser, const void *&pNext)
|
||||
|
||||
@@ -350,6 +350,8 @@ WrappedVulkan::WrappedVulkan(const char *logFilename)
|
||||
|
||||
m_ResourceManager = new VulkanResourceManager(m_State, m_pSerialiser, this);
|
||||
|
||||
m_pSerialiser->SetUserData(m_ResourceManager);
|
||||
|
||||
m_HeaderChunk = NULL;
|
||||
|
||||
if(!RenderDoc::Inst().IsReplayApp())
|
||||
@@ -543,6 +545,7 @@ Serialiser *WrappedVulkan::GetThreadSerialiser()
|
||||
#endif
|
||||
|
||||
ser = new Serialiser(NULL, Serialiser::WRITING, debugSerialiser);
|
||||
ser->SetUserData(m_ResourceManager);
|
||||
|
||||
#if !defined(RELEASE)
|
||||
RDCDEBUG("Debug Text enabled - for development! remove before release!");
|
||||
|
||||
@@ -92,6 +92,8 @@ void VulkanDebugManager::GPUBuffer::Create(WrappedVulkan *driver, VkDevice dev,
|
||||
{
|
||||
const VkLayerDispatchTable *vt = ObjDisp(dev);
|
||||
|
||||
m_ResourceManager = driver->GetResourceManager();
|
||||
|
||||
sz = size;
|
||||
// offset must be 256-aligned, so ensure we have at least ringSize
|
||||
// copies accounting for that
|
||||
@@ -111,7 +113,7 @@ void VulkanDebugManager::GPUBuffer::Create(WrappedVulkan *driver, VkDevice dev,
|
||||
VkResult vkr = vt->CreateBuffer(Unwrap(dev), &bufInfo, &buf);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), buf);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), buf);
|
||||
|
||||
VkMemoryRequirements mrq;
|
||||
vkr = vt->GetBufferMemoryRequirements(Unwrap(dev), Unwrap(buf), &mrq);
|
||||
@@ -129,7 +131,7 @@ void VulkanDebugManager::GPUBuffer::Create(WrappedVulkan *driver, VkDevice dev,
|
||||
vkr = vt->AllocMemory(Unwrap(dev), &allocInfo, &mem);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), mem);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), mem);
|
||||
|
||||
vkr = vt->BindBufferMemory(Unwrap(dev), Unwrap(buf), Unwrap(mem), 0);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
@@ -150,7 +152,7 @@ void VulkanDebugManager::GPUBuffer::Destroy(const VkLayerDispatchTable *vt, VkDe
|
||||
{
|
||||
vt->DestroyBuffer(Unwrap(dev), Unwrap(buf));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
VKMGR()->ReleaseWrappedResource(buf);
|
||||
GetResourceManager()->ReleaseWrappedResource(buf);
|
||||
buf = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
@@ -158,7 +160,7 @@ void VulkanDebugManager::GPUBuffer::Destroy(const VkLayerDispatchTable *vt, VkDe
|
||||
{
|
||||
vt->FreeMemory(Unwrap(dev), Unwrap(mem));
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
VKMGR()->ReleaseWrappedResource(mem);
|
||||
GetResourceManager()->ReleaseWrappedResource(mem);
|
||||
mem = VK_NULL_HANDLE;
|
||||
}
|
||||
}
|
||||
@@ -195,6 +197,8 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
// VKTODOLOW needs tidy up - isn't scalable. Needs more classes like UBO above.
|
||||
m_pDriver = driver;
|
||||
|
||||
m_ResourceManager = m_pDriver->GetResourceManager();
|
||||
|
||||
m_DescriptorPool = VK_NULL_HANDLE;
|
||||
m_LinearSampler = VK_NULL_HANDLE;
|
||||
m_PointSampler = VK_NULL_HANDLE;
|
||||
@@ -260,7 +264,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateSampler(Unwrap(dev), &sampInfo, &m_LinearSampler);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_LinearSampler);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_LinearSampler);
|
||||
|
||||
sampInfo.minFilter = VK_TEX_FILTER_NEAREST;
|
||||
sampInfo.magFilter = VK_TEX_FILTER_NEAREST;
|
||||
@@ -269,7 +273,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateSampler(Unwrap(dev), &sampInfo, &m_PointSampler);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_PointSampler);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_PointSampler);
|
||||
|
||||
{
|
||||
// VKTODOLOW not sure if these stage flags VK_SHADER_STAGE_... work yet?
|
||||
@@ -285,13 +289,13 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateDescriptorSetLayout(Unwrap(dev), &descsetLayoutInfo, &m_CheckerboardDescSetLayout);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_CheckerboardDescSetLayout);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_CheckerboardDescSetLayout);
|
||||
|
||||
// identical layout
|
||||
vkr = vt->CreateDescriptorSetLayout(Unwrap(dev), &descsetLayoutInfo, &m_GenericDescSetLayout);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_GenericDescSetLayout);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_GenericDescSetLayout);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -308,7 +312,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateDescriptorSetLayout(Unwrap(dev), &descsetLayoutInfo, &m_TexDisplayDescSetLayout);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TexDisplayDescSetLayout);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TexDisplayDescSetLayout);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -327,7 +331,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateDescriptorSetLayout(Unwrap(dev), &descsetLayoutInfo, &m_TextDescSetLayout);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TextDescSetLayout);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TextDescSetLayout);
|
||||
}
|
||||
|
||||
VkPipelineLayoutCreateInfo pipeLayoutInfo = {
|
||||
@@ -339,28 +343,28 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreatePipelineLayout(Unwrap(dev), &pipeLayoutInfo, &m_TexDisplayPipeLayout);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TexDisplayPipeLayout);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TexDisplayPipeLayout);
|
||||
|
||||
pipeLayoutInfo.pSetLayouts = UnwrapPtr(m_CheckerboardDescSetLayout);
|
||||
|
||||
vkr = vt->CreatePipelineLayout(Unwrap(dev), &pipeLayoutInfo, &m_CheckerboardPipeLayout);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_CheckerboardPipeLayout);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_CheckerboardPipeLayout);
|
||||
|
||||
pipeLayoutInfo.pSetLayouts = UnwrapPtr(m_TextDescSetLayout);
|
||||
|
||||
vkr = vt->CreatePipelineLayout(Unwrap(dev), &pipeLayoutInfo, &m_TextPipeLayout);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TextPipeLayout);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TextPipeLayout);
|
||||
|
||||
pipeLayoutInfo.pSetLayouts = UnwrapPtr(m_GenericDescSetLayout);
|
||||
|
||||
vkr = vt->CreatePipelineLayout(Unwrap(dev), &pipeLayoutInfo, &m_GenericPipeLayout);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_GenericPipeLayout);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_GenericPipeLayout);
|
||||
|
||||
VkDescriptorTypeCount descPoolTypes[] = {
|
||||
{ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1024, },
|
||||
@@ -377,13 +381,13 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateDescriptorPool(Unwrap(dev), &descpoolInfo, &m_DescriptorPool);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_DescriptorPool);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_DescriptorPool);
|
||||
|
||||
vkr = vt->AllocDescriptorSets(Unwrap(dev), Unwrap(m_DescriptorPool), VK_DESCRIPTOR_SET_USAGE_STATIC, 1,
|
||||
UnwrapPtr(m_CheckerboardDescSetLayout), &m_CheckerboardDescSet);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_CheckerboardDescSet);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_CheckerboardDescSet);
|
||||
|
||||
for(size_t i=0; i < ARRAY_COUNT(m_TexDisplayDescSet); i++)
|
||||
{
|
||||
@@ -391,20 +395,20 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
UnwrapPtr(m_TexDisplayDescSetLayout), &m_TexDisplayDescSet[i]);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TexDisplayDescSet[i]);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TexDisplayDescSet[i]);
|
||||
}
|
||||
|
||||
vkr = vt->AllocDescriptorSets(Unwrap(dev), Unwrap(m_DescriptorPool), VK_DESCRIPTOR_SET_USAGE_STATIC, 1,
|
||||
UnwrapPtr(m_TextDescSetLayout), &m_TextDescSet);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TextDescSet);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TextDescSet);
|
||||
|
||||
vkr = vt->AllocDescriptorSets(Unwrap(dev), Unwrap(m_DescriptorPool), VK_DESCRIPTOR_SET_USAGE_STATIC, 1,
|
||||
UnwrapPtr(m_GenericDescSetLayout), &m_GenericDescSet);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_GenericDescSet);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_GenericDescSet);
|
||||
|
||||
m_GenericUBO.Create(driver, dev, 128, 10, 0);
|
||||
RDCCOMPILE_ASSERT(sizeof(genericuniforms) <= 128, "outline strip VBO size");
|
||||
@@ -489,7 +493,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateShaderModule(Unwrap(dev), &modinfo, &module[i]);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), module[i]);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), module[i]);
|
||||
|
||||
VkShaderCreateInfo shadinfo = {
|
||||
VK_STRUCTURE_TYPE_SHADER_CREATE_INFO, NULL,
|
||||
@@ -500,7 +504,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateShader(Unwrap(dev), &shadinfo, &shader[i]);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), shader[i]);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), shader[i]);
|
||||
}
|
||||
|
||||
VkRenderPass RGBA32RP, RGBA8RP; // compatible render passes for creating pipelines, either RGBA F32 or RGBA8
|
||||
@@ -624,7 +628,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateGraphicsPipelines(Unwrap(dev), VK_NULL_HANDLE, 1, &pipeInfo, &m_CheckerboardPipeline);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_CheckerboardPipeline);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_CheckerboardPipeline);
|
||||
|
||||
stages[0].shader = Unwrap(shader[BLITVS]);
|
||||
stages[1].shader = Unwrap(shader[TEXDISPLAYFS]);
|
||||
@@ -634,14 +638,14 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateGraphicsPipelines(Unwrap(dev), VK_NULL_HANDLE, 1, &pipeInfo, &m_TexDisplayPipeline);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TexDisplayPipeline);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TexDisplayPipeline);
|
||||
|
||||
pipeInfo.renderPass = RGBA32RP;
|
||||
|
||||
vkr = vt->CreateGraphicsPipelines(Unwrap(dev), VK_NULL_HANDLE, 1, &pipeInfo, &m_TexDisplayF32Pipeline);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TexDisplayF32Pipeline);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TexDisplayF32Pipeline);
|
||||
|
||||
pipeInfo.renderPass = RGBA8RP;
|
||||
|
||||
@@ -652,7 +656,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateGraphicsPipelines(Unwrap(dev), VK_NULL_HANDLE, 1, &pipeInfo, &m_TexDisplayBlendPipeline);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TexDisplayBlendPipeline);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TexDisplayBlendPipeline);
|
||||
|
||||
ia.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
||||
|
||||
@@ -664,7 +668,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateGraphicsPipelines(Unwrap(dev), VK_NULL_HANDLE, 1, &pipeInfo, &m_TextPipeline);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TextPipeline);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TextPipeline);
|
||||
|
||||
ia.topology = VK_PRIMITIVE_TOPOLOGY_LINE_LIST;
|
||||
attState.blendEnable = false;
|
||||
@@ -693,7 +697,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateGraphicsPipelines(Unwrap(dev), VK_NULL_HANDLE, 1, &pipeInfo, &m_GenericPipeline);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_GenericPipeline);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_GenericPipeline);
|
||||
|
||||
vt->DestroyRenderPass(Unwrap(dev), RGBA32RP);
|
||||
vt->DestroyRenderPass(Unwrap(dev), RGBA8RP);
|
||||
@@ -701,10 +705,10 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
for(size_t i=0; i < ARRAY_COUNT(module); i++)
|
||||
{
|
||||
vt->DestroyShader(Unwrap(dev), Unwrap(shader[i]));
|
||||
VKMGR()->ReleaseWrappedResource(shader[i]);
|
||||
GetResourceManager()->ReleaseWrappedResource(shader[i]);
|
||||
|
||||
vt->DestroyShaderModule(Unwrap(dev), Unwrap(module[i]));
|
||||
VKMGR()->ReleaseWrappedResource(module[i]);
|
||||
GetResourceManager()->ReleaseWrappedResource(module[i]);
|
||||
}
|
||||
|
||||
VkCmdBuffer cmd = driver->GetNextCmd();
|
||||
@@ -759,7 +763,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateImage(Unwrap(dev), &imInfo, &m_TextAtlas);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TextAtlas);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TextAtlas);
|
||||
|
||||
VkMemoryRequirements mrq;
|
||||
vkr = vt->GetImageMemoryRequirements(Unwrap(dev), Unwrap(m_TextAtlas), &mrq);
|
||||
@@ -778,7 +782,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->AllocMemory(Unwrap(dev), &allocInfo, &m_TextAtlasMem);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TextAtlasMem);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TextAtlasMem);
|
||||
|
||||
vkr = vt->BindImageMemory(Unwrap(dev), Unwrap(m_TextAtlas), Unwrap(m_TextAtlasMem), 0);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
@@ -795,7 +799,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateImageView(Unwrap(dev), &viewInfo, &m_TextAtlasView);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_TextAtlasView);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_TextAtlasView);
|
||||
|
||||
// need to transition image into valid state, then upload
|
||||
|
||||
@@ -868,7 +872,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateImage(Unwrap(dev), &imInfo, &m_PickPixelImage);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_PickPixelImage);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_PickPixelImage);
|
||||
|
||||
VkMemoryRequirements mrq;
|
||||
vkr = vt->GetImageMemoryRequirements(Unwrap(dev), Unwrap(m_PickPixelImage), &mrq);
|
||||
@@ -887,7 +891,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->AllocMemory(Unwrap(dev), &allocInfo, &m_PickPixelImageMem);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_PickPixelImageMem);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_PickPixelImageMem);
|
||||
|
||||
vkr = vt->BindImageMemory(Unwrap(dev), Unwrap(m_PickPixelImage), Unwrap(m_PickPixelImageMem), 0);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
@@ -906,7 +910,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateImageView(Unwrap(dev), &viewInfo, &m_PickPixelImageView);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_PickPixelImageView);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_PickPixelImageView);
|
||||
|
||||
// need to transition image into valid state
|
||||
|
||||
@@ -954,7 +958,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateRenderPass(Unwrap(dev), &rpinfo, &m_PickPixelRP);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_PickPixelRP);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_PickPixelRP);
|
||||
|
||||
// create framebuffer
|
||||
VkFramebufferCreateInfo fbinfo = {
|
||||
@@ -967,7 +971,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
|
||||
vkr = vt->CreateFramebuffer(Unwrap(dev), &fbinfo, &m_PickPixelFB);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(dev), m_PickPixelFB);
|
||||
GetResourceManager()->WrapResource(Unwrap(dev), m_PickPixelFB);
|
||||
|
||||
// since we always sync for readback, doesn't need to be ring'd
|
||||
m_PickPixelReadbackBuffer.Create(driver, dev, sizeof(float)*4, 1, GPUBuffer::eGPUBufferReadback);
|
||||
@@ -1035,67 +1039,67 @@ VulkanDebugManager::~VulkanDebugManager()
|
||||
if(m_DescriptorPool != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyDescriptorPool(Unwrap(dev), Unwrap(m_DescriptorPool));
|
||||
VKMGR()->ReleaseWrappedResource(m_DescriptorPool);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_DescriptorPool);
|
||||
}
|
||||
|
||||
if(m_LinearSampler != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroySampler(Unwrap(dev), Unwrap(m_LinearSampler));
|
||||
VKMGR()->ReleaseWrappedResource(m_LinearSampler);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_LinearSampler);
|
||||
}
|
||||
|
||||
if(m_PointSampler != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroySampler(Unwrap(dev), Unwrap(m_PointSampler));
|
||||
VKMGR()->ReleaseWrappedResource(m_PointSampler);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_PointSampler);
|
||||
}
|
||||
|
||||
if(m_CheckerboardDescSetLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyDescriptorSetLayout(Unwrap(dev), Unwrap(m_CheckerboardDescSetLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_CheckerboardDescSetLayout);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_CheckerboardDescSetLayout);
|
||||
}
|
||||
|
||||
if(m_CheckerboardPipeLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyPipelineLayout(Unwrap(dev), Unwrap(m_CheckerboardPipeLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_CheckerboardPipeLayout);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_CheckerboardPipeLayout);
|
||||
}
|
||||
|
||||
if(m_CheckerboardPipeline != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyPipeline(Unwrap(dev), Unwrap(m_CheckerboardPipeline));
|
||||
VKMGR()->ReleaseWrappedResource(m_CheckerboardPipeline);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_CheckerboardPipeline);
|
||||
}
|
||||
|
||||
if(m_TexDisplayDescSetLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyDescriptorSetLayout(Unwrap(dev), Unwrap(m_TexDisplayDescSetLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_TexDisplayDescSetLayout);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_TexDisplayDescSetLayout);
|
||||
}
|
||||
|
||||
if(m_TexDisplayPipeLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyPipelineLayout(Unwrap(dev), Unwrap(m_TexDisplayPipeLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_TexDisplayPipeLayout);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_TexDisplayPipeLayout);
|
||||
}
|
||||
|
||||
if(m_TexDisplayPipeline != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyPipeline(Unwrap(dev), Unwrap(m_TexDisplayPipeline));
|
||||
VKMGR()->ReleaseWrappedResource(m_TexDisplayPipeline);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_TexDisplayPipeline);
|
||||
}
|
||||
|
||||
if(m_TexDisplayBlendPipeline != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyPipeline(Unwrap(dev), Unwrap(m_TexDisplayBlendPipeline));
|
||||
VKMGR()->ReleaseWrappedResource(m_TexDisplayBlendPipeline);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_TexDisplayBlendPipeline);
|
||||
}
|
||||
|
||||
if(m_TexDisplayF32Pipeline != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyPipeline(Unwrap(dev), Unwrap(m_TexDisplayF32Pipeline));
|
||||
VKMGR()->ReleaseWrappedResource(m_TexDisplayF32Pipeline);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_TexDisplayF32Pipeline);
|
||||
}
|
||||
|
||||
m_CheckerboardUBO.Destroy(vt, dev);
|
||||
@@ -1106,49 +1110,49 @@ VulkanDebugManager::~VulkanDebugManager()
|
||||
if(m_PickPixelFB != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyFramebuffer(Unwrap(dev), Unwrap(m_PickPixelFB));
|
||||
VKMGR()->ReleaseWrappedResource(m_PickPixelFB);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_PickPixelFB);
|
||||
}
|
||||
|
||||
if(m_PickPixelRP != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyRenderPass(Unwrap(dev), Unwrap(m_PickPixelRP));
|
||||
VKMGR()->ReleaseWrappedResource(m_PickPixelRP);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_PickPixelRP);
|
||||
}
|
||||
|
||||
if(m_PickPixelImageView != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyImageView(Unwrap(dev), Unwrap(m_PickPixelImageView));
|
||||
VKMGR()->ReleaseWrappedResource(m_PickPixelImageView);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_PickPixelImageView);
|
||||
}
|
||||
|
||||
if(m_PickPixelImage != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyImage(Unwrap(dev), Unwrap(m_PickPixelImage));
|
||||
VKMGR()->ReleaseWrappedResource(m_PickPixelImage);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_PickPixelImage);
|
||||
}
|
||||
|
||||
if(m_PickPixelImageMem != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->FreeMemory(Unwrap(dev), Unwrap(m_PickPixelImageMem));
|
||||
VKMGR()->ReleaseWrappedResource(m_PickPixelImageMem);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_PickPixelImageMem);
|
||||
}
|
||||
|
||||
if(m_TextDescSetLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyDescriptorSetLayout(Unwrap(dev), Unwrap(m_TextDescSetLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_TextDescSetLayout);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_TextDescSetLayout);
|
||||
}
|
||||
|
||||
if(m_TextPipeLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyPipelineLayout(Unwrap(dev), Unwrap(m_TextPipeLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_TextPipeLayout);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_TextPipeLayout);
|
||||
}
|
||||
|
||||
if(m_TextPipeline != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyPipeline(Unwrap(dev), Unwrap(m_TextPipeline));
|
||||
VKMGR()->ReleaseWrappedResource(m_TextPipeline);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_TextPipeline);
|
||||
}
|
||||
|
||||
m_TextGeneralUBO.Destroy(vt, dev);
|
||||
@@ -1158,37 +1162,37 @@ VulkanDebugManager::~VulkanDebugManager()
|
||||
if(m_TextAtlasView != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyImageView(Unwrap(dev), Unwrap(m_TextAtlasView));
|
||||
VKMGR()->ReleaseWrappedResource(m_TextAtlasView);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_TextAtlasView);
|
||||
}
|
||||
|
||||
if(m_TextAtlas != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyImage(Unwrap(dev), Unwrap(m_TextAtlas));
|
||||
VKMGR()->ReleaseWrappedResource(m_TextAtlas);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_TextAtlas);
|
||||
}
|
||||
|
||||
if(m_TextAtlasMem != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->FreeMemory(Unwrap(dev), Unwrap(m_TextAtlasMem));
|
||||
VKMGR()->ReleaseWrappedResource(m_TextAtlasMem);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_TextAtlasMem);
|
||||
}
|
||||
|
||||
if(m_GenericDescSetLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyDescriptorSetLayout(Unwrap(dev), Unwrap(m_GenericDescSetLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_GenericDescSetLayout);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_GenericDescSetLayout);
|
||||
}
|
||||
|
||||
if(m_GenericPipeLayout != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyPipelineLayout(Unwrap(dev), Unwrap(m_GenericPipeLayout));
|
||||
VKMGR()->ReleaseWrappedResource(m_GenericPipeLayout);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_GenericPipeLayout);
|
||||
}
|
||||
|
||||
if(m_GenericPipeline != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyPipeline(Unwrap(dev), Unwrap(m_GenericPipeline));
|
||||
VKMGR()->ReleaseWrappedResource(m_GenericPipeline);
|
||||
GetResourceManager()->ReleaseWrappedResource(m_GenericPipeline);
|
||||
}
|
||||
|
||||
m_OutlineStripVBO.Destroy(vt, dev);
|
||||
@@ -1307,7 +1311,7 @@ void VulkanDebugManager::MakeGraphicsPipelineInfo(VkGraphicsPipelineCreateInfo &
|
||||
{
|
||||
stages[stageCount].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
|
||||
stages[stageCount].stage = (VkShaderStage)i;
|
||||
stages[stageCount].shader = VKMGR()->GetCurrentHandle<VkShader>(pipeInfo.shaders[i]);
|
||||
stages[stageCount].shader = GetResourceManager()->GetCurrentHandle<VkShader>(pipeInfo.shaders[i]);
|
||||
stages[stageCount].pNext = NULL;
|
||||
stages[stageCount].pSpecializationInfo = NULL;
|
||||
stageCount++;
|
||||
@@ -1454,8 +1458,8 @@ void VulkanDebugManager::MakeGraphicsPipelineInfo(VkGraphicsPipelineCreateInfo &
|
||||
&cb,
|
||||
&dyn,
|
||||
pipeInfo.flags,
|
||||
VKMGR()->GetCurrentHandle<VkPipelineLayout>(pipeInfo.layout),
|
||||
VKMGR()->GetCurrentHandle<VkRenderPass>(pipeInfo.renderpass),
|
||||
GetResourceManager()->GetCurrentHandle<VkPipelineLayout>(pipeInfo.layout),
|
||||
GetResourceManager()->GetCurrentHandle<VkRenderPass>(pipeInfo.renderpass),
|
||||
pipeInfo.subpass,
|
||||
VK_NULL_HANDLE, // base pipeline handle
|
||||
0, // base pipeline index
|
||||
|
||||
@@ -38,6 +38,8 @@ struct TextPrintState
|
||||
int32_t w, h;
|
||||
};
|
||||
|
||||
class VulkanResourceManager;
|
||||
|
||||
class VulkanDebugManager
|
||||
{
|
||||
public:
|
||||
@@ -72,6 +74,9 @@ class VulkanDebugManager
|
||||
// for handling ring allocations
|
||||
VkDeviceSize totalsize;
|
||||
VkDeviceSize curoffset;
|
||||
|
||||
VulkanResourceManager *GetResourceManager() { return m_ResourceManager; }
|
||||
VulkanResourceManager *m_ResourceManager;
|
||||
};
|
||||
|
||||
// VKTODOLOW make this all private/wrapped up
|
||||
@@ -133,6 +138,8 @@ class VulkanDebugManager
|
||||
private:
|
||||
void InitDebugData();
|
||||
void ShutdownDebugData();
|
||||
|
||||
VulkanResourceManager *GetResourceManager() { return m_ResourceManager; }
|
||||
|
||||
void PatchFixedColShader(VkShaderModule &mod, VkShader &shad, float col[4]);
|
||||
|
||||
@@ -143,9 +150,9 @@ class VulkanDebugManager
|
||||
|
||||
float m_FontCharAspect;
|
||||
float m_FontCharSize;
|
||||
|
||||
|
||||
WrappedVulkan *m_pDriver;
|
||||
VulkanResourceManager *m_ResourceManager;
|
||||
|
||||
VkDevice m_Device;
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "vk_info.h"
|
||||
|
||||
void DescSetLayout::Init(const VkDescriptorSetLayoutCreateInfo* pCreateInfo)
|
||||
void DescSetLayout::Init(VulkanResourceManager *resourceMan, const VkDescriptorSetLayoutCreateInfo* pCreateInfo)
|
||||
{
|
||||
dynamicCount = 0;
|
||||
|
||||
@@ -44,7 +44,7 @@ void DescSetLayout::Init(const VkDescriptorSetLayoutCreateInfo* pCreateInfo)
|
||||
bindings[i].immutableSampler = new ResourceId[bindings[i].arraySize];
|
||||
|
||||
for(uint32_t s=0; s < bindings[i].arraySize; s++)
|
||||
bindings[i].immutableSampler[s] = VKMGR()->GetNonDispWrapper(pCreateInfo->pBinding[i].pImmutableSamplers[s])->id;
|
||||
bindings[i].immutableSampler[s] = resourceMan->GetNonDispWrapper(pCreateInfo->pBinding[i].pImmutableSamplers[s])->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,12 +59,12 @@ void DescSetLayout::CreateBindingsArray(vector<VkDescriptorInfo*> &descBindings)
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::Pipeline::Init(const VkGraphicsPipelineCreateInfo* pCreateInfo)
|
||||
void VulkanCreationInfo::Pipeline::Init(VulkanResourceManager *resourceMan, const VkGraphicsPipelineCreateInfo* pCreateInfo)
|
||||
{
|
||||
flags = pCreateInfo->flags;
|
||||
|
||||
layout = VKMGR()->GetNonDispWrapper(pCreateInfo->layout)->id;
|
||||
renderpass = VKMGR()->GetNonDispWrapper(pCreateInfo->renderPass)->id;
|
||||
layout = resourceMan->GetNonDispWrapper(pCreateInfo->layout)->id;
|
||||
renderpass = resourceMan->GetNonDispWrapper(pCreateInfo->renderPass)->id;
|
||||
subpass = pCreateInfo->subpass;
|
||||
|
||||
// need to figure out which states are valid to be NULL
|
||||
@@ -72,7 +72,7 @@ void VulkanCreationInfo::Pipeline::Init(const VkGraphicsPipelineCreateInfo* pCre
|
||||
// VkPipelineShaderStageCreateInfo
|
||||
RDCEraseEl(shaders);
|
||||
for(uint32_t i=0; i < pCreateInfo->stageCount; i++)
|
||||
shaders[ pCreateInfo->pStages[i].stage ] = VKMGR()->GetNonDispWrapper(pCreateInfo->pStages[i].shader)->id;
|
||||
shaders[ pCreateInfo->pStages[i].stage ] = resourceMan->GetNonDispWrapper(pCreateInfo->pStages[i].shader)->id;
|
||||
|
||||
if(pCreateInfo->pVertexInputState)
|
||||
{
|
||||
@@ -177,17 +177,17 @@ void VulkanCreationInfo::Pipeline::Init(const VkGraphicsPipelineCreateInfo* pCre
|
||||
}
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::Pipeline::Init(const VkComputePipelineCreateInfo* pCreateInfo)
|
||||
void VulkanCreationInfo::Pipeline::Init(VulkanResourceManager *resourceMan, const VkComputePipelineCreateInfo* pCreateInfo)
|
||||
{
|
||||
flags = pCreateInfo->flags;
|
||||
|
||||
layout = VKMGR()->GetNonDispWrapper(pCreateInfo->layout)->id;
|
||||
layout = resourceMan->GetNonDispWrapper(pCreateInfo->layout)->id;
|
||||
|
||||
// need to figure out which states are valid to be NULL
|
||||
|
||||
// VkPipelineShaderStageCreateInfo
|
||||
RDCEraseEl(shaders);
|
||||
shaders[0] = VKMGR()->GetNonDispWrapper(pCreateInfo->stage.shader)->id;
|
||||
shaders[0] = resourceMan->GetNonDispWrapper(pCreateInfo->stage.shader)->id;
|
||||
|
||||
topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
||||
primitiveRestartEnable = false;
|
||||
@@ -224,14 +224,14 @@ void VulkanCreationInfo::Pipeline::Init(const VkComputePipelineCreateInfo* pCrea
|
||||
logicOp = VK_LOGIC_OP_NOOP;
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::PipelineLayout::Init(const VkPipelineLayoutCreateInfo* pCreateInfo)
|
||||
void VulkanCreationInfo::PipelineLayout::Init(VulkanResourceManager *resourceMan, const VkPipelineLayoutCreateInfo* pCreateInfo)
|
||||
{
|
||||
descSetLayouts.resize(pCreateInfo->descriptorSetCount);
|
||||
for(uint32_t i=0; i < pCreateInfo->descriptorSetCount; i++)
|
||||
descSetLayouts[i] = VKMGR()->GetNonDispWrapper(pCreateInfo->pSetLayouts[i])->id;
|
||||
descSetLayouts[i] = resourceMan->GetNonDispWrapper(pCreateInfo->pSetLayouts[i])->id;
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::RenderPass::Init(const VkRenderPassCreateInfo* pCreateInfo)
|
||||
void VulkanCreationInfo::RenderPass::Init(VulkanResourceManager *resourceMan, const VkRenderPassCreateInfo* pCreateInfo)
|
||||
{
|
||||
attachCount = pCreateInfo->attachmentCount;
|
||||
|
||||
@@ -251,7 +251,7 @@ void VulkanCreationInfo::RenderPass::Init(const VkRenderPassCreateInfo* pCreateI
|
||||
? (int32_t)subp.depthStencilAttachment.attachment : -1);
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::Framebuffer::Init(const VkFramebufferCreateInfo* pCreateInfo)
|
||||
void VulkanCreationInfo::Framebuffer::Init(VulkanResourceManager *resourceMan, const VkFramebufferCreateInfo* pCreateInfo)
|
||||
{
|
||||
width = pCreateInfo->width;
|
||||
height = pCreateInfo->height;
|
||||
@@ -259,22 +259,22 @@ void VulkanCreationInfo::Framebuffer::Init(const VkFramebufferCreateInfo* pCreat
|
||||
|
||||
attachments.resize(pCreateInfo->attachmentCount);
|
||||
for(uint32_t i=0; i < pCreateInfo->attachmentCount; i++)
|
||||
attachments[i].view = VKMGR()->GetNonDispWrapper(pCreateInfo->pAttachments[i])->id;
|
||||
attachments[i].view = resourceMan->GetNonDispWrapper(pCreateInfo->pAttachments[i])->id;
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::Buffer::Init(const VkBufferCreateInfo* pCreateInfo)
|
||||
void VulkanCreationInfo::Buffer::Init(VulkanResourceManager *resourceMan, const VkBufferCreateInfo* pCreateInfo)
|
||||
{
|
||||
size = pCreateInfo->size;
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::BufferView::Init(const VkBufferViewCreateInfo* pCreateInfo)
|
||||
void VulkanCreationInfo::BufferView::Init(VulkanResourceManager *resourceMan, const VkBufferViewCreateInfo* pCreateInfo)
|
||||
{
|
||||
buffer = VKMGR()->GetNonDispWrapper(pCreateInfo->buffer)->id;
|
||||
buffer = resourceMan->GetNonDispWrapper(pCreateInfo->buffer)->id;
|
||||
offset = pCreateInfo->offset;
|
||||
size = pCreateInfo->range;
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::Image::Init(const VkImageCreateInfo* pCreateInfo)
|
||||
void VulkanCreationInfo::Image::Init(VulkanResourceManager *resourceMan, const VkImageCreateInfo* pCreateInfo)
|
||||
{
|
||||
view = VK_NULL_HANDLE;
|
||||
|
||||
@@ -299,12 +299,12 @@ void VulkanCreationInfo::Image::Init(const VkImageCreateInfo* pCreateInfo)
|
||||
cube = (pCreateInfo->flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) ? true : false;
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::ImageView::Init(const VkImageViewCreateInfo* pCreateInfo)
|
||||
void VulkanCreationInfo::ImageView::Init(VulkanResourceManager *resourceMan, const VkImageViewCreateInfo* pCreateInfo)
|
||||
{
|
||||
image = VKMGR()->GetNonDispWrapper(pCreateInfo->image)->id;
|
||||
image = resourceMan->GetNonDispWrapper(pCreateInfo->image)->id;
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::ShaderModule::Init(const VkShaderModuleCreateInfo* pCreateInfo)
|
||||
void VulkanCreationInfo::ShaderModule::Init(VulkanResourceManager *resourceMan, const VkShaderModuleCreateInfo* pCreateInfo)
|
||||
{
|
||||
RDCASSERT(pCreateInfo->codeSize % sizeof(uint32_t) == 0);
|
||||
ParseSPIRV((uint32_t *)pCreateInfo->pCode, pCreateInfo->codeSize/sizeof(uint32_t), spirv);
|
||||
@@ -312,9 +312,9 @@ void VulkanCreationInfo::ShaderModule::Init(const VkShaderModuleCreateInfo* pCre
|
||||
spirv.MakeReflection(&reflTemplate, &mapping);
|
||||
}
|
||||
|
||||
void VulkanCreationInfo::Shader::Init(const VkShaderCreateInfo* pCreateInfo, VulkanCreationInfo::ShaderModule &moduleinfo)
|
||||
void VulkanCreationInfo::Shader::Init(VulkanResourceManager *resourceMan, const VkShaderCreateInfo* pCreateInfo, VulkanCreationInfo::ShaderModule &moduleinfo)
|
||||
{
|
||||
module = VKMGR()->GetNonDispWrapper(pCreateInfo->module)->id;
|
||||
module = resourceMan->GetNonDispWrapper(pCreateInfo->module)->id;
|
||||
mapping = moduleinfo.mapping;
|
||||
refl = moduleinfo.reflTemplate;
|
||||
refl.DebugInfo.entryFunc = pCreateInfo->pName;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
struct DescSetLayout
|
||||
{
|
||||
void Init(const VkDescriptorSetLayoutCreateInfo* pCreateInfo);
|
||||
void Init(VulkanResourceManager *resourceMan, const VkDescriptorSetLayoutCreateInfo* pCreateInfo);
|
||||
|
||||
void CreateBindingsArray(vector<VkDescriptorInfo*> &descBindings);
|
||||
|
||||
@@ -53,8 +53,8 @@ struct VulkanCreationInfo
|
||||
{
|
||||
struct Pipeline
|
||||
{
|
||||
void Init(const VkGraphicsPipelineCreateInfo* pCreateInfo);
|
||||
void Init(const VkComputePipelineCreateInfo* pCreateInfo);
|
||||
void Init(VulkanResourceManager *resourceMan, const VkGraphicsPipelineCreateInfo* pCreateInfo);
|
||||
void Init(VulkanResourceManager *resourceMan, const VkComputePipelineCreateInfo* pCreateInfo);
|
||||
|
||||
ResourceId layout;
|
||||
ResourceId renderpass;
|
||||
@@ -154,7 +154,7 @@ struct VulkanCreationInfo
|
||||
|
||||
struct PipelineLayout
|
||||
{
|
||||
void Init(const VkPipelineLayoutCreateInfo* pCreateInfo);
|
||||
void Init(VulkanResourceManager *resourceMan, const VkPipelineLayoutCreateInfo* pCreateInfo);
|
||||
|
||||
vector<ResourceId> descSetLayouts;
|
||||
};
|
||||
@@ -162,7 +162,7 @@ struct VulkanCreationInfo
|
||||
|
||||
struct RenderPass
|
||||
{
|
||||
void Init(const VkRenderPassCreateInfo* pCreateInfo);
|
||||
void Init(VulkanResourceManager *resourceMan, const VkRenderPassCreateInfo* pCreateInfo);
|
||||
|
||||
vector<uint32_t> inputAttachments;
|
||||
vector<uint32_t> colorAttachments;
|
||||
@@ -176,7 +176,7 @@ struct VulkanCreationInfo
|
||||
|
||||
struct Framebuffer
|
||||
{
|
||||
void Init(const VkFramebufferCreateInfo* pCreateInfo);
|
||||
void Init(VulkanResourceManager *resourceMan, const VkFramebufferCreateInfo* pCreateInfo);
|
||||
|
||||
struct Attachment
|
||||
{
|
||||
@@ -190,7 +190,7 @@ struct VulkanCreationInfo
|
||||
|
||||
struct Buffer
|
||||
{
|
||||
void Init(const VkBufferCreateInfo* pCreateInfo);
|
||||
void Init(VulkanResourceManager *resourceMan, const VkBufferCreateInfo* pCreateInfo);
|
||||
|
||||
uint64_t size;
|
||||
};
|
||||
@@ -198,7 +198,7 @@ struct VulkanCreationInfo
|
||||
|
||||
struct BufferView
|
||||
{
|
||||
void Init(const VkBufferViewCreateInfo* pCreateInfo);
|
||||
void Init(VulkanResourceManager *resourceMan, const VkBufferViewCreateInfo* pCreateInfo);
|
||||
|
||||
ResourceId buffer;
|
||||
uint64_t offset;
|
||||
@@ -208,7 +208,7 @@ struct VulkanCreationInfo
|
||||
|
||||
struct Image
|
||||
{
|
||||
void Init(const VkImageCreateInfo* pCreateInfo);
|
||||
void Init(VulkanResourceManager *resourceMan, const VkImageCreateInfo* pCreateInfo);
|
||||
|
||||
VkImageView view;
|
||||
|
||||
@@ -224,7 +224,7 @@ struct VulkanCreationInfo
|
||||
|
||||
struct ImageView
|
||||
{
|
||||
void Init(const VkImageViewCreateInfo* pCreateInfo);
|
||||
void Init(VulkanResourceManager *resourceMan, const VkImageViewCreateInfo* pCreateInfo);
|
||||
|
||||
ResourceId image;
|
||||
};
|
||||
@@ -232,7 +232,7 @@ struct VulkanCreationInfo
|
||||
|
||||
struct ShaderModule
|
||||
{
|
||||
void Init(const VkShaderModuleCreateInfo* pCreateInfo);
|
||||
void Init(VulkanResourceManager *resourceMan, const VkShaderModuleCreateInfo* pCreateInfo);
|
||||
|
||||
SPVModule spirv;
|
||||
ShaderReflection reflTemplate;
|
||||
@@ -242,7 +242,7 @@ struct VulkanCreationInfo
|
||||
|
||||
struct Shader
|
||||
{
|
||||
void Init(const VkShaderCreateInfo* pCreateInfo, VulkanCreationInfo::ShaderModule &moduleinfo);
|
||||
void Init(VulkanResourceManager *resourceMan, const VkShaderCreateInfo* pCreateInfo, VulkanCreationInfo::ShaderModule &moduleinfo);
|
||||
|
||||
ResourceId module;
|
||||
ShaderReflection refl;
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
#include "vk_manager.h"
|
||||
#include "vk_core.h"
|
||||
|
||||
VulkanResourceManager *VulkanResourceManager::m_Inst = NULL;
|
||||
|
||||
template<>
|
||||
void Serialiser::Serialise(const char *name, ImageRegionState &el)
|
||||
{
|
||||
|
||||
@@ -35,21 +35,13 @@ using std::pair;
|
||||
|
||||
class WrappedVulkan;
|
||||
|
||||
// VKTODOLOW maybe make this a bit nicer? I'm not sure.
|
||||
#define VKMGR() VulkanResourceManager::GetInstance()
|
||||
|
||||
class VulkanResourceManager : public ResourceManager<WrappedVkRes*, TypedRealHandle, VkResourceRecord>
|
||||
{
|
||||
public:
|
||||
VulkanResourceManager(LogState s, Serialiser *ser, WrappedVulkan *core)
|
||||
: ResourceManager(s, ser), m_Core(core)
|
||||
{
|
||||
if(m_Inst) RDCFATAL("Multiple resource managers");
|
||||
m_Inst = this;
|
||||
}
|
||||
~VulkanResourceManager() { m_Inst = NULL; }
|
||||
|
||||
static VulkanResourceManager *GetInstance() { return m_Inst; }
|
||||
{ }
|
||||
~VulkanResourceManager() { }
|
||||
|
||||
template<typename realtype>
|
||||
void AddLiveResource(ResourceId id, realtype obj)
|
||||
@@ -214,7 +206,5 @@ class VulkanResourceManager : public ResourceManager<WrappedVkRes*, TypedRealHan
|
||||
void Create_InitialState(ResourceId id, WrappedVkRes *live, bool hasData);
|
||||
void Apply_InitialState(WrappedVkRes *live, InitialContentData initial);
|
||||
|
||||
static VulkanResourceManager *m_Inst;
|
||||
|
||||
WrappedVulkan *m_Core;
|
||||
};
|
||||
|
||||
@@ -111,18 +111,18 @@ void VulkanReplay::OutputWindow::Destroy(WrappedVulkan *driver, VkDevice device)
|
||||
if(bb != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroyRenderPass(Unwrap(device), Unwrap(renderpass));
|
||||
VKMGR()->ReleaseWrappedResource(renderpass);
|
||||
GetResourceManager()->ReleaseWrappedResource(renderpass);
|
||||
renderpass = VK_NULL_HANDLE;
|
||||
|
||||
vt->DestroyImage(Unwrap(device), Unwrap(bb));
|
||||
VKMGR()->ReleaseWrappedResource(bb);
|
||||
GetResourceManager()->ReleaseWrappedResource(bb);
|
||||
|
||||
vt->DestroyImageView(Unwrap(device), Unwrap(bbview));
|
||||
VKMGR()->ReleaseWrappedResource(bbview);
|
||||
GetResourceManager()->ReleaseWrappedResource(bbview);
|
||||
vt->FreeMemory(Unwrap(device), Unwrap(bbmem));
|
||||
VKMGR()->ReleaseWrappedResource(bbmem);
|
||||
GetResourceManager()->ReleaseWrappedResource(bbmem);
|
||||
vt->DestroyFramebuffer(Unwrap(device), Unwrap(fb));
|
||||
VKMGR()->ReleaseWrappedResource(fb);
|
||||
GetResourceManager()->ReleaseWrappedResource(fb);
|
||||
|
||||
bb = VK_NULL_HANDLE;
|
||||
bbview = VK_NULL_HANDLE;
|
||||
@@ -134,7 +134,7 @@ void VulkanReplay::OutputWindow::Destroy(WrappedVulkan *driver, VkDevice device)
|
||||
for(size_t i=0; i < ARRAY_COUNT(colimg); i++)
|
||||
{
|
||||
if(colimg[i] != VK_NULL_HANDLE)
|
||||
VKMGR()->ReleaseWrappedResource(colimg[i]);
|
||||
GetResourceManager()->ReleaseWrappedResource(colimg[i]);
|
||||
colimg[i] = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ void VulkanReplay::OutputWindow::Destroy(WrappedVulkan *driver, VkDevice device)
|
||||
if(swap != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroySwapchainKHR(Unwrap(device), Unwrap(swap));
|
||||
VKMGR()->ReleaseWrappedResource(swap);
|
||||
GetResourceManager()->ReleaseWrappedResource(swap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,12 +277,12 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
|
||||
vkr = vt->CreateSwapchainKHR(Unwrap(device), &swapInfo, &swap);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(device), swap);
|
||||
GetResourceManager()->WrapResource(Unwrap(device), swap);
|
||||
|
||||
if(old != VK_NULL_HANDLE)
|
||||
{
|
||||
vt->DestroySwapchainKHR(Unwrap(device), Unwrap(old));
|
||||
VKMGR()->ReleaseWrappedResource(old);
|
||||
GetResourceManager()->ReleaseWrappedResource(old);
|
||||
}
|
||||
|
||||
vkr = vt->GetSwapchainImagesKHR(Unwrap(device), Unwrap(swap), &numImgs, NULL);
|
||||
@@ -295,7 +295,7 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
|
||||
for(size_t i=0; i < numImgs; i++)
|
||||
{
|
||||
colimg[i] = imgs[i];
|
||||
VKMGR()->WrapResource(Unwrap(device), colimg[i]);
|
||||
GetResourceManager()->WrapResource(Unwrap(device), colimg[i]);
|
||||
coltrans[i].image = Unwrap(colimg[i]);
|
||||
coltrans[i].oldLayout = coltrans[i].newLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
}
|
||||
@@ -346,7 +346,7 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
|
||||
vkr = vt->CreateRenderPass(Unwrap(device), &rpinfo, &renderpass);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(device), renderpass);
|
||||
GetResourceManager()->WrapResource(Unwrap(device), renderpass);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -363,7 +363,7 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
|
||||
VkResult vkr = vt->CreateImage(Unwrap(device), &imInfo, &bb);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(device), bb);
|
||||
GetResourceManager()->WrapResource(Unwrap(device), bb);
|
||||
|
||||
VkMemoryRequirements mrq = {0};
|
||||
|
||||
@@ -378,7 +378,7 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
|
||||
vkr = vt->AllocMemory(Unwrap(device), &allocInfo, &bbmem);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(device), bbmem);
|
||||
GetResourceManager()->WrapResource(Unwrap(device), bbmem);
|
||||
|
||||
vkr = vt->BindImageMemory(Unwrap(device), Unwrap(bb), Unwrap(bbmem), 0);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
@@ -400,7 +400,7 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
|
||||
vkr = vt->CreateImageView(Unwrap(device), &info, &bbview);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(device), bbview);
|
||||
GetResourceManager()->WrapResource(Unwrap(device), bbview);
|
||||
|
||||
VkFramebufferCreateInfo fbinfo = {
|
||||
VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, NULL,
|
||||
@@ -412,7 +412,7 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
|
||||
vkr = vt->CreateFramebuffer(Unwrap(device), &fbinfo, &fb);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(device), fb);
|
||||
GetResourceManager()->WrapResource(Unwrap(device), fb);
|
||||
}
|
||||
|
||||
if(dsimg != VK_NULL_HANDLE)
|
||||
@@ -429,7 +429,7 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
|
||||
vkr = vt->CreateImageView(Unwrap(device), &info, &dsview);
|
||||
RDCASSERT(vkr == VK_SUCCESS);
|
||||
|
||||
VKMGR()->WrapResource(Unwrap(device), dsview);
|
||||
GetResourceManager()->WrapResource(Unwrap(device), dsview);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,6 +450,11 @@ VulkanDebugManager *VulkanReplay::GetDebugManager()
|
||||
return m_pDriver->GetDebugManager();
|
||||
}
|
||||
|
||||
VulkanResourceManager *VulkanReplay::GetResourceManager()
|
||||
{
|
||||
return m_pDriver->GetResourceManager();
|
||||
}
|
||||
|
||||
void VulkanReplay::Shutdown()
|
||||
{
|
||||
delete m_pDriver;
|
||||
@@ -1198,6 +1203,7 @@ uint64_t VulkanReplay::MakeOutputWindow(void *wn, bool depth)
|
||||
m_OutputWinID++;
|
||||
|
||||
m_OutputWindows[id].SetWindowHandle(wn);
|
||||
m_OutputWindows[id].m_ResourceManager = GetResourceManager();
|
||||
|
||||
if(wn != NULL)
|
||||
{
|
||||
|
||||
@@ -59,6 +59,7 @@ using std::map;
|
||||
|
||||
class WrappedVulkan;
|
||||
class VulkanDebugManager;
|
||||
class VulkanResourceManager;
|
||||
|
||||
class VulkanReplay : public IReplayDriver
|
||||
{
|
||||
@@ -200,6 +201,9 @@ class VulkanReplay : public IReplayDriver
|
||||
VkImageView dsview;
|
||||
VkImageMemoryBarrier depthtrans;
|
||||
VkImageMemoryBarrier stenciltrans;
|
||||
|
||||
VulkanResourceManager *GetResourceManager() { return m_ResourceManager; }
|
||||
VulkanResourceManager *m_ResourceManager;
|
||||
};
|
||||
|
||||
VulkanPipelineState m_VulkanPipelineState;
|
||||
@@ -220,4 +224,5 @@ class VulkanReplay : public IReplayDriver
|
||||
void FillCBufferVariables(rdctype::array<ShaderConstant>, vector<ShaderVariable> &outvars, const vector<byte> &data, size_t &offset);
|
||||
|
||||
VulkanDebugManager *GetDebugManager();
|
||||
VulkanResourceManager *GetResourceManager();
|
||||
};
|
||||
|
||||
@@ -545,8 +545,8 @@ bool WrappedVulkan::Serialise_vkCmdBeginRenderPass(
|
||||
m_PartialReplayData.renderPassActive = true;
|
||||
ObjDisp(cmdBuffer)->CmdBeginRenderPass(Unwrap(cmdBuffer), &beginInfo, cont);
|
||||
|
||||
m_PartialReplayData.state.renderPass = VKMGR()->GetNonDispWrapper(beginInfo.renderPass)->id;
|
||||
m_PartialReplayData.state.framebuffer = VKMGR()->GetNonDispWrapper(beginInfo.framebuffer)->id;
|
||||
m_PartialReplayData.state.renderPass = GetResourceManager()->GetNonDispWrapper(beginInfo.renderPass)->id;
|
||||
m_PartialReplayData.state.framebuffer = GetResourceManager()->GetNonDispWrapper(beginInfo.framebuffer)->id;
|
||||
m_PartialReplayData.state.renderArea = beginInfo.renderArea;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ bool WrappedVulkan::Serialise_vkCreateDescriptorSetLayout(
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), layout);
|
||||
GetResourceManager()->AddLiveResource(id, layout);
|
||||
|
||||
m_CreationInfo.m_DescSetLayout[live].Init(&info);
|
||||
m_CreationInfo.m_DescSetLayout[live].Init(GetResourceManager(), &info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,13 +180,13 @@ VkResult WrappedVulkan::vkCreateDescriptorSetLayout(
|
||||
record->AddChunk(chunk);
|
||||
|
||||
record->layout = new DescSetLayout();
|
||||
record->layout->Init(pCreateInfo);
|
||||
record->layout->Init(GetResourceManager(), pCreateInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, *pSetLayout);
|
||||
|
||||
m_CreationInfo.m_DescSetLayout[id].Init(&unwrappedInfo);
|
||||
m_CreationInfo.m_DescSetLayout[id].Init(GetResourceManager(), &unwrappedInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -312,7 +312,7 @@ bool WrappedVulkan::Serialise_vkCreateFramebuffer(
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), fb);
|
||||
GetResourceManager()->AddLiveResource(id, fb);
|
||||
|
||||
m_CreationInfo.m_Framebuffer[live].Init(&info);
|
||||
m_CreationInfo.m_Framebuffer[live].Init(GetResourceManager(), &info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ VkResult WrappedVulkan::vkCreateFramebuffer(
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, *pFramebuffer);
|
||||
|
||||
m_CreationInfo.m_Framebuffer[id].Init(&unwrappedInfo);
|
||||
m_CreationInfo.m_Framebuffer[id].Init(GetResourceManager(), &unwrappedInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ bool WrappedVulkan::Serialise_vkCreateRenderPass(
|
||||
VkRenderPass rp = VK_NULL_HANDLE;
|
||||
|
||||
VulkanCreationInfo::RenderPass rpinfo;
|
||||
rpinfo.Init(&info);
|
||||
rpinfo.Init(GetResourceManager(), &info);
|
||||
|
||||
// we want to store off the data so we can display it after the pass.
|
||||
// override any user-specified DONT_CARE.
|
||||
@@ -463,7 +463,7 @@ VkResult WrappedVulkan::vkCreateRenderPass(
|
||||
GetResourceManager()->AddLiveResource(id, *pRenderPass);
|
||||
|
||||
VulkanCreationInfo::RenderPass rpinfo;
|
||||
rpinfo.Init(pCreateInfo);
|
||||
rpinfo.Init(GetResourceManager(), pCreateInfo);
|
||||
|
||||
VkRenderPassCreateInfo info = *pCreateInfo;
|
||||
|
||||
|
||||
@@ -642,7 +642,7 @@ bool WrappedVulkan::Serialise_vkCreateBuffer(
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), buf);
|
||||
GetResourceManager()->AddLiveResource(id, buf);
|
||||
|
||||
m_CreationInfo.m_Buffer[live].Init(&info);
|
||||
m_CreationInfo.m_Buffer[live].Init(GetResourceManager(), &info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -680,7 +680,7 @@ VkResult WrappedVulkan::vkCreateBuffer(
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, *pBuffer);
|
||||
|
||||
m_CreationInfo.m_Buffer[id].Init(pCreateInfo);
|
||||
m_CreationInfo.m_Buffer[id].Init(GetResourceManager(), pCreateInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -713,7 +713,7 @@ bool WrappedVulkan::Serialise_vkCreateBufferView(
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), view);
|
||||
GetResourceManager()->AddLiveResource(id, view);
|
||||
|
||||
m_CreationInfo.m_BufferView[live].Init(&info);
|
||||
m_CreationInfo.m_BufferView[live].Init(GetResourceManager(), &info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -754,7 +754,7 @@ VkResult WrappedVulkan::vkCreateBufferView(
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, *pView);
|
||||
|
||||
m_CreationInfo.m_BufferView[id].Init(&unwrappedInfo);
|
||||
m_CreationInfo.m_BufferView[id].Init(GetResourceManager(), &unwrappedInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -794,7 +794,7 @@ bool WrappedVulkan::Serialise_vkCreateImage(
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), img);
|
||||
GetResourceManager()->AddLiveResource(id, img);
|
||||
|
||||
m_CreationInfo.m_Image[live].Init(&info);
|
||||
m_CreationInfo.m_Image[live].Init(GetResourceManager(), &info);
|
||||
|
||||
VkImageSubresourceRange range;
|
||||
range.baseMipLevel = range.baseArrayLayer = 0;
|
||||
@@ -852,7 +852,7 @@ VkResult WrappedVulkan::vkCreateImage(
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, *pImage);
|
||||
|
||||
m_CreationInfo.m_Image[id].Init(pCreateInfo);
|
||||
m_CreationInfo.m_Image[id].Init(GetResourceManager(), pCreateInfo);
|
||||
}
|
||||
|
||||
VkImageSubresourceRange range;
|
||||
@@ -908,7 +908,7 @@ bool WrappedVulkan::Serialise_vkCreateImageView(
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), view);
|
||||
GetResourceManager()->AddLiveResource(id, view);
|
||||
|
||||
m_CreationInfo.m_ImageView[live].Init(&info);
|
||||
m_CreationInfo.m_ImageView[live].Init(GetResourceManager(), &info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -949,7 +949,7 @@ VkResult WrappedVulkan::vkCreateImageView(
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, *pView);
|
||||
|
||||
m_CreationInfo.m_ImageView[id].Init(&unwrappedInfo);
|
||||
m_CreationInfo.m_ImageView[id].Init(GetResourceManager(), &unwrappedInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ bool WrappedVulkan::Serialise_vkCreatePipelineLayout(
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), layout);
|
||||
GetResourceManager()->AddLiveResource(id, layout);
|
||||
|
||||
m_CreationInfo.m_PipelineLayout[live].Init(&info);
|
||||
m_CreationInfo.m_PipelineLayout[live].Init(GetResourceManager(), &info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ VkResult WrappedVulkan::vkCreatePipelineLayout(
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, *pPipelineLayout);
|
||||
|
||||
m_CreationInfo.m_PipelineLayout[id].Init(&unwrappedInfo);
|
||||
m_CreationInfo.m_PipelineLayout[id].Init(GetResourceManager(), &unwrappedInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ bool WrappedVulkan::Serialise_vkCreateShaderModule(
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), sh);
|
||||
GetResourceManager()->AddLiveResource(id, sh);
|
||||
|
||||
m_CreationInfo.m_ShaderModule[live].Init(&info);
|
||||
m_CreationInfo.m_ShaderModule[live].Init(GetResourceManager(), &info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ VkResult WrappedVulkan::vkCreateShaderModule(
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, *pShaderModule);
|
||||
|
||||
m_CreationInfo.m_ShaderModule[id].Init(pCreateInfo);
|
||||
m_CreationInfo.m_ShaderModule[id].Init(GetResourceManager(), pCreateInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ bool WrappedVulkan::Serialise_vkCreateShader(
|
||||
GetResourceManager()->AddLiveResource(id, sh);
|
||||
|
||||
ResourceId moduleid = GetResourceManager()->GetNonDispWrapper(info.module)->id;
|
||||
m_CreationInfo.m_Shader[live].Init(&info, m_CreationInfo.m_ShaderModule[moduleid]);
|
||||
m_CreationInfo.m_Shader[live].Init(GetResourceManager(), &info, m_CreationInfo.m_ShaderModule[moduleid]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ VkResult WrappedVulkan::vkCreateShader(
|
||||
GetResourceManager()->AddLiveResource(id, *pShader);
|
||||
|
||||
ResourceId moduleid = GetResID(pCreateInfo->module);
|
||||
m_CreationInfo.m_Shader[id].Init(&unwrappedInfo, m_CreationInfo.m_ShaderModule[moduleid]);
|
||||
m_CreationInfo.m_Shader[id].Init(GetResourceManager(), &unwrappedInfo, m_CreationInfo.m_ShaderModule[moduleid]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ bool WrappedVulkan::Serialise_vkCreateGraphicsPipelines(
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), pipe);
|
||||
GetResourceManager()->AddLiveResource(id, pipe);
|
||||
|
||||
m_CreationInfo.m_Pipeline[live].Init(&info);
|
||||
m_CreationInfo.m_Pipeline[live].Init(GetResourceManager(), &info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,7 +438,7 @@ VkResult WrappedVulkan::vkCreateGraphicsPipelines(
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, pPipelines[i]);
|
||||
|
||||
m_CreationInfo.m_Pipeline[id].Init(&unwrappedInfos[i]);
|
||||
m_CreationInfo.m_Pipeline[id].Init(GetResourceManager(), &unwrappedInfos[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -477,7 +477,7 @@ bool WrappedVulkan::Serialise_vkCreateComputePipelines(
|
||||
ResourceId live = GetResourceManager()->WrapResource(Unwrap(device), pipe);
|
||||
GetResourceManager()->AddLiveResource(id, pipe);
|
||||
|
||||
m_CreationInfo.m_Pipeline[live].Init(&info);
|
||||
m_CreationInfo.m_Pipeline[live].Init(GetResourceManager(), &info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,7 +538,7 @@ VkResult WrappedVulkan::vkCreateComputePipelines(
|
||||
{
|
||||
GetResourceManager()->AddLiveResource(id, pPipelines[i]);
|
||||
|
||||
m_CreationInfo.m_Pipeline[id].Init(&unwrapped[i]);
|
||||
m_CreationInfo.m_Pipeline[id].Init(GetResourceManager(), &unwrapped[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -883,6 +883,8 @@ void Serialiser::Reset()
|
||||
m_ResolverThread = 0;
|
||||
}
|
||||
|
||||
m_pUserData = NULL;
|
||||
|
||||
m_DebugText = "";
|
||||
m_DebugTextWriting = false;
|
||||
|
||||
|
||||
@@ -198,6 +198,16 @@ class Serialiser
|
||||
//////////////////////////////////////////
|
||||
// Utility functions
|
||||
|
||||
void *GetUserData()
|
||||
{
|
||||
return m_pUserData;
|
||||
}
|
||||
|
||||
void SetUserData(void *userData)
|
||||
{
|
||||
m_pUserData = userData;
|
||||
}
|
||||
|
||||
bool AtEnd()
|
||||
{
|
||||
return GetOffset() >= m_BufferSize;
|
||||
@@ -651,6 +661,8 @@ class Serialiser
|
||||
bool m_HasError;
|
||||
bool m_DebugEnabled;
|
||||
|
||||
void *m_pUserData;
|
||||
|
||||
int m_Indent;
|
||||
|
||||
Callstack::Stackwalk *m_pCallstack;
|
||||
|
||||
Reference in New Issue
Block a user