|
ObjectivelyGPU
Object oriented graphics framework for SDL3 and C
|
Describes, and backs, a single Framebuffer attachment (color or depth). More...
#include <Framebuffer.h>
Data Fields | ||
| SDL_GPUTextureFormat | format | |
The attachment format, or SDL_GPU_TEXTUREFORMAT_INVALID to omit (depth only). | ||
| union { | ||
| SDL_FColor clearColor | ||
| The clear color, for color attachments. More... | ||
| float clearDepth | ||
| The clear depth value, for the depth attachment. More... | ||
| }; | ||
| bool | doubleBuffered | |
If true, this attachment is double-buffered; see above. | ||
Describes, and backs, a single Framebuffer attachment (color or depth).
format, the clear value, and doubleBuffered are the input description: set them in GPU_FramebufferCreateInfo with a designated initializer. textures and resolveTextures are live state, populated by Framebuffer::resize and owned by the Framebuffer – leave them zeroed in a GPU_FramebufferCreateInfo.
When doubleBuffered is true, the attachment allocates both texture slots and Framebuffer::swap alternates which slot is the current frame's write target, so the other slot remains valid to sample as last frame's contents – e.g. a depth copy sampled by soft particles – without a same-frame write-then-read hazard. Single-buffered attachments (doubleBuffered false) only ever use slot 0.
| union { ... } GPU_FramebufferAttachment |
| SDL_FColor GPU_FramebufferAttachment::clearColor |
The clear color, for color attachments.
Used by Framebuffer::colorTargetInfo and CommandBuffer::beginRenderPassWithFramebuffer.
| float GPU_FramebufferAttachment::clearDepth |
The clear depth value, for the depth attachment.
| bool GPU_FramebufferAttachment::doubleBuffered |
If true, this attachment is double-buffered; see above.
| SDL_GPUTextureFormat GPU_FramebufferAttachment::format |
The attachment format, or SDL_GPU_TEXTUREFORMAT_INVALID to omit (depth only).