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 creationDynamic
: 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
Auto Trait Implementations
impl RefUnwindSafe for ResourceUsage
impl Send for ResourceUsage
impl Sync for ResourceUsage
impl Unpin for ResourceUsage
impl UnwindSafe for ResourceUsage
Blanket Implementations
Mutably borrows from an owned value. Read more