summaryrefslogtreecommitdiffstats
path: root/servers/rendering/rendering_device_graph.h
diff options
context:
space:
mode:
authorMatias N. Goldberg <dark_sylinc@yahoo.com.ar>2024-06-30 19:30:54 -0300
committerRémi Verschelde <rverschelde@gmail.com>2024-08-21 23:48:08 +0200
commit364f916f3f0141c247e32e63624b063905d66b02 (patch)
tree36b25af740f286ea78d734136ecbffd8ed407bda /servers/rendering/rendering_device_graph.h
parent5ca419e32c58e671284b3b7f91257179657d9114 (diff)
downloadredot-engine-364f916f3f0141c247e32e63624b063905d66b02.tar.gz
Add debug utilities for Vulkan
Features: - Debug-only tracking of objects by type. See get_driver_allocs_by_object_type et al. - Debug-only Breadcrumb info for debugging GPU crashes and device lost - Performance report per frame from get_perf_report - Some VMA calls had to be modified in order to insert the necessary memory callbacks Functionality marked as "debug-only" is only available in debug or dev builds. Misc fixes: - Early break optimization in RenderingDevice::uniform_set_create ============================ The work was performed by collaboration of TheForge and Google. I am merely splitting it up into smaller PRs and cleaning it up.
Diffstat (limited to 'servers/rendering/rendering_device_graph.h')
-rw-r--r--servers/rendering/rendering_device_graph.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/servers/rendering/rendering_device_graph.h b/servers/rendering/rendering_device_graph.h
index baa15f63f6..e13e3a0429 100644
--- a/servers/rendering/rendering_device_graph.h
+++ b/servers/rendering/rendering_device_graph.h
@@ -218,13 +218,14 @@ private:
};
struct ComputeInstructionList : InstructionList {
- // No extra contents.
+ uint32_t breadcrumb;
};
struct DrawInstructionList : InstructionList {
RDD::RenderPassID render_pass;
RDD::FramebufferID framebuffer;
Rect2i region;
+ uint32_t breadcrumb;
LocalVector<RDD::RenderPassClearValue> clear_values;
};
@@ -296,6 +297,7 @@ private:
struct RecordedComputeListCommand : RecordedCommand {
uint32_t instruction_data_size = 0;
+ uint32_t breadcrumb = 0;
_FORCE_INLINE_ uint8_t *instruction_data() {
return reinterpret_cast<uint8_t *>(&this[1]);
@@ -312,6 +314,7 @@ private:
RDD::FramebufferID framebuffer;
RDD::CommandBufferType command_buffer_type;
Rect2i region;
+ uint32_t breadcrumb = 0;
uint32_t clear_values_count = 0;
_FORCE_INLINE_ RDD::RenderPassClearValue *clear_values() {
@@ -654,7 +657,7 @@ public:
void add_buffer_copy(RDD::BufferID p_src, ResourceTracker *p_src_tracker, RDD::BufferID p_dst, ResourceTracker *p_dst_tracker, RDD::BufferCopyRegion p_region);
void add_buffer_get_data(RDD::BufferID p_src, ResourceTracker *p_src_tracker, RDD::BufferID p_dst, RDD::BufferCopyRegion p_region);
void add_buffer_update(RDD::BufferID p_dst, ResourceTracker *p_dst_tracker, VectorView<RecordedBufferCopy> p_buffer_copies);
- void add_compute_list_begin();
+ void add_compute_list_begin(RDD::BreadcrumbMarker p_phase = RDD::BreadcrumbMarker::NONE, uint32_t p_breadcrumb_data = 0);
void add_compute_list_bind_pipeline(RDD::PipelineID p_pipeline);
void add_compute_list_bind_uniform_set(RDD::ShaderID p_shader, RDD::UniformSetID p_uniform_set, uint32_t set_index);
void add_compute_list_dispatch(uint32_t p_x_groups, uint32_t p_y_groups, uint32_t p_z_groups);
@@ -664,7 +667,7 @@ public:
void add_compute_list_usage(ResourceTracker *p_tracker, ResourceUsage p_usage);
void add_compute_list_usages(VectorView<ResourceTracker *> p_trackers, VectorView<ResourceUsage> p_usages);
void add_compute_list_end();
- void add_draw_list_begin(RDD::RenderPassID p_render_pass, RDD::FramebufferID p_framebuffer, Rect2i p_region, VectorView<RDD::RenderPassClearValue> p_clear_values, bool p_uses_color, bool p_uses_depth);
+ void add_draw_list_begin(RDD::RenderPassID p_render_pass, RDD::FramebufferID p_framebuffer, Rect2i p_region, VectorView<RDD::RenderPassClearValue> p_clear_values, bool p_uses_color, bool p_uses_depth, uint32_t p_breadcrumb = 0);
void add_draw_list_bind_index_buffer(RDD::BufferID p_buffer, RDD::IndexBufferFormat p_format, uint32_t p_offset);
void add_draw_list_bind_pipeline(RDD::PipelineID p_pipeline, BitField<RDD::PipelineStageBits> p_pipeline_stage_bits);
void add_draw_list_bind_uniform_set(RDD::ShaderID p_shader, RDD::UniformSetID p_uniform_set, uint32_t set_index);