Enum rokol::gfx::ResourceUsage[][src]

#[repr(u32)]
pub enum ResourceUsage {
    _Default,
    Immutable,
    Dynamic,
    Stream,
    _ForceU32,
    _Num,
}
Expand description

Update strategy of buffers and images

Render target image has to have Immutable usage.

Kinds

  • Immutable: Never be updated after creation
  • Dynamic: Updated infrequently (“once after creation” to “quite often but not every frame”)
  • Stream: Updated each frame

The rendering backends use this hint to prevent that the CPU needs to wait for the GPU when attempting to update a resource that might be currently accessed by the GPU.

Update frequency

Resource content is updated with the functions sg_update_buffer() or sg_append_buffer() for buffer objects, and sg_update_image() for image objects.

For the sg_update_*() functions, only one update is allowed per frame and resource object, while sg_append_buffer() can be called multiple times per frame on the same buffer. The application must update all data required for rendering (this means that the update data can be smaller than the resource size, if only a part of the overall resource size is used for rendering, you only need to make sure that the data that is used is valid).

Variants

_Default

Immutable

Dynamic

Stream

_ForceU32

_Num

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.