MCPcopy Create free account
hub / github.com/baldurk/renderdoc / VulkanDebugManager

Method VulkanDebugManager

renderdoc/driver/vulkan/vk_debug.cpp:494–957  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492#define CREATE_OBJECT(obj, ...) create(driver, #obj, __LINE__, &obj, __VA_ARGS__)
493
494VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver)
495{
496 RenderDoc::Inst().RegisterMemoryRegion(this, sizeof(VulkanDebugManager));
497
498 m_pDriver = driver;
499
500 m_Device = m_pDriver->GetDev();
501 VkDevice dev = m_Device;
502
503 VulkanResourceManager *rm = driver->GetResourceManager();
504
505 VkResult vkr = VK_SUCCESS;
506
507 VulkanShaderCache *shaderCache = driver->GetShaderCache();
508
509 //////////////////////////////////////////////////////////////////
510 // Color MS <-> Buffer copy (via compute)
511
512 CREATE_OBJECT(m_BufferMSDescSetLayout,
513 {
514 {0, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 1, VK_SHADER_STAGE_ALL, NULL},
515 {1, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 1, VK_SHADER_STAGE_ALL, NULL},
516 {2, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, VK_SHADER_STAGE_ALL, NULL},
517 {3, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1, VK_SHADER_STAGE_ALL, NULL},
518 });
519
520 rm->SetInternalResource(GetResID(m_BufferMSDescSetLayout));
521
522 CREATE_OBJECT(m_BufferMSPipeLayout, m_BufferMSDescSetLayout, sizeof(Vec4u) * 2);
523
524 rm->SetInternalResource(GetResID(m_BufferMSPipeLayout));
525
526 CREATE_OBJECT(m_MS2BufferPipe, m_BufferMSPipeLayout,
527 shaderCache->GetBuiltinModule(BuiltinShader::MS2BufferCS));
528 CREATE_OBJECT(m_DepthMS2BufferPipe, m_BufferMSPipeLayout,
529 shaderCache->GetBuiltinModule(BuiltinShader::DepthMS2BufferCS));
530 CREATE_OBJECT(m_Buffer2MSPipe, m_BufferMSPipeLayout,
531 shaderCache->GetBuiltinModule(BuiltinShader::Buffer2MSCS));
532
533 rm->SetInternalResource(GetResID(m_MS2BufferPipe));
534 rm->SetInternalResource(GetResID(m_DepthMS2BufferPipe));
535 rm->SetInternalResource(GetResID(m_Buffer2MSPipe));
536
537 //////////////////////////////////////////////////////////////////
538 // Depth MS to Buffer copy (via compute)
539
540 // need a dummy float formatted texture but that's easy as we can pick something guaranteed by the
541 // spec
542 {
543 VkImageCreateInfo imInfo = {
544 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
545 NULL,
546 m_pDriver->DefaultImageCreateFlags(),
547 VK_IMAGE_TYPE_2D,
548 // format is required to be supported for sampling
549 VK_FORMAT_R8G8B8A8_UNORM,
550 {1, 1, 1},
551 1,

Callers

nothing calls this directly

Calls 15

ObjDispFunction · 0.85
IsStencilFormatFunction · 0.85
RDCMAXFunction · 0.85
DoPipelineBarrierFunction · 0.85
ToStrFunction · 0.85
GetDiscardPatternFunction · 0.85
DiscardTypeEnum · 0.85
FmtFunction · 0.85
GetBuiltinModuleMethod · 0.80

Tested by

no test coverage detected