Reset recording renderer state on clear
This commit is contained in:
@@ -594,6 +594,15 @@ bool RecordingCommandContext::in_render_pass() const noexcept
|
||||
return in_render_pass_;
|
||||
}
|
||||
|
||||
void RecordingCommandContext::reset() noexcept
|
||||
{
|
||||
active_target_ = TextureDesc {};
|
||||
active_mesh_ = MeshDesc {};
|
||||
in_render_pass_ = false;
|
||||
shader_bound_ = false;
|
||||
mesh_bound_ = false;
|
||||
}
|
||||
|
||||
RecordingRenderTrace::RecordingRenderTrace(std::vector<RecordedRenderCommand>& commands) noexcept
|
||||
: commands_(&commands)
|
||||
{
|
||||
@@ -643,6 +652,11 @@ pp::foundation::Status RecordingRenderTrace::end_scope() noexcept
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
void RecordingRenderTrace::reset() noexcept
|
||||
{
|
||||
scope_depth_ = 0U;
|
||||
}
|
||||
|
||||
RecordingRenderDevice::RecordingRenderDevice() noexcept
|
||||
: context_(commands_)
|
||||
, trace_(commands_)
|
||||
@@ -757,6 +771,8 @@ std::span<const RecordedRenderCommand> RecordingRenderDevice::commands() const n
|
||||
void RecordingRenderDevice::clear() noexcept
|
||||
{
|
||||
commands_.clear();
|
||||
context_.reset();
|
||||
trace_.reset();
|
||||
}
|
||||
|
||||
const char* recorded_render_command_kind_name(RecordedRenderCommandKind kind) noexcept
|
||||
|
||||
Reference in New Issue
Block a user