removed codes about VkDebugMaker
This commit is contained in:
parent
4ee6962d04
commit
b781ff41a3
@ -298,12 +298,10 @@ public:
|
||||
return(nullptr);
|
||||
|
||||
#ifdef _DEBUG
|
||||
GPUDeviceAttribute *da=device->GetDeviceAttribute();
|
||||
DebugUtils *du=device->GetDebugUtils();
|
||||
|
||||
if(da->debug_maker)
|
||||
da->debug_maker->SetPipeline(*p,"[debug maker] Pipeline:"+p->GetName());
|
||||
if(da->debug_utils)
|
||||
da->debug_utils->SetPipeline(*p,"[debug utils] Pipeline:"+p->GetName());
|
||||
if(du)
|
||||
du->SetPipeline(*p,"Pipeline:"+p->GetName());
|
||||
#endif//_DEBUG
|
||||
|
||||
return p;
|
||||
|
@ -1,86 +0,0 @@
|
||||
#ifndef HGL_GRAPH_VULKAN_DEBUG_MAKER_INCLUDE
|
||||
#define HGL_GRAPH_VULKAN_DEBUG_MAKER_INCLUDE
|
||||
|
||||
#include<hgl/graph/VK.h>
|
||||
#include<hgl/color/Color4f.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
struct DebugMakerFunction
|
||||
{
|
||||
PFN_vkDebugMarkerSetObjectTagEXT SetObjectTag;
|
||||
PFN_vkDebugMarkerSetObjectNameEXT SetObjectName;
|
||||
PFN_vkCmdDebugMarkerBeginEXT Begin;
|
||||
PFN_vkCmdDebugMarkerEndEXT End;
|
||||
PFN_vkCmdDebugMarkerInsertEXT Insert;
|
||||
};//struct DebugMakerFunction
|
||||
|
||||
class DebugMaker
|
||||
{
|
||||
VkDevice device;
|
||||
|
||||
DebugMakerFunction dmf;
|
||||
|
||||
protected:
|
||||
|
||||
void SetObjectName(uint64_t object, VkDebugReportObjectTypeEXT objectType, const char *name);
|
||||
void SetObjectTag(uint64_t object, VkDebugReportObjectTypeEXT objectType, uint64_t name, size_t tagSize, const void* tag);
|
||||
|
||||
private:
|
||||
|
||||
friend DebugMaker *CreateDebugMaker(VkDevice device);
|
||||
|
||||
DebugMaker(VkDevice dev,const DebugMakerFunction &f)
|
||||
{
|
||||
device=dev;
|
||||
dmf=f;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
void Begin(VkCommandBuffer cmdbuffer, const char * pMarkerName, const Color4f &color);
|
||||
void Insert(VkCommandBuffer cmdbuffer, const char *markerName, const Color4f &color);
|
||||
void End(VkCommandBuffer cmdBuffer);
|
||||
|
||||
#define DEBUG_MAKER_SET_FUNC(type,MNAME) void Set##type(Vk##type obj,const char *name){SetObjectName((uint64_t)obj,VK_DEBUG_REPORT_OBJECT_TYPE_##MNAME##_EXT,name);}
|
||||
|
||||
DEBUG_MAKER_SET_FUNC(Instance, INSTANCE)
|
||||
DEBUG_MAKER_SET_FUNC(PhysicalDevice, PHYSICAL_DEVICE)
|
||||
DEBUG_MAKER_SET_FUNC(Device, DEVICE)
|
||||
DEBUG_MAKER_SET_FUNC(Queue, QUEUE)
|
||||
DEBUG_MAKER_SET_FUNC(Semaphore, SEMAPHORE)
|
||||
DEBUG_MAKER_SET_FUNC(CommandBuffer, COMMAND_BUFFER)
|
||||
DEBUG_MAKER_SET_FUNC(Fence, FENCE)
|
||||
DEBUG_MAKER_SET_FUNC(DeviceMemory, DEVICE_MEMORY)
|
||||
DEBUG_MAKER_SET_FUNC(Buffer, BUFFER)
|
||||
DEBUG_MAKER_SET_FUNC(Image, IMAGE)
|
||||
DEBUG_MAKER_SET_FUNC(Event, EVENT)
|
||||
DEBUG_MAKER_SET_FUNC(QueryPool, QUERY_POOL)
|
||||
DEBUG_MAKER_SET_FUNC(BufferView, BUFFER_VIEW)
|
||||
DEBUG_MAKER_SET_FUNC(ShaderModule, SHADER_MODULE)
|
||||
DEBUG_MAKER_SET_FUNC(PipelineCache, PIPELINE_CACHE)
|
||||
DEBUG_MAKER_SET_FUNC(PipelineLayout, PIPELINE_LAYOUT)
|
||||
DEBUG_MAKER_SET_FUNC(RenderPass, RENDER_PASS)
|
||||
DEBUG_MAKER_SET_FUNC(Pipeline, PIPELINE)
|
||||
DEBUG_MAKER_SET_FUNC(DescriptorSetLayout, DESCRIPTOR_SET_LAYOUT)
|
||||
DEBUG_MAKER_SET_FUNC(Sampler, SAMPLER)
|
||||
DEBUG_MAKER_SET_FUNC(DescriptorPool, DESCRIPTOR_POOL)
|
||||
DEBUG_MAKER_SET_FUNC(DescriptorSet, DESCRIPTOR_SET)
|
||||
DEBUG_MAKER_SET_FUNC(Framebuffer, FRAMEBUFFER)
|
||||
DEBUG_MAKER_SET_FUNC(CommandPool, COMMAND_POOL)
|
||||
DEBUG_MAKER_SET_FUNC(SurfaceKHR, SURFACE_KHR)
|
||||
DEBUG_MAKER_SET_FUNC(SwapchainKHR, SWAPCHAIN_KHR)
|
||||
DEBUG_MAKER_SET_FUNC(DebugReportCallbackEXT, DEBUG_REPORT_CALLBACK_EXT)
|
||||
DEBUG_MAKER_SET_FUNC(DisplayKHR, DISPLAY_KHR)
|
||||
DEBUG_MAKER_SET_FUNC(DisplayModeKHR, DISPLAY_MODE_KHR)
|
||||
DEBUG_MAKER_SET_FUNC(ValidationCacheEXT, VALIDATION_CACHE_EXT)
|
||||
DEBUG_MAKER_SET_FUNC(SamplerYcbcrConversion, SAMPLER_YCBCR_CONVERSION)
|
||||
DEBUG_MAKER_SET_FUNC(DescriptorUpdateTemplate, DESCRIPTOR_UPDATE_TEMPLATE)
|
||||
DEBUG_MAKER_SET_FUNC(CuModuleNVX, CU_MODULE_NVX)
|
||||
DEBUG_MAKER_SET_FUNC(CuFunctionNVX, CU_FUNCTION_NVX)
|
||||
DEBUG_MAKER_SET_FUNC(AccelerationStructureKHR, ACCELERATION_STRUCTURE_KHR)
|
||||
DEBUG_MAKER_SET_FUNC(AccelerationStructureNV, ACCELERATION_STRUCTURE_NV)
|
||||
|
||||
#undef DEBUG_MAKER_SET_FUNC
|
||||
};//class DebugMaker
|
||||
VK_NAMESPACE_END
|
||||
#endif//HGL_GRAPH_VULKAN_DEBUG_MAKER_INCLUDE
|
@ -85,6 +85,8 @@ public:
|
||||
|
||||
void WaitIdle ()const {vkDeviceWaitIdle(attr->device);}
|
||||
|
||||
DebugUtils * GetDebugUtils (){return attr->debug_utils;}
|
||||
|
||||
public:
|
||||
|
||||
bool Resize (const VkExtent2D &);
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include<hgl/graph/VKTexture.h>
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include<hgl/graph/VKDebugMaker.h>
|
||||
#include<hgl/graph/VKDebugUtils.h>
|
||||
#endif//_DEBUG
|
||||
|
||||
@ -48,7 +47,6 @@ struct GPUDeviceAttribute
|
||||
VkPipelineCache pipeline_cache =VK_NULL_HANDLE;
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugMaker * debug_maker =nullptr;
|
||||
DebugUtils * debug_utils =nullptr;
|
||||
#endif//_DEBUG
|
||||
|
||||
|
@ -106,10 +106,8 @@ SET(VK_INST_SOURCE ${SG_INCLUDE_PATH}/VKInstance.h
|
||||
Vulkan/VKInstance.cpp)
|
||||
|
||||
SET(VK_DEBUG_SOURCE ${SG_INCLUDE_PATH}/VKDebugOut.h
|
||||
${SG_INCLUDE_PATH}/VKDebugMaker.h
|
||||
${SG_INCLUDE_PATH}/VKDebugUtils.h
|
||||
Vulkan/Debug/VKDebugOut.cpp
|
||||
Vulkan/Debug/VKDebugMaker.cpp
|
||||
Vulkan/Debug/VKDebugUtils.cpp)
|
||||
|
||||
SET(VK_MEMORY_SOURCE ${SG_INCLUDE_PATH}/VKMemory.h
|
||||
|
@ -66,36 +66,21 @@ void RenderAssignBuffer::Alloc(const uint nc,const uint mc)
|
||||
vbo_assigns=device->CreateVBO(ASSIGN_VBO_FMT,node_count);
|
||||
|
||||
#ifdef _DEBUG
|
||||
GPUDeviceAttribute *da=device->GetDeviceAttribute();
|
||||
DebugUtils *du=device->GetDebugUtils();
|
||||
|
||||
if(da->debug_maker)
|
||||
if(du)
|
||||
{
|
||||
da->debug_maker->SetBuffer(ubo_l2w->GetBuffer(),"[debug maker] UBO:Buffer:LocalToWorld");
|
||||
da->debug_maker->SetDeviceMemory(ubo_l2w->GetVkMemory(),"[debug maker] UBO:Memory:LocalToWorld");
|
||||
du->SetBuffer(ubo_l2w->GetBuffer(),"UBO:Buffer:LocalToWorld");
|
||||
du->SetDeviceMemory(ubo_l2w->GetVkMemory(),"UBO:Memory:LocalToWorld");
|
||||
|
||||
if(ubo_mi)
|
||||
{
|
||||
da->debug_maker->SetBuffer(ubo_mi->GetBuffer(),"[debug maker] UBO:Buffer:MaterialInstance");
|
||||
da->debug_maker->SetDeviceMemory(ubo_mi->GetVkMemory(),"[debug maker] UBO:Memory:MaterialInstance");
|
||||
du->SetBuffer(ubo_mi->GetBuffer(),"UBO:Buffer:MaterialInstance");
|
||||
du->SetDeviceMemory(ubo_mi->GetVkMemory(),"UBO:Memory:MaterialInstance");
|
||||
}
|
||||
|
||||
da->debug_maker->SetBuffer(vbo_assigns->GetBuffer(),"[debug maker] VBO:Buffer:Assign");
|
||||
da->debug_maker->SetDeviceMemory(vbo_assigns->GetVkMemory(),"[debug maker] VBO:Memory:Assign");
|
||||
}
|
||||
|
||||
if(da->debug_utils)
|
||||
{
|
||||
da->debug_utils->SetBuffer(ubo_l2w->GetBuffer(),"[debug utils] UBO:Buffer:LocalToWorld");
|
||||
da->debug_utils->SetDeviceMemory(ubo_l2w->GetVkMemory(),"[debug utils] UBO:Memory:LocalToWorld");
|
||||
|
||||
if(ubo_mi)
|
||||
{
|
||||
da->debug_utils->SetBuffer(ubo_mi->GetBuffer(),"[debug utils] UBO:Buffer:MaterialInstance");
|
||||
da->debug_utils->SetDeviceMemory(ubo_mi->GetVkMemory(),"[debug utils] UBO:Memory:MaterialInstance");
|
||||
}
|
||||
|
||||
da->debug_utils->SetBuffer(vbo_assigns->GetBuffer(),"[debug utils] VBO:Buffer:Assign");
|
||||
da->debug_utils->SetDeviceMemory(vbo_assigns->GetVkMemory(),"[debug utils] VBO:Memory:Assign");
|
||||
du->SetBuffer(vbo_assigns->GetBuffer(),"VBO:Buffer:Assign");
|
||||
du->SetDeviceMemory(vbo_assigns->GetVkMemory(),"VBO:Memory:Assign");
|
||||
}
|
||||
#endif//_DEBUG
|
||||
}
|
||||
|
@ -1,86 +0,0 @@
|
||||
#include<hgl/graph/VKDebugMaker.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
void DebugMaker::SetObjectName(uint64_t object, VkDebugReportObjectTypeEXT objectType, const char *name)
|
||||
{
|
||||
// Check for valid function pointer (may not be present if not running in a debugging application)
|
||||
if(!dmf.SetObjectName)return;
|
||||
|
||||
VkDebugMarkerObjectNameInfoEXT nameInfo = {};
|
||||
nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT;
|
||||
nameInfo.objectType = objectType;
|
||||
nameInfo.object = object;
|
||||
nameInfo.pObjectName = name;
|
||||
|
||||
dmf.SetObjectName(device, &nameInfo);
|
||||
}
|
||||
|
||||
void DebugMaker::SetObjectTag(uint64_t object, VkDebugReportObjectTypeEXT objectType, uint64_t name, size_t tagSize, const void* tag)
|
||||
{
|
||||
// Check for valid function pointer (may not be present if not running in a debugging application)
|
||||
if(!dmf.SetObjectTag)return;
|
||||
|
||||
VkDebugMarkerObjectTagInfoEXT tagInfo = {};
|
||||
tagInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT;
|
||||
tagInfo.objectType = objectType;
|
||||
tagInfo.object = object;
|
||||
tagInfo.tagName = name;
|
||||
tagInfo.tagSize = tagSize;
|
||||
tagInfo.pTag = tag;
|
||||
|
||||
dmf.SetObjectTag(device, &tagInfo);
|
||||
}
|
||||
|
||||
void DebugMaker::Begin(VkCommandBuffer cmdbuffer, const char * pMarkerName, const Color4f &color)
|
||||
{
|
||||
//Check for valid function pointer (may not be present if not running in a debugging application)
|
||||
if(!dmf.Begin)return;
|
||||
|
||||
VkDebugMarkerMarkerInfoEXT markerInfo = {};
|
||||
markerInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT;
|
||||
memcpy(markerInfo.color, &color, sizeof(float) * 4);
|
||||
markerInfo.pMarkerName = pMarkerName;
|
||||
|
||||
dmf.Begin(cmdbuffer, &markerInfo);
|
||||
}
|
||||
|
||||
void DebugMaker::Insert(VkCommandBuffer cmdbuffer, const char *markerName, const Color4f &color)
|
||||
{
|
||||
// Check for valid function pointer (may not be present if not running in a debugging application)
|
||||
if(!dmf.Insert)return;
|
||||
|
||||
VkDebugMarkerMarkerInfoEXT markerInfo = {};
|
||||
markerInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT;
|
||||
memcpy(markerInfo.color, &color, sizeof(float) * 4);
|
||||
markerInfo.pMarkerName = markerName;
|
||||
|
||||
dmf.Insert(cmdbuffer, &markerInfo);
|
||||
}
|
||||
|
||||
void DebugMaker::End(VkCommandBuffer cmdBuffer)
|
||||
{
|
||||
// Check for valid function (may not be present if not running in a debugging application)
|
||||
if(!dmf.End)return;
|
||||
|
||||
dmf.End(cmdBuffer);
|
||||
}
|
||||
|
||||
DebugMaker *CreateDebugMaker(VkDevice device)
|
||||
{
|
||||
DebugMakerFunction dmf;
|
||||
|
||||
dmf.SetObjectTag = reinterpret_cast<PFN_vkDebugMarkerSetObjectTagEXT >(vkGetDeviceProcAddr(device, "vkDebugMarkerSetObjectTagEXT"));
|
||||
dmf.SetObjectName = reinterpret_cast<PFN_vkDebugMarkerSetObjectNameEXT>(vkGetDeviceProcAddr(device, "vkDebugMarkerSetObjectNameEXT"));
|
||||
dmf.Begin = reinterpret_cast<PFN_vkCmdDebugMarkerBeginEXT >(vkGetDeviceProcAddr(device, "vkCmdDebugMarkerBeginEXT"));
|
||||
dmf.End = reinterpret_cast<PFN_vkCmdDebugMarkerEndEXT >(vkGetDeviceProcAddr(device, "vkCmdDebugMarkerEndEXT"));
|
||||
dmf.Insert = reinterpret_cast<PFN_vkCmdDebugMarkerInsertEXT >(vkGetDeviceProcAddr(device, "vkCmdDebugMarkerInsertEXT"));
|
||||
|
||||
if(!dmf.SetObjectTag )return(nullptr);
|
||||
if(!dmf.SetObjectName )return(nullptr);
|
||||
if(!dmf.Begin )return(nullptr);
|
||||
if(!dmf.End )return(nullptr);
|
||||
if(!dmf.Insert )return(nullptr);
|
||||
|
||||
return(new DebugMaker(device,dmf));
|
||||
}
|
||||
VK_NAMESPACE_END
|
@ -28,27 +28,18 @@ bool GPUCmdBuffer::Begin()
|
||||
#ifdef _DEBUG
|
||||
void GPUCmdBuffer::SetDebugName(const UTF8String &object_name)
|
||||
{
|
||||
if(dev_attr->debug_maker)
|
||||
dev_attr->debug_maker->SetCommandBuffer(cmd_buf,"[debug_maker]"+object_name);
|
||||
|
||||
if(dev_attr->debug_utils)
|
||||
dev_attr->debug_utils->SetCommandBuffer(cmd_buf,"[debug_utils]"+object_name);
|
||||
dev_attr->debug_utils->SetCommandBuffer(cmd_buf,object_name);
|
||||
}
|
||||
|
||||
void GPUCmdBuffer::BeginRegion(const UTF8String ®ion_name,const Color4f &color)
|
||||
{
|
||||
if(dev_attr->debug_maker)
|
||||
dev_attr->debug_maker->Begin(cmd_buf,"[debug_maker]"+region_name,color);
|
||||
|
||||
if(dev_attr->debug_utils)
|
||||
dev_attr->debug_utils->CmdBegin(cmd_buf,"[debug_utils]"+region_name,color);
|
||||
dev_attr->debug_utils->CmdBegin(cmd_buf,region_name,color);
|
||||
}
|
||||
|
||||
void GPUCmdBuffer::EndRegion()
|
||||
{
|
||||
if(dev_attr->debug_maker)
|
||||
dev_attr->debug_maker->End(cmd_buf);
|
||||
|
||||
if(dev_attr->debug_utils)
|
||||
dev_attr->debug_utils->CmdEnd(cmd_buf);
|
||||
}
|
||||
|
@ -69,13 +69,8 @@ VkCommandBuffer GPUDevice::CreateCommandBuffer(const AnsiString &name)
|
||||
return(VK_NULL_HANDLE);
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(attr->debug_maker)
|
||||
attr->debug_maker->SetCommandBuffer(cmd_buf,"[debug maker] "+name);
|
||||
|
||||
if(attr->debug_utils)
|
||||
attr->debug_utils->SetCommandBuffer(cmd_buf,"[debug utils] "+name);
|
||||
|
||||
attr->debug_utils->SetCommandBuffer(cmd_buf,name);
|
||||
#endif//_DEBUG
|
||||
|
||||
return cmd_buf;
|
||||
|
@ -21,8 +21,6 @@ GPUDeviceAttribute::GPUDeviceAttribute(VulkanInstance *inst,const GPUPhysicalDev
|
||||
GPUDeviceAttribute::~GPUDeviceAttribute()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if(debug_maker)
|
||||
delete debug_maker;
|
||||
if(debug_utils)
|
||||
delete debug_utils;
|
||||
#endif//_DEBUG
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include<hgl/graph/VKTexture.h>
|
||||
#include<hgl/graph/VKDeviceCreater.h>
|
||||
#include<hgl/graph/VKDevice.h>
|
||||
#include<hgl/graph/VKDebugMaker.h>
|
||||
|
||||
#include<iostream>
|
||||
#include<iomanip>
|
||||
@ -18,7 +17,6 @@ VkPipelineCache CreatePipelineCache(VkDevice device,const VkPhysicalDeviceProper
|
||||
void SetShaderCompilerVersion(const GPUPhysicalDevice *);
|
||||
|
||||
#ifdef _DEBUG
|
||||
DebugMaker *CreateDebugMaker(VkDevice);
|
||||
DebugUtils *CreateDebugUtils(VkDevice);
|
||||
|
||||
void LogSurfaceFormat(const VkSurfaceFormatKHR *surface_format_list,const uint32_t format_count,const uint32_t select)
|
||||
@ -293,11 +291,6 @@ GPUDevice *VulkanDeviceCreater::CreateRenderDevice()
|
||||
if(!device_attr->device)
|
||||
return(nullptr);
|
||||
|
||||
#ifdef _DEBUG
|
||||
device_attr->debug_maker=CreateDebugMaker(device_attr->device);
|
||||
device_attr->debug_utils=CreateDebugUtils(device_attr->device);
|
||||
#endif//_DEBUG
|
||||
|
||||
ChooseSurfaceFormat();
|
||||
|
||||
device_attr->surface_format=surface_format;
|
||||
@ -322,24 +315,16 @@ GPUDevice *VulkanDeviceCreater::CreateRenderDevice()
|
||||
auto_delete.Discard(); //discard autodelete
|
||||
|
||||
#ifdef _DEBUG
|
||||
if(device_attr->debug_maker)
|
||||
{
|
||||
device_attr->debug_maker->SetPhysicalDevice(*physical_device,"[debug maker] Physical Device:"+AnsiString(physical_device->GetDeviceName()));
|
||||
device_attr->debug_maker->SetDevice(device_attr->device,"[debug maker] Device:"+AnsiString(physical_device->GetDeviceName()));
|
||||
device_attr->debug_maker->SetSurfaceKHR(surface,"[debug maker] Surface");
|
||||
device_attr->debug_maker->SetCommandPool(device_attr->cmd_pool,"[debug maker] Main Command Pool");
|
||||
device_attr->debug_maker->SetDescriptorPool(device_attr->desc_pool,"[debug maker] Main Descriptor Pool");
|
||||
device_attr->debug_maker->SetPipelineCache(device_attr->pipeline_cache,"[debug maker] Main Pipeline Cache");
|
||||
}
|
||||
device_attr->debug_utils=CreateDebugUtils(device_attr->device);
|
||||
|
||||
if(device_attr->debug_utils)
|
||||
{
|
||||
device_attr->debug_utils->SetPhysicalDevice(*physical_device,"[debug utils] Physical Device:"+AnsiString(physical_device->GetDeviceName()));
|
||||
device_attr->debug_utils->SetDevice(device_attr->device,"[debug utils] Device:"+AnsiString(physical_device->GetDeviceName()));
|
||||
device_attr->debug_utils->SetSurfaceKHR(surface,"[debug utils] Surface");
|
||||
device_attr->debug_utils->SetCommandPool(device_attr->cmd_pool,"[debug utils] Main Command Pool");
|
||||
device_attr->debug_utils->SetDescriptorPool(device_attr->desc_pool,"[debug utils] Main Descriptor Pool");
|
||||
device_attr->debug_utils->SetPipelineCache(device_attr->pipeline_cache,"[debug utils] Main Pipeline Cache");
|
||||
device_attr->debug_utils->SetPhysicalDevice(*physical_device,"Physical Device:"+AnsiString(physical_device->GetDeviceName()));
|
||||
device_attr->debug_utils->SetDevice(device_attr->device,"Device:"+AnsiString(physical_device->GetDeviceName()));
|
||||
device_attr->debug_utils->SetSurfaceKHR(surface,"Surface");
|
||||
device_attr->debug_utils->SetCommandPool(device_attr->cmd_pool,"Main Command Pool");
|
||||
device_attr->debug_utils->SetDescriptorPool(device_attr->desc_pool,"Main Descriptor Pool");
|
||||
device_attr->debug_utils->SetPipelineCache(device_attr->pipeline_cache,"Main Pipeline Cache");
|
||||
}
|
||||
#endif//_DEBUG
|
||||
|
||||
|
@ -13,10 +13,8 @@ void GPUDevice::InitRenderPassManage()
|
||||
device_render_pass=render_pass_manage->AcquireRenderPass(&rbi);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if(attr->debug_maker)
|
||||
attr->debug_maker->SetRenderPass(device_render_pass->GetVkRenderPass(),"[debug maker] MainDeviceRenderPass");
|
||||
if(attr->debug_utils)
|
||||
attr->debug_utils->SetRenderPass(device_render_pass->GetVkRenderPass(),"[debug utils] MainDeviceRenderPass");
|
||||
attr->debug_utils->SetRenderPass(device_render_pass->GetVkRenderPass(),"MainDeviceRenderPass");
|
||||
#endif//_DEBUG
|
||||
}
|
||||
|
||||
|
@ -74,11 +74,8 @@ namespace
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
if(dev_attr->debug_maker)
|
||||
dev_attr->debug_maker->SetSwapchainKHR(swap_chain,"[debug maker] SwapChain");
|
||||
|
||||
if(dev_attr->debug_utils)
|
||||
dev_attr->debug_utils->SetSwapchainKHR(swap_chain,"[debug utils] SwapChain");
|
||||
dev_attr->debug_utils->SetSwapchainKHR(swap_chain,"SwapChain");
|
||||
#endif//_DEBUG
|
||||
|
||||
return(swap_chain);
|
||||
@ -101,17 +98,11 @@ bool GPUDevice::CreateSwapchainFBO(Swapchain *swapchain)
|
||||
return(false);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if(attr->debug_maker)
|
||||
{
|
||||
attr->debug_maker->SetImage(swapchain->sc_depth->GetImage(),"[debug maker] SwapchainDepthImage");
|
||||
attr->debug_maker->SetDeviceMemory(swapchain->sc_depth->GetDeviceMemory(),"[debug maker] SwapchainDepthMemory");
|
||||
}
|
||||
|
||||
if(attr->debug_utils)
|
||||
{
|
||||
attr->debug_utils->SetImage(swapchain->sc_depth->GetImage(),"[debug utils] SwapchainDepthImage");
|
||||
attr->debug_utils->SetImageView(swapchain->sc_depth->GetVulkanImageView(),"[debug utils] SwapchainDepthImageView");
|
||||
attr->debug_utils->SetDeviceMemory(swapchain->sc_depth->GetDeviceMemory(),"[debug utils] SwapchainDepthMemory");
|
||||
attr->debug_utils->SetImage(swapchain->sc_depth->GetImage(),"SwapchainDepthImage");
|
||||
attr->debug_utils->SetImageView(swapchain->sc_depth->GetVulkanImageView(),"SwapchainDepthImageView");
|
||||
attr->debug_utils->SetDeviceMemory(swapchain->sc_depth->GetDeviceMemory(),"SwapchainDepthMemory");
|
||||
}
|
||||
#endif//_DEBUG
|
||||
|
||||
@ -130,21 +121,13 @@ bool GPUDevice::CreateSwapchainFBO(Swapchain *swapchain)
|
||||
swapchain->sc_depth->GetImageView());
|
||||
|
||||
#ifdef _DEBUG
|
||||
if(attr->debug_maker)
|
||||
{
|
||||
attr->debug_maker->SetImage(swapchain->sc_color[i]->GetImage(),"[debug maker] SwapchainColorImage_"+AnsiString::numberOf(i));
|
||||
attr->debug_maker->SetDeviceMemory(swapchain->sc_color[i]->GetDeviceMemory(),"[debug maker] SwapchainColorMemory_"+AnsiString::numberOf(i));
|
||||
|
||||
attr->debug_maker->SetFramebuffer(swapchain->sc_fbo[i]->GetFramebuffer(),"[debug maker] SwapchainFBO_"+AnsiString::numberOf(i));
|
||||
}
|
||||
|
||||
if(attr->debug_utils)
|
||||
{
|
||||
attr->debug_utils->SetImage(swapchain->sc_color[i]->GetImage(),"[debug utils] SwapchainColorImage_"+AnsiString::numberOf(i));
|
||||
attr->debug_utils->SetImageView(swapchain->sc_color[i]->GetVulkanImageView(),"[debug utils] SwapchainColorImageView_"+AnsiString::numberOf(i));
|
||||
attr->debug_utils->SetDeviceMemory(swapchain->sc_color[i]->GetDeviceMemory(),"[debug utils] SwapchainColorMemory_"+AnsiString::numberOf(i));
|
||||
attr->debug_utils->SetImage(swapchain->sc_color[i]->GetImage(),"SwapchainColorImage_"+AnsiString::numberOf(i));
|
||||
attr->debug_utils->SetImageView(swapchain->sc_color[i]->GetVulkanImageView(),"SwapchainColorImageView_"+AnsiString::numberOf(i));
|
||||
attr->debug_utils->SetDeviceMemory(swapchain->sc_color[i]->GetDeviceMemory(),"SwapchainColorMemory_"+AnsiString::numberOf(i));
|
||||
|
||||
attr->debug_utils->SetFramebuffer(swapchain->sc_fbo[i]->GetFramebuffer(),"[debug utils] SwapchainFBO_"+AnsiString::numberOf(i));
|
||||
attr->debug_utils->SetFramebuffer(swapchain->sc_fbo[i]->GetFramebuffer(),"SwapchainFBO_"+AnsiString::numberOf(i));
|
||||
}
|
||||
#endif//_DEBUG
|
||||
}
|
||||
|
@ -40,18 +40,12 @@ bool Primitive::Set(const AnsiString &name,VBO *vbo,VkDeviceSize offset)
|
||||
buffer_list.Add(name,bd);
|
||||
|
||||
#ifdef _DEBUG
|
||||
auto *da=device->GetDeviceAttribute();
|
||||
DebugUtils *du=device->GetDebugUtils();
|
||||
|
||||
if(da->debug_maker)
|
||||
if(du)
|
||||
{
|
||||
da->debug_maker->SetBuffer(vbo->GetBuffer(),"[debug maker] "+prim_name+":VBO:Buffer:"+name);
|
||||
da->debug_maker->SetDeviceMemory(vbo->GetVkMemory(),"[debug maker] "+prim_name+":VBO:Memory:"+name);
|
||||
}
|
||||
|
||||
if(da->debug_utils)
|
||||
{
|
||||
da->debug_utils->SetBuffer(vbo->GetBuffer(),"[debug utils] "+prim_name+":VBO:Buffer:"+name);
|
||||
da->debug_utils->SetDeviceMemory(vbo->GetVkMemory(),"[debug utils] "+prim_name+":VBO:Memory:"+name);
|
||||
du->SetBuffer(vbo->GetBuffer(),prim_name+":VBO:Buffer:"+name);
|
||||
du->SetDeviceMemory(vbo->GetVkMemory(),prim_name+":VBO:Memory:"+name);
|
||||
}
|
||||
#endif//_DEBUG
|
||||
|
||||
@ -91,18 +85,12 @@ bool Primitive::Set(IndexBuffer *ib,VkDeviceSize offset)
|
||||
index_buffer_data.offset=offset;
|
||||
|
||||
#ifdef _DEBUG
|
||||
auto *da=device->GetDeviceAttribute();
|
||||
DebugUtils *du=device->GetDebugUtils();
|
||||
|
||||
if(da->debug_maker)
|
||||
if(du)
|
||||
{
|
||||
da->debug_maker->SetBuffer(ib->GetBuffer(),"[debug maker] "+prim_name+":IBO:Buffer");
|
||||
da->debug_maker->SetDeviceMemory(ib->GetVkMemory(),"[debug maker] "+prim_name+":IBO:Memory");
|
||||
}
|
||||
|
||||
if(da->debug_utils)
|
||||
{
|
||||
da->debug_utils->SetBuffer(ib->GetBuffer(),"[debug utils] "+prim_name+":IBO:Buffer");
|
||||
da->debug_utils->SetDeviceMemory(ib->GetVkMemory(),"[debug utils] "+prim_name+":IBO:Memory");
|
||||
du->SetBuffer(ib->GetBuffer(),prim_name+":IBO:Buffer");
|
||||
du->SetDeviceMemory(ib->GetVkMemory(),prim_name+":IBO:Memory");
|
||||
}
|
||||
#endif//_DEBUG
|
||||
return(true);
|
||||
|
@ -150,13 +150,14 @@ Texture2D *RenderResource::LoadTexture2D(const OSString &filename,bool auto_mipm
|
||||
Add(tex);
|
||||
|
||||
#ifdef _DEBUG
|
||||
GPUDeviceAttribute *da=device->GetDeviceAttribute();
|
||||
const UTF8String name=ToUTF8String(filename);
|
||||
DebugUtils *du=device->GetDebugUtils();
|
||||
|
||||
if(du)
|
||||
{
|
||||
const UTF8String name=ToUTF8String(filename);
|
||||
|
||||
if(da->debug_maker)
|
||||
da->debug_maker->SetImage(tex->GetImage(),"[debug maker] Tex2D:"+name);
|
||||
if(da->debug_utils)
|
||||
da->debug_utils->SetImage(tex->GetImage(),"[debug utils] Tex2D:"+name);
|
||||
du->SetImage(tex->GetImage(),"Tex2D:"+name);
|
||||
}
|
||||
#endif//_DEBUG
|
||||
}
|
||||
|
||||
@ -171,19 +172,13 @@ Texture2DArray *RenderResource::CreateTexture2DArray(const AnsiString &name,cons
|
||||
Add(ta);
|
||||
|
||||
#ifdef _DEBUG
|
||||
GPUDeviceAttribute *da=device->GetDeviceAttribute();
|
||||
DebugUtils *du=device->GetDebugUtils();
|
||||
|
||||
if(da->debug_maker)
|
||||
if(du)
|
||||
{
|
||||
da->debug_maker->SetImage(ta->GetImage(),"[debug maker] Tex2DArrayImage:"+name);
|
||||
da->debug_maker->SetDeviceMemory(ta->GetDeviceMemory(),"[debug maker] Tex2DArrayMemory:"+name);
|
||||
}
|
||||
|
||||
if(da->debug_utils)
|
||||
{
|
||||
da->debug_utils->SetImage(ta->GetImage(),"[debug utils] Tex2DArrayImage:"+name);
|
||||
da->debug_utils->SetImageView(ta->GetVulkanImageView(),"[debug utils] Tex2DArrayImageView:"+name);
|
||||
da->debug_utils->SetDeviceMemory(ta->GetDeviceMemory(),"[debug utils] Tex2DArrayMemory:"+name);
|
||||
du->SetImage(ta->GetImage(),"Tex2DArrayImage:"+name);
|
||||
du->SetImageView(ta->GetVulkanImageView(),"Tex2DArrayImageView:"+name);
|
||||
du->SetDeviceMemory(ta->GetDeviceMemory(),"Tex2DArrayMemory:"+name);
|
||||
}
|
||||
#endif//_DEBUG
|
||||
|
||||
|
@ -65,13 +65,10 @@ const ShaderModule *RenderResource::CreateShaderModule(const AnsiString &sm_name
|
||||
|
||||
#ifdef _DEBUG
|
||||
{
|
||||
auto da=device->GetDeviceAttribute();
|
||||
DebugUtils *du=device->GetDebugUtils();
|
||||
|
||||
if(da->debug_maker)
|
||||
da->debug_maker->SetShaderModule(*sm,"[debug maker] Shader:"+sm_name+AnsiString(":")+GetShaderStageName(sci->GetShaderStage()));
|
||||
|
||||
if(da->debug_utils)
|
||||
da->debug_utils->SetShaderModule(*sm,"[debug utils] Shader:"+sm_name+AnsiString(":")+GetShaderStageName(sci->GetShaderStage()));
|
||||
if(du)
|
||||
du->SetShaderModule(*sm,"Shader:"+sm_name+AnsiString(":")+GetShaderStageName(sci->GetShaderStage()));
|
||||
}
|
||||
#endif//_DEBUG
|
||||
|
||||
@ -140,12 +137,10 @@ Material *RenderResource::CreateMaterial(const mtl::MaterialCreateInfo *mci)
|
||||
mtl->pipeline_layout_data=device->CreatePipelineLayoutData(mtl->desc_manager);
|
||||
|
||||
#ifdef _DEBUG
|
||||
GPUDeviceAttribute *da=device->GetDeviceAttribute();
|
||||
DebugUtils *du=device->GetDebugUtils();
|
||||
|
||||
if(da->debug_maker)
|
||||
da->debug_maker->SetPipelineLayout(mtl->GetPipelineLayout(),"[debug maker] PipelineLayout:"+mtl->GetName());
|
||||
if(da->debug_utils)
|
||||
da->debug_utils->SetPipelineLayout(mtl->GetPipelineLayout(),"[debug utils] PipelineLayout:"+mtl->GetName());
|
||||
if(du)
|
||||
du->SetPipelineLayout(mtl->GetPipelineLayout(),"PipelineLayout:"+mtl->GetName());
|
||||
#endif//_DEBUG
|
||||
|
||||
if(mtl->desc_manager)
|
||||
@ -157,22 +152,13 @@ Material *RenderResource::CreateMaterial(const mtl::MaterialCreateInfo *mci)
|
||||
mtl->mp_array[dst]=device->CreateMP(mtl->desc_manager,mtl->pipeline_layout_data,(DescriptorSetType)dst);
|
||||
|
||||
#ifdef _DEBUG
|
||||
GPUDeviceAttribute *da=device->GetDeviceAttribute();
|
||||
|
||||
AnsiString debug_name=mtl->GetName()+AnsiString(":")+GetDescriptorSetTypeName((DescriptorSetType)dst);
|
||||
|
||||
if(da->debug_maker)
|
||||
if(du)
|
||||
{
|
||||
da->debug_maker->SetDescriptorSet(mtl->mp_array[dst]->GetVkDescriptorSet(),"[debug maker] DescSet:"+debug_name);
|
||||
du->SetDescriptorSet(mtl->mp_array[dst]->GetVkDescriptorSet(),"DescSet:"+debug_name);
|
||||
|
||||
da->debug_maker->SetDescriptorSetLayout(mtl->pipeline_layout_data->layouts[dst],"[debug maker] DescSetLayout:"+debug_name);
|
||||
}
|
||||
|
||||
if(da->debug_utils)
|
||||
{
|
||||
da->debug_utils->SetDescriptorSet(mtl->mp_array[dst]->GetVkDescriptorSet(),"[debug utils] DescSet:"+debug_name);
|
||||
|
||||
da->debug_utils->SetDescriptorSetLayout(mtl->pipeline_layout_data->layouts[dst],"[debug utils] DescSetLayout:"+debug_name);
|
||||
du->SetDescriptorSetLayout(mtl->pipeline_layout_data->layouts[dst],"DescSetLayout:"+debug_name);
|
||||
}
|
||||
#endif//_DEBUG
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user