Add renderer draw descriptor contract

This commit is contained in:
2026-06-02 16:27:28 +02:00
parent 58f163788b
commit 483bbb4a9c
8 changed files with 157 additions and 31 deletions

View File

@@ -316,7 +316,7 @@ pp::foundation::Status RecordingCommandContext::bind_mesh(IMesh& mesh) noexcept
return pp::foundation::Status::success();
}
pp::foundation::Status RecordingCommandContext::draw() noexcept
pp::foundation::Status RecordingCommandContext::draw(DrawDesc desc) noexcept
{
if (!in_render_pass_) {
return pp::foundation::Status::invalid_argument("render pass has not begun");
@@ -328,9 +328,15 @@ pp::foundation::Status RecordingCommandContext::draw() noexcept
return pp::foundation::Status::invalid_argument("mesh must be bound before draw");
}
const auto draw_status = validate_draw_desc(active_mesh_, desc);
if (!draw_status.ok()) {
return draw_status;
}
push_command(commands_, RecordedRenderCommand {
.kind = RecordedRenderCommandKind::draw,
.mesh_desc = active_mesh_,
.draw_desc = desc,
});
return pp::foundation::Status::success();
}