Add renderer render pass clear contract

This commit is contained in:
2026-06-02 16:23:02 +02:00
parent 8232b0efc8
commit 58f163788b
9 changed files with 191 additions and 41 deletions

View File

@@ -2297,7 +2297,11 @@ int record_render(int argc, char** argv)
const auto begin_status = context.begin_render_pass(
*target.value(),
pp::renderer::ClearColor { .r = 0.0F, .g = 0.0F, .b = 0.0F, .a = 1.0F });
pp::renderer::RenderPassDesc {
.clear_color = pp::renderer::ClearColor { .r = 0.0F, .g = 0.0F, .b = 0.0F, .a = 1.0F },
.clear_depth_enabled = true,
.clear_depth = 1.0F,
});
if (!begin_status.ok()) {
print_error("record-render", begin_status.message);
return 2;
@@ -2435,6 +2439,9 @@ int record_render(int argc, char** argv)
std::size_t capture_commands = 0;
std::size_t blit_commands = 0;
std::size_t trace_markers = 0;
std::size_t render_passes = 0;
std::size_t depth_clears = 0;
std::size_t stencil_clears = 0;
std::uint64_t draw_vertices = 0;
std::uint64_t draw_indices = 0;
std::uint64_t uniform_bytes = 0;
@@ -2446,7 +2453,15 @@ int record_render(int argc, char** argv)
std::uint64_t blit_destination_bytes = 0;
const auto commands = device.commands();
for (const auto& command : commands) {
if (command.kind == pp::renderer::RecordedRenderCommandKind::draw) {
if (command.kind == pp::renderer::RecordedRenderCommandKind::begin_render_pass) {
++render_passes;
if (command.clear_depth_enabled) {
++depth_clears;
}
if (command.clear_stencil_enabled) {
++stencil_clears;
}
} else if (command.kind == pp::renderer::RecordedRenderCommandKind::draw) {
++draw_commands;
draw_vertices += command.mesh_desc.vertex_count;
draw_indices += command.mesh_desc.index_count;
@@ -2492,6 +2507,9 @@ int record_render(int argc, char** argv)
<< ",\"format\":\"rgba8\"}"
<< ",\"createdResources\":" << created_resources
<< ",\"commands\":" << commands.size()
<< ",\"renderPasses\":" << render_passes
<< ",\"depthClears\":" << depth_clears
<< ",\"stencilClears\":" << stencil_clears
<< ",\"drawCommands\":" << draw_commands
<< ",\"drawVertices\":" << draw_vertices
<< ",\"drawIndices\":" << draw_indices