Add renderer depth state contract

This commit is contained in:
2026-06-02 15:50:59 +02:00
parent 9a7e1c4def
commit b68ddc42c6
9 changed files with 243 additions and 58 deletions

View File

@@ -158,6 +158,24 @@ pp::foundation::Status RecordingCommandContext::set_blend_state(BlendState state
return pp::foundation::Status::success();
}
pp::foundation::Status RecordingCommandContext::set_depth_state(DepthState state) noexcept
{
if (!in_render_pass_) {
return pp::foundation::Status::invalid_argument("render pass has not begun");
}
const auto status = validate_depth_state(state);
if (!status.ok()) {
return status;
}
push_command(commands_, RecordedRenderCommand {
.kind = RecordedRenderCommandKind::set_depth_state,
.depth_state = state,
});
return pp::foundation::Status::success();
}
pp::foundation::Status RecordingCommandContext::bind_shader(IShaderProgram& shader) noexcept
{
if (!in_render_pass_) {
@@ -440,6 +458,8 @@ const char* recorded_render_command_kind_name(RecordedRenderCommandKind kind) no
return "set_scissor";
case RecordedRenderCommandKind::set_blend_state:
return "set_blend_state";
case RecordedRenderCommandKind::set_depth_state:
return "set_depth_state";
case RecordedRenderCommandKind::bind_shader:
return "bind_shader";
case RecordedRenderCommandKind::bind_texture: