Add renderer sampler state contract

This commit is contained in:
2026-06-02 15:56:26 +02:00
parent b68ddc42c6
commit 952a00e7d3
9 changed files with 322 additions and 53 deletions

View File

@@ -217,6 +217,32 @@ pp::foundation::Status RecordingCommandContext::bind_texture(
return pp::foundation::Status::success();
}
pp::foundation::Status RecordingCommandContext::bind_sampler(
std::uint32_t slot,
SamplerDesc sampler) noexcept
{
if (!in_render_pass_) {
return pp::foundation::Status::invalid_argument("render pass has not begun");
}
const auto slot_status = validate_texture_slot(slot);
if (!slot_status.ok()) {
return slot_status;
}
const auto sampler_status = validate_sampler_desc(sampler);
if (!sampler_status.ok()) {
return sampler_status;
}
push_command(commands_, RecordedRenderCommand {
.kind = RecordedRenderCommandKind::bind_sampler,
.sampler_desc = sampler,
.sampler_slot = slot,
});
return pp::foundation::Status::success();
}
pp::foundation::Status RecordingCommandContext::bind_mesh(IMesh& mesh) noexcept
{
if (!in_render_pass_) {
@@ -464,6 +490,8 @@ const char* recorded_render_command_kind_name(RecordedRenderCommandKind kind) no
return "bind_shader";
case RecordedRenderCommandKind::bind_texture:
return "bind_texture";
case RecordedRenderCommandKind::bind_sampler:
return "bind_sampler";
case RecordedRenderCommandKind::bind_mesh:
return "bind_mesh";
case RecordedRenderCommandKind::draw: