Add renderer sampler state contract
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user