mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-31 15:53:17 +00:00
video_core: Implement sceGnmInsertPushColorMarker (#989)
This commit is contained in:
parent
3982ef7188
commit
6e986f8133
5 changed files with 47 additions and 4 deletions
|
@ -226,6 +226,17 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span<const u32> dcb, std::span<c
|
|||
}
|
||||
break;
|
||||
}
|
||||
case PM4CmdNop::PayloadType::DebugColorMarkerPush: {
|
||||
const auto marker_sz = nop->header.count.Value() * 2;
|
||||
const std::string_view label{reinterpret_cast<const char*>(&nop->data_block[1]),
|
||||
marker_sz};
|
||||
const u32 color = *reinterpret_cast<const u32*>(
|
||||
reinterpret_cast<const u8*>(&nop->data_block[1]) + marker_sz);
|
||||
if (rasterizer) {
|
||||
rasterizer->ScopedMarkerInsertColor(label, color);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PM4CmdNop::PayloadType::DebugMarkerPop: {
|
||||
if (rasterizer) {
|
||||
rasterizer->ScopeMarkerEnd();
|
||||
|
|
|
@ -459,4 +459,17 @@ void Rasterizer::ScopedMarkerInsert(const std::string_view& str) {
|
|||
});
|
||||
}
|
||||
|
||||
void Rasterizer::ScopedMarkerInsertColor(const std::string_view& str, const u32 color) {
|
||||
if (Config::nullGpu() || !Config::vkMarkersEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto cmdbuf = scheduler.CommandBuffer();
|
||||
cmdbuf.insertDebugUtilsLabelEXT(vk::DebugUtilsLabelEXT{
|
||||
.pLabelName = str.data(),
|
||||
.color = std::array<f32, 4>(
|
||||
{(f32)((color >> 16) & 0xff) / 255.0f, (f32)((color >> 8) & 0xff) / 255.0f,
|
||||
(f32)(color & 0xff) / 255.0f, (f32)((color >> 24) & 0xff) / 255.0f})});
|
||||
}
|
||||
|
||||
} // namespace Vulkan
|
||||
|
|
|
@ -40,6 +40,7 @@ public:
|
|||
void ScopeMarkerBegin(const std::string_view& str);
|
||||
void ScopeMarkerEnd();
|
||||
void ScopedMarkerInsert(const std::string_view& str);
|
||||
void ScopedMarkerInsertColor(const std::string_view& str, const u32 color);
|
||||
|
||||
void InlineDataToGds(u32 gds_offset, u32 value);
|
||||
u32 ReadDataFromGds(u32 gsd_offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue