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

@@ -94,7 +94,7 @@ RecordingCommandContext::RecordingCommandContext(std::vector<RecordedRenderComma
pp::foundation::Status RecordingCommandContext::begin_render_pass(
IRenderTarget& target,
ClearColor clear_color) noexcept
RenderPassDesc desc) noexcept
{
if (in_render_pass_) {
return pp::foundation::Status::invalid_argument("render pass is already active");
@@ -110,6 +110,11 @@ pp::foundation::Status RecordingCommandContext::begin_render_pass(
return size_status.status();
}
const auto render_pass_status = validate_render_pass_desc(desc);
if (!render_pass_status.ok()) {
return render_pass_status;
}
in_render_pass_ = true;
shader_bound_ = false;
mesh_bound_ = false;
@@ -117,7 +122,12 @@ pp::foundation::Status RecordingCommandContext::begin_render_pass(
push_command(commands_, RecordedRenderCommand {
.kind = RecordedRenderCommandKind::begin_render_pass,
.target_desc = active_target_,
.clear_color = clear_color,
.clear_color_enabled = desc.clear_color_enabled,
.clear_color = desc.clear_color,
.clear_depth_enabled = desc.clear_depth_enabled,
.clear_depth = desc.clear_depth,
.clear_stencil_enabled = desc.clear_stencil_enabled,
.clear_stencil = desc.clear_stencil,
});
return pp::foundation::Status::success();
}