mirror of https://github.com/RPCS3/rpcs3.git
vk: Rename the debug marker to something more appropriate
This commit is contained in:
parent
c80be9e54b
commit
6fd76054b4
|
@ -57,7 +57,7 @@ namespace vk
|
||||||
u64 eid;
|
u64 eid;
|
||||||
const vk::render_device* m_device;
|
const vk::render_device* m_device;
|
||||||
std::vector<disposable_t> m_disposables;
|
std::vector<disposable_t> m_disposables;
|
||||||
std::vector<std::unique_ptr<device_debug_marker>> m_debug_markers;
|
std::vector<std::unique_ptr<gpu_debug_marker>> m_debug_markers;
|
||||||
|
|
||||||
eid_scope_t(u64 _eid):
|
eid_scope_t(u64 _eid):
|
||||||
eid(_eid), m_device(g_render_device)
|
eid(_eid), m_device(g_render_device)
|
||||||
|
@ -190,7 +190,7 @@ namespace vk
|
||||||
get_current_eid_scope().m_disposables.emplace_back(std::move(disposable));
|
get_current_eid_scope().m_disposables.emplace_back(std::move(disposable));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void dispose(std::unique_ptr<vk::device_debug_marker>& object)
|
inline void dispose(std::unique_ptr<vk::gpu_debug_marker>& object)
|
||||||
{
|
{
|
||||||
// Special case as we may need to read these out.
|
// Special case as we may need to read these out.
|
||||||
// FIXME: We can manage these markers better and remove this exception.
|
// FIXME: We can manage these markers better and remove this exception.
|
||||||
|
@ -232,9 +232,9 @@ namespace vk
|
||||||
|
|
||||||
void trim();
|
void trim();
|
||||||
|
|
||||||
std::vector<const device_debug_marker*> gather_debug_markers() const
|
std::vector<const gpu_debug_marker*> gather_debug_markers() const
|
||||||
{
|
{
|
||||||
std::vector<const device_debug_marker*> result;
|
std::vector<const gpu_debug_marker*> result;
|
||||||
for (const auto& scope : m_eid_map)
|
for (const auto& scope : m_eid_map)
|
||||||
{
|
{
|
||||||
for (const auto& item : scope.m_debug_markers)
|
for (const auto& item : scope.m_debug_markers)
|
||||||
|
|
|
@ -211,14 +211,14 @@ namespace vk
|
||||||
m_offset = 0;
|
m_offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
device_debug_marker::device_debug_marker(device_marker_pool& pool, std::string message)
|
gpu_debug_marker::gpu_debug_marker(device_marker_pool& pool, std::string message)
|
||||||
: m_device(*pool.pdev), m_message(std::move(message))
|
: m_device(*pool.pdev), m_message(std::move(message))
|
||||||
{
|
{
|
||||||
std::tie(m_buffer, m_buffer_offset, m_value) = pool.allocate();
|
std::tie(m_buffer, m_buffer_offset, m_value) = pool.allocate();
|
||||||
*m_value = 0xCAFEBABE;
|
*m_value = 0xCAFEBABE;
|
||||||
}
|
}
|
||||||
|
|
||||||
device_debug_marker::~device_debug_marker()
|
gpu_debug_marker::~gpu_debug_marker()
|
||||||
{
|
{
|
||||||
if (!m_printed)
|
if (!m_printed)
|
||||||
{
|
{
|
||||||
|
@ -228,13 +228,13 @@ namespace vk
|
||||||
m_value = nullptr;
|
m_value = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void device_debug_marker::signal(const command_buffer& cmd, VkPipelineStageFlags stages, VkAccessFlags access)
|
void gpu_debug_marker::signal(const command_buffer& cmd, VkPipelineStageFlags stages, VkAccessFlags access)
|
||||||
{
|
{
|
||||||
insert_global_memory_barrier(cmd, stages, VK_PIPELINE_STAGE_TRANSFER_BIT, access, VK_ACCESS_TRANSFER_WRITE_BIT);
|
insert_global_memory_barrier(cmd, stages, VK_PIPELINE_STAGE_TRANSFER_BIT, access, VK_ACCESS_TRANSFER_WRITE_BIT);
|
||||||
vkCmdFillBuffer(cmd, m_buffer, m_buffer_offset, 4, 0xDEADBEEF);
|
vkCmdFillBuffer(cmd, m_buffer, m_buffer_offset, 4, 0xDEADBEEF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void device_debug_marker::dump()
|
void gpu_debug_marker::dump()
|
||||||
{
|
{
|
||||||
if (*m_value == 0xCAFEBABE)
|
if (*m_value == 0xCAFEBABE)
|
||||||
{
|
{
|
||||||
|
@ -244,7 +244,7 @@ namespace vk
|
||||||
m_printed = true;
|
m_printed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void device_debug_marker::dump() const
|
void gpu_debug_marker::dump() const
|
||||||
{
|
{
|
||||||
if (*m_value == 0xCAFEBABE)
|
if (*m_value == 0xCAFEBABE)
|
||||||
{
|
{
|
||||||
|
@ -268,14 +268,14 @@ namespace vk
|
||||||
return *g_device_marker_pool;
|
return *g_device_marker_pool;
|
||||||
}
|
}
|
||||||
|
|
||||||
void device_debug_marker::insert(
|
void gpu_debug_marker::insert(
|
||||||
const vk::render_device& dev,
|
const vk::render_device& dev,
|
||||||
const vk::command_buffer& cmd,
|
const vk::command_buffer& cmd,
|
||||||
std::string message,
|
std::string message,
|
||||||
VkPipelineStageFlags stages,
|
VkPipelineStageFlags stages,
|
||||||
VkAccessFlags access)
|
VkAccessFlags access)
|
||||||
{
|
{
|
||||||
auto result = std::make_unique<device_debug_marker>(get_shared_marker_pool(dev), message);
|
auto result = std::make_unique<gpu_debug_marker>(get_shared_marker_pool(dev), message);
|
||||||
result->signal(cmd, stages, access);
|
result->signal(cmd, stages, access);
|
||||||
vk::get_resource_manager()->dispose(result);
|
vk::get_resource_manager()->dispose(result);
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,7 @@ namespace vk
|
||||||
debug_marker_scope::debug_marker_scope(const vk::command_buffer& cmd, const std::string& message)
|
debug_marker_scope::debug_marker_scope(const vk::command_buffer& cmd, const std::string& message)
|
||||||
: m_device(&cmd.get_command_pool().get_owner()), m_cb(&cmd), m_message(message), m_tag(rsx::get_shared_tag())
|
: m_device(&cmd.get_command_pool().get_owner()), m_cb(&cmd), m_message(message), m_tag(rsx::get_shared_tag())
|
||||||
{
|
{
|
||||||
vk::device_debug_marker::insert(
|
vk::gpu_debug_marker::insert(
|
||||||
*m_device,
|
*m_device,
|
||||||
*m_cb,
|
*m_cb,
|
||||||
fmt::format("0x%x: Enter %s", m_tag, m_message)
|
fmt::format("0x%x: Enter %s", m_tag, m_message)
|
||||||
|
@ -294,7 +294,7 @@ namespace vk
|
||||||
{
|
{
|
||||||
ensure(m_cb && m_cb->is_recording());
|
ensure(m_cb && m_cb->is_recording());
|
||||||
|
|
||||||
vk::device_debug_marker::insert(
|
vk::gpu_debug_marker::insert(
|
||||||
*m_device,
|
*m_device,
|
||||||
*m_cb,
|
*m_cb,
|
||||||
fmt::format("0x%x: Exit %s", m_tag, m_message)
|
fmt::format("0x%x: Exit %s", m_tag, m_message)
|
||||||
|
|
|
@ -103,7 +103,7 @@ namespace vk
|
||||||
const vk::render_device* pdev = nullptr;
|
const vk::render_device* pdev = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class device_debug_marker
|
class gpu_debug_marker
|
||||||
{
|
{
|
||||||
std::string m_message;
|
std::string m_message;
|
||||||
bool m_printed = false;
|
bool m_printed = false;
|
||||||
|
@ -114,9 +114,9 @@ namespace vk
|
||||||
volatile u32* m_value = nullptr;
|
volatile u32* m_value = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
device_debug_marker(device_marker_pool& pool, std::string message);
|
gpu_debug_marker(device_marker_pool& pool, std::string message);
|
||||||
~device_debug_marker();
|
~gpu_debug_marker();
|
||||||
device_debug_marker(const event&) = delete;
|
gpu_debug_marker(const event&) = delete;
|
||||||
|
|
||||||
void signal(const command_buffer& cmd, VkPipelineStageFlags stages, VkAccessFlags access);
|
void signal(const command_buffer& cmd, VkPipelineStageFlags stages, VkAccessFlags access);
|
||||||
void dump();
|
void dump();
|
||||||
|
|
Loading…
Reference in New Issue