mirror of
https://github.com/Inori/GPCS4.git
synced 2024-05-20 05:00:52 -04:00
fix some crash, add debug object name
This commit is contained in:
parent
6cdd5e6b19
commit
1deea05481
|
@ -303,7 +303,9 @@ namespace sce::Gnm
|
|||
auto& resTable = shader.getResources();
|
||||
|
||||
// create and bind shader resources
|
||||
bindResource(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, resTable, ctx.userData);
|
||||
bindResource(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
|
||||
resTable,
|
||||
ctx.userData);
|
||||
|
||||
// bind the shader
|
||||
m_context->bindShader(
|
||||
|
@ -345,9 +347,9 @@ namespace sce::Gnm
|
|||
if (resource != nullptr)
|
||||
{
|
||||
auto type = resource->type();
|
||||
if (type.test(SceResourceType::Texture) ||
|
||||
type.test(SceResourceType::RenderTarget) ||
|
||||
type.test(SceResourceType::DepthRenderTarget))
|
||||
if (type.any(SceResourceType::Texture,
|
||||
SceResourceType::RenderTarget,
|
||||
SceResourceType::DepthRenderTarget))
|
||||
{
|
||||
// An image backend buffer,
|
||||
// we create and fill the buffer,
|
||||
|
|
|
@ -622,8 +622,13 @@ namespace sce::Gnm
|
|||
|
||||
void GnmCommandBufferDraw::setDepthStencilDisable()
|
||||
{
|
||||
m_state.gp.om.dsState = VltDepthStencilState();
|
||||
m_flags.set(GnmContextFlag::DirtyDepthStencilState);
|
||||
if (m_state.gp.om.dsState.enableDepthTest != VK_FALSE ||
|
||||
m_state.gp.om.dsState.enableDepthWrite != VK_FALSE ||
|
||||
m_state.gp.om.dsState.enableStencilTest != VK_FALSE)
|
||||
{
|
||||
m_state.gp.om.dsState = VltDepthStencilState();
|
||||
m_flags.set(GnmContextFlag::DirtyDepthStencilState);
|
||||
}
|
||||
}
|
||||
|
||||
void GnmCommandBufferDraw::setClipControl(ClipControl reg)
|
||||
|
@ -963,12 +968,16 @@ namespace sce::Gnm
|
|||
updateVertexBinding(shader);
|
||||
|
||||
// create and bind shader resources
|
||||
bindResource(VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, resTable, ctx.userData);
|
||||
bindResource(VK_PIPELINE_STAGE_VERTEX_SHADER_BIT,
|
||||
resTable,
|
||||
ctx.userData);
|
||||
|
||||
// bind the shader
|
||||
m_context->bindShader(
|
||||
VK_SHADER_STAGE_VERTEX_BIT,
|
||||
shader.compile(m_moduleInfo, ctx.meta));
|
||||
shader.compile(m_moduleInfo,
|
||||
ctx.meta));
|
||||
|
||||
} while (false);
|
||||
}
|
||||
|
||||
|
@ -987,12 +996,16 @@ namespace sce::Gnm
|
|||
auto& resTable = shader.getResources();
|
||||
|
||||
// create and bind shader resources
|
||||
bindResource(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, resTable, ctx.userData);
|
||||
bindResource(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
resTable,
|
||||
ctx.userData);
|
||||
|
||||
// bind the shader
|
||||
m_context->bindShader(
|
||||
VK_SHADER_STAGE_FRAGMENT_BIT,
|
||||
shader.compile(m_moduleInfo, ctx.meta));
|
||||
shader.compile(m_moduleInfo,
|
||||
ctx.meta));
|
||||
|
||||
} while (false);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "Violet/VltBuffer.h"
|
||||
#include "Violet/VltImage.h"
|
||||
#include "Violet/VltSampler.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
using namespace sce::vlt;
|
||||
|
||||
|
@ -15,8 +16,11 @@ LOG_CHANNEL(Graphic.Gnm.GnmResourceFactory);
|
|||
|
||||
namespace sce::Gnm
|
||||
{
|
||||
std::atomic<size_t> GnmResourceFactory::s_objectId = 0;
|
||||
|
||||
GnmResourceFactory::GnmResourceFactory(VltDevice* device) :
|
||||
m_device(device)
|
||||
m_device(device),
|
||||
m_debugUtil(device)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -39,7 +43,7 @@ namespace sce::Gnm
|
|||
// NOTE: this slice count is only valid if the array view hasn't changed since initialization!
|
||||
imgInfo.numLayers = depthTarget->getLastArraySliceIndex() - depthTarget->getBaseArraySliceIndex() + 1;
|
||||
imgInfo.mipLevels = 1;
|
||||
imgInfo.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||
imgInfo.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
|
||||
imgInfo.stages = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT;
|
||||
imgInfo.access = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
|
||||
imgInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
|
||||
|
@ -65,6 +69,27 @@ namespace sce::Gnm
|
|||
depthImage.image, viewInfo);
|
||||
depthImage.depthRenderTarget = *depthTarget;
|
||||
|
||||
// Set debug name
|
||||
auto imageName = fmt::format("DepthTarget_{}_{}",
|
||||
s_objectId++,
|
||||
fmt::ptr(depthTarget->getZReadAddress()));
|
||||
auto viewName = fmt::format("DepthView_{}_{}",
|
||||
s_objectId++,
|
||||
fmt::ptr(depthTarget->getZReadAddress()));
|
||||
|
||||
VkDebugUtilsObjectNameInfoEXT nameInfo;
|
||||
nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
|
||||
nameInfo.pNext = nullptr;
|
||||
nameInfo.objectType = VK_OBJECT_TYPE_IMAGE;
|
||||
nameInfo.pObjectName = imageName.c_str();
|
||||
nameInfo.objectHandle = (uint64_t)depthImage.image->handle();
|
||||
m_debugUtil.setObjectName(&nameInfo);
|
||||
|
||||
nameInfo.objectType = VK_OBJECT_TYPE_IMAGE_VIEW;
|
||||
nameInfo.pObjectName = viewName.c_str();
|
||||
nameInfo.objectHandle = (uint64_t)depthImage.imageView->handle();
|
||||
m_debugUtil.setObjectName(&nameInfo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -100,6 +125,27 @@ namespace sce::Gnm
|
|||
targetImage.imageView = m_device->createImageView(targetImage.image, viewInfo);
|
||||
targetImage.renderTarget = *target;
|
||||
|
||||
// Set debug name
|
||||
auto imageName = fmt::format("ColorTarget_{}_{}",
|
||||
s_objectId++,
|
||||
fmt::ptr(target->getBaseAddress()));
|
||||
auto viewName = fmt::format("ColorView_{}_{}",
|
||||
s_objectId++,
|
||||
fmt::ptr(target->getBaseAddress()));
|
||||
|
||||
VkDebugUtilsObjectNameInfoEXT nameInfo;
|
||||
nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
|
||||
nameInfo.pNext = nullptr;
|
||||
nameInfo.objectType = VK_OBJECT_TYPE_IMAGE;
|
||||
nameInfo.pObjectName = imageName.c_str();
|
||||
nameInfo.objectHandle = (uint64_t)targetImage.image->handle();
|
||||
m_debugUtil.setObjectName(&nameInfo);
|
||||
|
||||
nameInfo.objectType = VK_OBJECT_TYPE_IMAGE_VIEW;
|
||||
nameInfo.pObjectName = viewName.c_str();
|
||||
nameInfo.objectHandle = (uint64_t)targetImage.imageView->handle();
|
||||
m_debugUtil.setObjectName(&nameInfo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -114,9 +160,23 @@ namespace sce::Gnm
|
|||
info.stages = createInfo.stage;
|
||||
info.access = createInfo.access;
|
||||
|
||||
sceBuffer.buffer = m_device->createBuffer(info, createInfo.memoryType);
|
||||
sceBuffer.bufferView = nullptr;
|
||||
sceBuffer.gnmBuffer = *vsharp;
|
||||
sceBuffer.buffer = m_device->createBuffer(info, createInfo.memoryType);
|
||||
sceBuffer.bufferView = nullptr;
|
||||
sceBuffer.gnmBuffer = *vsharp;
|
||||
|
||||
// Set debug name
|
||||
auto bufferName = fmt::format("Buffer_{}_{}",
|
||||
s_objectId++,
|
||||
fmt::ptr(vsharp->getBaseAddress()));
|
||||
|
||||
VkDebugUtilsObjectNameInfoEXT nameInfo;
|
||||
nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
|
||||
nameInfo.pNext = nullptr;
|
||||
nameInfo.objectType = VK_OBJECT_TYPE_BUFFER;
|
||||
nameInfo.pObjectName = bufferName.c_str();
|
||||
nameInfo.objectHandle = (uint64_t)sceBuffer.buffer->getSliceHandle().handle;
|
||||
m_debugUtil.setObjectName(&nameInfo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -168,6 +228,32 @@ namespace sce::Gnm
|
|||
sceTexture.imageView = m_device->createImageView(sceTexture.image, viewInfo);
|
||||
sceTexture.texture = *tsharp;
|
||||
|
||||
if (s_objectId == 196)
|
||||
{
|
||||
__debugbreak();
|
||||
}
|
||||
|
||||
// Set debug name
|
||||
auto imageName = fmt::format("Texture_{}_{}",
|
||||
s_objectId++,
|
||||
fmt::ptr(tsharp->getBaseAddress()));
|
||||
auto viewName = fmt::format("TextureView_{}_{}",
|
||||
s_objectId++,
|
||||
fmt::ptr(tsharp->getBaseAddress()));
|
||||
|
||||
VkDebugUtilsObjectNameInfoEXT nameInfo;
|
||||
nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
|
||||
nameInfo.pNext = nullptr;
|
||||
nameInfo.objectType = VK_OBJECT_TYPE_IMAGE;
|
||||
nameInfo.pObjectName = imageName.c_str();
|
||||
nameInfo.objectHandle = (uint64_t)sceTexture.image->handle();
|
||||
m_debugUtil.setObjectName(&nameInfo);
|
||||
|
||||
nameInfo.objectType = VK_OBJECT_TYPE_IMAGE_VIEW;
|
||||
nameInfo.pObjectName = viewName.c_str();
|
||||
nameInfo.objectHandle = (uint64_t)sceTexture.imageView->handle();
|
||||
m_debugUtil.setObjectName(&nameInfo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -203,8 +289,20 @@ namespace sce::Gnm
|
|||
sampler.sampler = m_device->createSampler(samplerInfo);
|
||||
sampler.ssharp = *ssharp;
|
||||
|
||||
// Set debug name
|
||||
auto samplerName = fmt::format("Sampler_{}", s_objectId++);
|
||||
|
||||
VkDebugUtilsObjectNameInfoEXT nameInfo;
|
||||
nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT;
|
||||
nameInfo.pNext = nullptr;
|
||||
nameInfo.objectType = VK_OBJECT_TYPE_SAMPLER;
|
||||
nameInfo.pObjectName = samplerName.c_str();
|
||||
nameInfo.objectHandle = (uint64_t)sampler.sampler->handle();
|
||||
m_debugUtil.setObjectName(&nameInfo);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace sce::Gnm
|
|
@ -1,6 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include "GnmCommon.h"
|
||||
#include "Violet/VltDebugUtil.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
namespace sce
|
||||
{
|
||||
|
@ -71,7 +74,10 @@ namespace sce
|
|||
SceSampler& sampler);
|
||||
|
||||
private:
|
||||
vlt::VltDevice* m_device;
|
||||
vlt::VltDevice* m_device;
|
||||
vlt::VltDebugUtil m_debugUtil;
|
||||
|
||||
static std::atomic_size_t s_objectId;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -48,21 +48,31 @@ namespace sce
|
|||
if (transform.test(SceTransformFlag::GpuUpload))
|
||||
{
|
||||
Rc<VltImage> dstImage = nullptr;
|
||||
if (type.test(SceResourceType::RenderTarget))
|
||||
{
|
||||
dstImage = res.second.renderTarget().image;
|
||||
}
|
||||
else if (type.test(SceResourceType::Texture))
|
||||
if (type.test(SceResourceType::Texture))
|
||||
{
|
||||
dstImage = res.second.texture().image;
|
||||
}
|
||||
else if (type.test(SceResourceType::RenderTarget))
|
||||
{
|
||||
dstImage = res.second.renderTarget().image;
|
||||
}
|
||||
else if (type.test(SceResourceType::DepthRenderTarget))
|
||||
{
|
||||
dstImage = res.second.depthRenderTarget().image;
|
||||
}
|
||||
|
||||
VkExtent3D imageExtent = dstImage->mipLevelExtent(0);
|
||||
VkImageSubresourceLayers subresourceLayers = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1 };
|
||||
VkImageSubresourceLayers subresourceLayers =
|
||||
{
|
||||
dstImage->formatInfo()->aspectMask, 0, 0, 1
|
||||
};
|
||||
|
||||
auto& srcBuffer = res.second.buffer().buffer;
|
||||
context->copyBufferToImage(dstImage, subresourceLayers, VkOffset3D{ 0, 0, 0 }, imageExtent,
|
||||
srcBuffer, 0, { 0u, 0u });
|
||||
context->copyBufferToImage(dstImage,
|
||||
subresourceLayers,
|
||||
VkOffset3D{ 0, 0, 0 },
|
||||
imageExtent,
|
||||
srcBuffer, 0, { 0u, 0u });
|
||||
}
|
||||
|
||||
if (transform.test(SceTransformFlag::GpuDownload))
|
||||
|
|
|
@ -1377,6 +1377,30 @@ namespace sce::vlt
|
|||
m_cmd->waitSemaphore(submission);
|
||||
}
|
||||
|
||||
void VltContext::beginDebugLabel(VkDebugUtilsLabelEXT* label)
|
||||
{
|
||||
if (!m_device->instance()->extensions().extDebugUtils)
|
||||
return;
|
||||
|
||||
m_cmd->cmdBeginDebugUtilsLabel(label);
|
||||
}
|
||||
|
||||
void VltContext::endDebugLabel()
|
||||
{
|
||||
if (!m_device->instance()->extensions().extDebugUtils)
|
||||
return;
|
||||
|
||||
m_cmd->cmdEndDebugUtilsLabel();
|
||||
}
|
||||
|
||||
void VltContext::insertDebugLabel(VkDebugUtilsLabelEXT* label)
|
||||
{
|
||||
if (!m_device->instance()->extensions().extDebugUtils)
|
||||
return;
|
||||
|
||||
m_cmd->cmdInsertDebugUtilsLabel(label);
|
||||
}
|
||||
|
||||
void VltContext::beginRendering()
|
||||
{
|
||||
auto& framebuffer = m_state.cb.framebuffer;
|
||||
|
@ -1993,5 +2017,4 @@ namespace sce::vlt
|
|||
}
|
||||
|
||||
|
||||
|
||||
} // namespace sce::vlt
|
|
@ -579,6 +579,32 @@ namespace sce::vlt
|
|||
void waitSemaphore(
|
||||
const VltSemaphoreSubmission& submission);
|
||||
|
||||
/**
|
||||
* \brief Begins a debug label region
|
||||
* \param [in] label The debug label
|
||||
*
|
||||
* Marks the start of a debug label region. Used by debugging/profiling
|
||||
* tools to mark different workloads within a frame.
|
||||
*/
|
||||
void beginDebugLabel(VkDebugUtilsLabelEXT* label);
|
||||
|
||||
/**
|
||||
* \brief Ends a debug label region
|
||||
*
|
||||
* Marks the close of a debug label region. Used by debugging/profiling
|
||||
* tools to mark different workloads within a frame.
|
||||
*/
|
||||
void endDebugLabel();
|
||||
|
||||
/**
|
||||
* \brief Inserts a debug label
|
||||
* \param [in] label The debug label
|
||||
*
|
||||
* Inserts an instantaneous debug label. Used by debugging/profiling
|
||||
* tools to mark different workloads within a frame.
|
||||
*/
|
||||
void insertDebugLabel(VkDebugUtilsLabelEXT* label);
|
||||
|
||||
private:
|
||||
void beginRendering();
|
||||
|
||||
|
|
|
@ -4,11 +4,8 @@
|
|||
|
||||
namespace sce::vlt
|
||||
{
|
||||
PFN_vkDebugMarkerSetObjectTagEXT VltDebugUtil::pfnDebugMarkerSetObjectTag = VK_NULL_HANDLE;
|
||||
PFN_vkDebugMarkerSetObjectNameEXT VltDebugUtil::pfnDebugMarkerSetObjectName = VK_NULL_HANDLE;
|
||||
PFN_vkCmdDebugMarkerBeginEXT VltDebugUtil::pfnCmdDebugMarkerBegin = VK_NULL_HANDLE;
|
||||
PFN_vkCmdDebugMarkerEndEXT VltDebugUtil::pfnCmdDebugMarkerEnd = VK_NULL_HANDLE;
|
||||
PFN_vkCmdDebugMarkerInsertEXT VltDebugUtil::pfnCmdDebugMarkerInsert = VK_NULL_HANDLE;
|
||||
PFN_vkSetDebugUtilsObjectNameEXT VltDebugUtil::pfnSetDebugUtilsObjectNameEXT = VK_NULL_HANDLE;
|
||||
PFN_vkSetDebugUtilsObjectTagEXT VltDebugUtil::pfnSetDebugUtilsObjectTagEXT = VK_NULL_HANDLE;
|
||||
|
||||
PFN_vkCmdInsertDebugUtilsLabelEXT VltDebugUtil::pfnCmdInsertDebugUtilsLabelEXT = VK_NULL_HANDLE;
|
||||
PFN_vkCmdEndDebugUtilsLabelEXT VltDebugUtil::pfnCmdEndDebugUtilsLabelEXT = VK_NULL_HANDLE;
|
||||
|
@ -28,71 +25,25 @@ namespace sce::vlt
|
|||
|
||||
void VltDebugUtil::setupDebugFunctions()
|
||||
{
|
||||
pfnDebugMarkerSetObjectTag = reinterpret_cast<PFN_vkDebugMarkerSetObjectTagEXT>(vkGetDeviceProcAddr(m_device->handle(), "vkDebugMarkerSetObjectTagEXT"));
|
||||
pfnDebugMarkerSetObjectName = reinterpret_cast<PFN_vkDebugMarkerSetObjectNameEXT>(vkGetDeviceProcAddr(m_device->handle(), "vkDebugMarkerSetObjectNameEXT"));
|
||||
pfnCmdDebugMarkerBegin = reinterpret_cast<PFN_vkCmdDebugMarkerBeginEXT>(vkGetDeviceProcAddr(m_device->handle(), "vkCmdDebugMarkerBeginEXT"));
|
||||
pfnCmdDebugMarkerEnd = reinterpret_cast<PFN_vkCmdDebugMarkerEndEXT>(vkGetDeviceProcAddr(m_device->handle(), "vkCmdDebugMarkerEndEXT"));
|
||||
pfnCmdDebugMarkerInsert = reinterpret_cast<PFN_vkCmdDebugMarkerInsertEXT>(vkGetDeviceProcAddr(m_device->handle(), "vkCmdDebugMarkerInsertEXT"));
|
||||
pfnSetDebugUtilsObjectNameEXT = reinterpret_cast<PFN_vkSetDebugUtilsObjectNameEXT>(vkGetDeviceProcAddr(m_device->handle(), "vkSetDebugUtilsObjectNameEXT"));
|
||||
pfnSetDebugUtilsObjectTagEXT = reinterpret_cast<PFN_vkSetDebugUtilsObjectTagEXT>(vkGetDeviceProcAddr(m_device->handle(), "vkSetDebugUtilsObjectTagEXT"));
|
||||
|
||||
pfnCmdBeginDebugUtilsLabelEXT = reinterpret_cast<PFN_vkCmdBeginDebugUtilsLabelEXT>(vkGetDeviceProcAddr(m_device->handle(), "vkCmdBeginDebugUtilsLabelEXT"));
|
||||
pfnCmdEndDebugUtilsLabelEXT = reinterpret_cast<PFN_vkCmdEndDebugUtilsLabelEXT>(vkGetDeviceProcAddr(m_device->handle(), "vkCmdEndDebugUtilsLabelEXT"));
|
||||
pfnCmdInsertDebugUtilsLabelEXT = reinterpret_cast<PFN_vkCmdInsertDebugUtilsLabelEXT>(vkGetDeviceProcAddr(m_device->handle(), "vkCmdInsertDebugUtilsLabelEXT"));
|
||||
}
|
||||
|
||||
void VltDebugUtil::setObjectName(uint64_t object, VkDebugReportObjectTypeEXT objType, const char* objName)
|
||||
void VltDebugUtil::setObjectName(VkDebugUtilsObjectNameInfoEXT* nameInfo)
|
||||
{
|
||||
#ifdef VLT_DEBUG_LABEL
|
||||
VkDebugMarkerObjectNameInfoEXT nameInfo = {};
|
||||
nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT;
|
||||
nameInfo.pNext = nullptr;
|
||||
nameInfo.object = object;
|
||||
nameInfo.objectType = objType;
|
||||
nameInfo.pObjectName = objName;
|
||||
pfnDebugMarkerSetObjectName(m_device->handle(), &nameInfo);
|
||||
pfnSetDebugUtilsObjectNameEXT(m_device->handle(), nameInfo);
|
||||
#endif // VLT_DEBUG_LABEL
|
||||
}
|
||||
|
||||
void VltDebugUtil::setObjectTag(uint64_t object, VkDebugReportObjectTypeEXT objType, void* tagData, size_t tagSize, uint64_t tagName /*= 0*/)
|
||||
void VltDebugUtil::setObjectTag(VkDebugUtilsObjectTagInfoEXT* tagInfo)
|
||||
{
|
||||
#ifdef VLT_DEBUG_LABEL
|
||||
VkDebugMarkerObjectTagInfoEXT tagInfo = {};
|
||||
tagInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT;
|
||||
tagInfo.pNext = nullptr;
|
||||
tagInfo.object = object;
|
||||
tagInfo.objectType = objType;
|
||||
tagInfo.tagName = tagName;
|
||||
tagInfo.pTag = tagData;
|
||||
tagInfo.tagSize = tagSize;
|
||||
pfnDebugMarkerSetObjectTag(m_device->handle(), &tagInfo);
|
||||
#endif // VLT_DEBUG_LABEL
|
||||
}
|
||||
|
||||
void VltDebugUtil::cmdMarkerBegin(VkCommandBuffer command, const char* marker)
|
||||
{
|
||||
#ifdef VLT_DEBUG_LABEL
|
||||
VkDebugMarkerMarkerInfoEXT markerInfo = {};
|
||||
markerInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT;
|
||||
markerInfo.pNext = nullptr;
|
||||
markerInfo.pMarkerName = marker;
|
||||
pfnCmdDebugMarkerBegin(command, &markerInfo);
|
||||
#endif // VLT_DEBUG_LABEL
|
||||
}
|
||||
|
||||
void VltDebugUtil::cmdMarkerEnd(VkCommandBuffer command)
|
||||
{
|
||||
#ifdef VLT_DEBUG_LABEL
|
||||
pfnCmdDebugMarkerEnd(command);
|
||||
#endif // VLT_DEBUG_LABEL
|
||||
}
|
||||
|
||||
void VltDebugUtil::cmdMarkerInsert(VkCommandBuffer command, const char* marker)
|
||||
{
|
||||
#ifdef VLT_DEBUG_LABEL
|
||||
VkDebugMarkerMarkerInfoEXT markerInfo = {};
|
||||
markerInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT;
|
||||
markerInfo.pNext = nullptr;
|
||||
markerInfo.pMarkerName = marker;
|
||||
pfnCmdDebugMarkerInsert(command, &markerInfo);
|
||||
pfnSetDebugUtilsObjectTagEXT(m_device->handle(), tagInfo);
|
||||
#endif // VLT_DEBUG_LABEL
|
||||
}
|
||||
|
||||
|
|
|
@ -13,19 +13,10 @@ namespace sce::vlt
|
|||
~VltDebugUtil();
|
||||
|
||||
void setObjectName(
|
||||
uint64_t object, VkDebugReportObjectTypeEXT objType, const char* objName);
|
||||
VkDebugUtilsObjectNameInfoEXT* nameInfo);
|
||||
|
||||
void setObjectTag(
|
||||
uint64_t object, VkDebugReportObjectTypeEXT objType, void* tagData, size_t tagSize, uint64_t tagName = 0);
|
||||
|
||||
void cmdMarkerBegin(
|
||||
VkCommandBuffer command, const char* marker);
|
||||
|
||||
void cmdMarkerEnd(
|
||||
VkCommandBuffer command);
|
||||
|
||||
void cmdMarkerInsert(
|
||||
VkCommandBuffer command, const char* marker);
|
||||
VkDebugUtilsObjectTagInfoEXT* tagInfo);
|
||||
|
||||
void cmdBeginDebugUtilsLabel(
|
||||
VkCommandBuffer command, VkDebugUtilsLabelEXT* labelInfo);
|
||||
|
@ -42,11 +33,8 @@ namespace sce::vlt
|
|||
private:
|
||||
VltDevice* m_device;
|
||||
|
||||
static PFN_vkDebugMarkerSetObjectTagEXT pfnDebugMarkerSetObjectTag;
|
||||
static PFN_vkDebugMarkerSetObjectNameEXT pfnDebugMarkerSetObjectName;
|
||||
static PFN_vkCmdDebugMarkerBeginEXT pfnCmdDebugMarkerBegin;
|
||||
static PFN_vkCmdDebugMarkerEndEXT pfnCmdDebugMarkerEnd;
|
||||
static PFN_vkCmdDebugMarkerInsertEXT pfnCmdDebugMarkerInsert;
|
||||
static PFN_vkSetDebugUtilsObjectNameEXT pfnSetDebugUtilsObjectNameEXT;
|
||||
static PFN_vkSetDebugUtilsObjectTagEXT pfnSetDebugUtilsObjectTagEXT;
|
||||
|
||||
static PFN_vkCmdBeginDebugUtilsLabelEXT pfnCmdBeginDebugUtilsLabelEXT;
|
||||
static PFN_vkCmdEndDebugUtilsLabelEXT pfnCmdEndDebugUtilsLabelEXT;
|
||||
|
|
Loading…
Reference in a new issue