Skip to content

Engine → Assets → asset_loader.h

asset_loader

Syntax

class CONJURE_API asset_loader

Derived Classes

Classes that use this as a base

Constructors

AccessSignatureDescription
publicasset_loader();

Important

Copy constructor and assignment has been deleted.

Destructors

AccessSignatureDescription
publicvirtual ~asset_loader();

Functions

Public

create_fallback

[[nodiscard]] virtual core::result<asset_payload> create_fallback() const;

Main thread, once per type, lazily (or at registration with PINNED_FALLBACK). The default returns a null payload, meaning "no fallback".

finalise

[[nodiscard]] virtual core::result<asset_payload> finalise(
    const finalise_context &context,
    asset_payload &&cpuOutput) const = 0;

Main thread. Turns the intermediate into the published payload.

load_cpu

[[nodiscard]] virtual core::result<asset_payload> load_cpu(
    const load_context &context,
    std::span<const std::byte> payloadBytes) const = 0;

Worker thread. Decodes the payload bytes into an intermediate that owns its data; the bytes are valid only for the duration of the call.

type

[[nodiscard]] virtual asset_type_id type() const noexcept = 0;

The type this loader produces.