ImageUsage

sg_image_usage

Describes the intended usage of an image object:

.storage_image (default: false) the image can be used as parent resource of a storage-image-view, which allows compute shaders to write to the image in a compute pass (for read-only access in compute shaders bind the image via a texture view instead .color_attachment (default: false) the image can be used as parent resource of a color-attachment-view, which is then passed into sg_begin_pass via sg_pass.attachments.colors[] so that fragment shaders can render into the image .resolve_attachment (default: false) the image can be used as parent resource of a resolve-attachment-view, which is then passed into sg_begin_pass via sg_pass.attachments.resolves[] as target for an MSAA-resolve operation in sg_end_pass() .depth_stencil_attachment (default: false) the image can be used as parent resource of a depth-stencil-attachmnet-view which is then passes into sg_begin_pass via sg_pass.attachments.depth_stencil as depth-stencil-buffer .immutable (default: true) the image content cannot be updated from the CPU side (but may be updated by the GPU in a render- or compute-pass) .dynamic_update (default: false) the image content is updated infrequently by the CPU .stream_update (default: false) the image content is updated each frame by the CPU via

Note that creating a texture view from the image to be used for texture-sampling in vertex-, fragment- or compute-shaders is always implicitly allowed.

Members

Variables

_immutable
bool _immutable;
Undocumented in source.
color_attachment
bool color_attachment;
Undocumented in source.
depth_stencil_attachment
bool depth_stencil_attachment;
Undocumented in source.
dynamic_update
bool dynamic_update;
Undocumented in source.
resolve_attachment
bool resolve_attachment;
Undocumented in source.
storage_image
bool storage_image;
Undocumented in source.
stream_update
bool stream_update;
Undocumented in source.

Meta