Add renderer draw descriptor contract
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user