Creation parameters for an sg_attachments object, used as argument to the
sg_make_attachments() function.
An attachments object bundles either bundles 'render attachments' for
a render pass, or 'storage attachments' for a compute pass which writes
to storage images.
Render attachments are:
- 0..4 color attachment images
- 0..4 msaa-resolve attachment images
- 0 or one depth-stencil attachment image
Note that all types of render attachment images must be created with
sg_image_desc.usage.render_attachment = true. At least one color-attachment
or depth-stencil-attachment image must be provided in a render pass
(only providing a depth-stencil-attachment is useful for depth-only passes).
Alternatively provide 1..4 storage attachment images which must be created
with sg_image_desc.usage.storage_attachment = true.
An sg_attachments object cannot have both render- and storage-attachments.
Each attachment definition consists of an image object, and two additional indices
describing which subimage the pass will render into: one mipmap index, and if the image
is a cubemap, array-texture or 3D-texture, the face-index, array-layer or
depth-slice.
All attachments must have the same width and height.
All color attachments and the depth-stencil attachment must have the
same sample count.
If a resolve attachment is set, an MSAA-resolve operation from the
associated color attachment image into the resolve attachment image will take
place in the sg_end_pass() function. In this case, the color attachment
must have a (sample_count>1), and the resolve attachment a
(sample_count==1). The resolve attachment also must have the same pixel
format as the color attachment.
NOTE that MSAA depth-stencil attachments cannot be msaa-resolved!
sg_attachments_desc
Creation parameters for an sg_attachments object, used as argument to the sg_make_attachments() function.
An attachments object bundles either bundles 'render attachments' for a render pass, or 'storage attachments' for a compute pass which writes to storage images.
Render attachments are:
- 0..4 color attachment images - 0..4 msaa-resolve attachment images - 0 or one depth-stencil attachment image
Note that all types of render attachment images must be created with sg_image_desc.usage.render_attachment = true. At least one color-attachment or depth-stencil-attachment image must be provided in a render pass (only providing a depth-stencil-attachment is useful for depth-only passes).
Alternatively provide 1..4 storage attachment images which must be created with sg_image_desc.usage.storage_attachment = true.
An sg_attachments object cannot have both render- and storage-attachments.
Each attachment definition consists of an image object, and two additional indices describing which subimage the pass will render into: one mipmap index, and if the image is a cubemap, array-texture or 3D-texture, the face-index, array-layer or depth-slice.
All attachments must have the same width and height.
All color attachments and the depth-stencil attachment must have the same sample count.
If a resolve attachment is set, an MSAA-resolve operation from the associated color attachment image into the resolve attachment image will take place in the sg_end_pass() function. In this case, the color attachment must have a (sample_count>1), and the resolve attachment a (sample_count==1). The resolve attachment also must have the same pixel format as the color attachment.
NOTE that MSAA depth-stencil attachments cannot be msaa-resolved!