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

@@ -163,6 +163,27 @@ pp::foundation::Status validate_scissor(ScissorRect scissor, Extent2D target_ext
return pp::foundation::Status::success();
}
pp::foundation::Status validate_render_pass_desc(RenderPassDesc desc) noexcept
{
if (desc.clear_color_enabled
&& (!std::isfinite(desc.clear_color.r)
|| !std::isfinite(desc.clear_color.g)
|| !std::isfinite(desc.clear_color.b)
|| !std::isfinite(desc.clear_color.a))) {
return pp::foundation::Status::invalid_argument("render pass clear color must be finite");
}
if (desc.clear_depth_enabled && !std::isfinite(desc.clear_depth)) {
return pp::foundation::Status::invalid_argument("render pass clear depth must be finite");
}
if (desc.clear_depth_enabled && (desc.clear_depth < 0.0F || desc.clear_depth > 1.0F)) {
return pp::foundation::Status::out_of_range("render pass clear depth must be within 0..1");
}
return pp::foundation::Status::success();
}
pp::foundation::Status validate_blend_factor(BlendFactor factor) noexcept
{
switch (factor) {