载入中...
搜索中...
未找到
FrameCapture.cpp
浏览该文件的文档.
20 return p == FrameCapturePhase::Failed || p == FrameCapturePhase::Cancelled || p == FrameCapturePhase::Expired ||
31 if (it == names.end()) return failure<FrameAttachment>("UnknownAttachment: " + std::string(name));
100 if (request.attachments.empty() || request.attachments.size() > names.size() || request.timeout.count() < 100 ||
127 if (live >= 16 || impl_->used() >= impl_->caps.maxBytes) return failure<std::string>("BudgetExceeded");
154 e.snapshot.phase == FrameCapturePhase::Ready ? FrameCapturePhase::Released : FrameCapturePhase::Cancelled;
194Result<void> FrameCaptureStore::complete(std::string_view token, FrameCaptureSnapshot snapshot) {
197 if (it == impl_->entries.end() || it->second.snapshot.phase != FrameCapturePhase::ReadbackPending)
215 if (seen != std::set<FrameAttachment>(e.request.attachments.begin(), e.request.attachments.end()) ||
std::vector< std::unique_ptr< ScriptClimbingEventSink > > live
Definition ClimbingServices.cpp:187
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
Graphics-owned state machine and immutable CPU snapshot authority. @thread Main-thread only; supplied...
Definition FrameCapture.h:133
std::optional< std::pair< std::string, FrameCaptureRequest > > queued()
Find pending work, or an empty value when idle.
Definition FrameCapture.cpp:168
Result< void > begin(std::string_view token, uint64_t frameId, size_t bytes)
Reserve CPU plus GPU storage before recording any commands.
Definition FrameCapture.cpp:174
FrameCaptureStore()
Construct a bounded store with an injectable monotonic clock.
Definition FrameCapture.cpp:66
Result< void > complete(std::string_view token, FrameCaptureSnapshot snapshot)
Atomically publish all copied attachments; no partial ready result.
Definition FrameCapture.cpp:194
std::function< std::chrono::steady_clock::time_point()> Clock
Definition FrameCapture.h:135
void retire(std::string_view token)
Release staging reservations after GPU completion, including cancelled work.
Definition FrameCapture.cpp:243
~FrameCaptureStore() override
Destroy CPU snapshots; backend must retire its GPU staging first.
Result< std::string > request(FrameCaptureRequest request) override
Reserve a request. @cost Selected attachments require per-pixel readback at recording.
Definition FrameCapture.cpp:98
void configure(FrameCaptureCapabilities capabilities)
Set backend support at provider initialization.
Definition FrameCapture.cpp:72
Result< void > fail(std::string_view token, std::string reason)
Publish a terminal diagnostic; retain reservation until retire().
Definition FrameCapture.cpp:232
Result< void > submitted(std::string_view token)
Mark a recorded batch submitted to the GPU.
Definition FrameCapture.cpp:187
void invalidate() override
Revoke all tokens and increment the generation.
Definition FrameCapture.cpp:159
FrameCaptureCapabilities capabilities() const override
Inspect supported attachment classes and memory budget.
Definition FrameCapture.cpp:76
Result< FrameCaptureSnapshot > snapshot(std::string_view token) override
Return immutable owning metadata without GPU access.
Definition FrameCapture.cpp:138
Result< FrameCapturePhase > release(std::string_view token) override
Release a snapshot or cancel an in-flight request.
Definition FrameCapture.cpp:145
void collect()
Expire queued and ready entries; also called by tool operations.
Definition FrameCapture.cpp:77
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
@ InvalidArgument
@ NotFound
@ Unsupported
FrameCapturePhase
Capture progress; Ready is published only after all selected copies complete.
Definition FrameCapture.h:33
@ ReadbackPending
@ Expired
@ Queued
@ Cancelled
@ Recording
@ Failed
@ Released
constexpr size_t framePixelBytes(FramePixelFormat format)
Packed CPU bytes per pixel; pure value query, callable on any thread.
Definition FrameCapture.h:46
std::string_view frameAttachmentName(FrameAttachment a)
Stable protocol spelling of an attachment.
Definition FrameCapture.cpp:25
Result< FrameAttachment > parseFrameAttachment(std::string_view name)
Validate a protocol attachment name without inventing a resource.
Definition FrameCapture.cpp:29
FrameAttachment
Stable logical render attachments; Depth and Velocity share storage.
Definition FrameCapture.h:19
std::string_view frameCapturePhaseName(FrameCapturePhase p)
Stable protocol spelling of a progress state.
Definition FrameCapture.cpp:34
Definition Container.h:602
Backend support is explicit; candidates need not be produced in every frame.
Definition FrameCapture.h:99
Owning request; timeout uses monotonic wall time, never gameplay time.
Definition FrameCapture.h:63
Owning snapshot metadata; byte storage is immutable and lease-owned.
Definition FrameCapture.h:84
std::chrono::steady_clock::time_point deadline
Definition FrameCapture.cpp:45
FrameCaptureSnapshot snapshot
Definition FrameCapture.cpp:44
FrameCaptureRequest request
Definition FrameCapture.cpp:43
std::map< std::string, Entry, std::less<> > entries
Definition FrameCapture.cpp:52
std::vector< std::pair< std::weak_ptr< const std::vector< uint8_t > >, size_t > > leases
Definition FrameCapture.cpp:53