Skip to content
Snippets Groups Projects
Verified Commit a7e3a227 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#104] Added basic recording for debug labels

parent ab528a93
No related branches found
No related tags found
1 merge request!87Resolve "Pass Debug Profiling"
Pipeline #26601 passed
......@@ -270,6 +270,12 @@ namespace vkcv
const uint32_t dispatchCount[3],
const std::vector<DescriptorSetUsage> &descriptorSetUsages,
const PushConstants& pushConstants);
void recordBeginDebugLabel(const CommandStreamHandle &cmdStream,
const std::string& label,
const std::array<float, 4>& color);
void recordEndDebugLabel(const CommandStreamHandle &cmdStream);
/**
* @brief end recording and present image
......
......@@ -116,6 +116,10 @@ namespace vkcv::scene {
size_t pushConstantsSizePerDrawcall,
const RecordMeshDrawcallFunction &record,
const std::vector<ImageHandle> &renderTargets) {
m_core->recordBeginDebugLabel(cmdStream, "vkcv::scene::Scene", {
0.0f, 1.0f, 0.0f, 1.0f
});
PushConstants pushConstants (pushConstantsSizePerDrawcall);
std::vector<DrawcallInfo> drawcalls;
size_t count = 0;
......@@ -137,6 +141,8 @@ namespace vkcv::scene {
drawcalls,
renderTargets
);
m_core->recordEndDebugLabel(cmdStream);
}
Scene Scene::create(Core& core) {
......
......@@ -7,7 +7,13 @@ namespace vkcv::upscaling {
void BilinearUpscaling::recordUpscaling(const CommandStreamHandle &cmdStream, const ImageHandle &input,
const ImageHandle &output) {
m_core.recordBeginDebugLabel(cmdStream, "vkcv::upscaling::BilinearUpscaling", {
0.0f, 0.0f, 1.0f, 1.0f
});
m_core.recordBlitImage(cmdStream, input, output, SamplerFilterType::LINEAR);
m_core.recordEndDebugLabel(cmdStream);
}
}
......@@ -245,6 +245,10 @@ namespace vkcv::upscaling {
void FSRUpscaling::recordUpscaling(const CommandStreamHandle& cmdStream,
const ImageHandle& input,
const ImageHandle& output) {
m_core.recordBeginDebugLabel(cmdStream, "vkcv::upscaling::FSRUpscaling", {
1.0f, 0.0f, 0.0f, 1.0f
});
const uint32_t inputWidth = m_core.getImageWidth(input);
const uint32_t inputHeight = m_core.getImageHeight(input);
......@@ -361,6 +365,8 @@ namespace vkcv::upscaling {
PushConstants(0)
);
}
m_core.recordEndDebugLabel(cmdStream);
}
bool FSRUpscaling::isHdrEnabled() const {
......
first_triangle
\ No newline at end of file
mesh_shader
\ No newline at end of file
......@@ -506,7 +506,50 @@ namespace vkcv
recordCommandsToStream(cmdStreamHandle, submitFunction, nullptr);
}
void Core::recordBeginDebugLabel(const CommandStreamHandle &cmdStream,
const std::string& label,
const std::array<float, 4>& color) {
#ifndef NDEBUG
static PFN_vkCmdBeginDebugUtilsLabelEXT beginDebugLabel = reinterpret_cast<PFN_vkCmdBeginDebugUtilsLabelEXT>(
m_Context.getDevice().getProcAddr("vkCmdBeginDebugUtilsLabelEXT")
);
if (!beginDebugLabel) {
return;
}
auto submitFunction = [&](const vk::CommandBuffer& cmdBuffer) {
const vk::DebugUtilsLabelEXT debug (
label.c_str(),
color
);
beginDebugLabel(cmdBuffer, &(static_cast<const VkDebugUtilsLabelEXT&>(debug)));
};
recordCommandsToStream(cmdStream, submitFunction, nullptr);
#endif
}
void Core::recordEndDebugLabel(const CommandStreamHandle &cmdStream) {
#ifndef NDEBUG
static PFN_vkCmdEndDebugUtilsLabelEXT endDebugLabel = reinterpret_cast<PFN_vkCmdEndDebugUtilsLabelEXT>(
m_Context.getDevice().getProcAddr("vkCmdEndDebugUtilsLabelEXT")
);
if (!endDebugLabel) {
return;
}
auto submitFunction = [&](const vk::CommandBuffer& cmdBuffer) {
endDebugLabel(cmdBuffer);
};
recordCommandsToStream(cmdStream, submitFunction, nullptr);
#endif
}
void Core::endFrame() {
if (m_currentSwapchainImageIndex == std::numeric_limits<uint32_t>::max()) {
return;
......
......@@ -52,8 +52,6 @@ namespace vkcv {
}
}
struct MeshShaderFunctions
{
PFN_vkCmdDrawMeshTasksNV cmdDrawMeshTasks = nullptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment