26#include <SDL3/SDL_gpu.h>
28#include <Objectively/Object.h>
39typedef struct FramebufferInterface FramebufferInterface;
47#define GPU_MAX_COLOR_TARGETS 4
253struct FramebufferInterface {
258 ObjectInterface objectInterface;
275 SDL_GPUColorTargetInfo (*colorTargetInfo)(
const Framebuffer *self, Uint32 index, SDL_GPULoadOp loadOp, SDL_GPUStoreOp storeOp);
292 SDL_GPUColorTargetInfo (*colorTargetInfoForLayer)(
const Framebuffer *self, Uint32 index, Uint32 layer, SDL_GPULoadOp loadOp, SDL_GPUStoreOp storeOp);
306 SDL_GPUDepthStencilTargetInfo (*depthTargetInfo)(
const Framebuffer *self, SDL_GPULoadOp loadOp, SDL_GPUStoreOp storeOp);
321 void (*pipelineTargetInfo)(
const Framebuffer *self,
const SDL_GPUColorTargetBlendState *blendStates,
322 SDL_GPUColorTargetDescription *descriptions, SDL_GPUGraphicsPipelineTargetInfo *targetInfo);
#define GPU_MAX_COLOR_TARGETS
The maximum number of color attachments a Framebuffer may have.
Definition Framebuffer.h:47
OBJECTIVELYGPU_EXPORT Class * _Framebuffer(void)
Definition Framebuffer.c:346
#define OBJECTIVELYGPU_EXPORT
Definition Types.h:35
An off-screen render target grouping a color and/or depth texture.
Definition Framebuffer.h:194
SDL_Size size
The framebuffer dimensions.
Definition Framebuffer.h:216
Object object
The superclass.
Definition Framebuffer.h:199
GPU_FramebufferAttachment colorAttachments[GPU_MAX_COLOR_TARGETS]
The color attachments, indices [0, numColorTargets).
Definition Framebuffer.h:226
Uint32 numColorAttachments
The number of color attachments; indices [0, numColorTargets) are valid.
Definition Framebuffer.h:231
RenderDevice * device
The owning RenderDevice, used for texture allocation and dealloc.
Definition Framebuffer.h:211
FramebufferInterface * interface[0]
The interface type.
Definition Framebuffer.h:205
GPU_FramebufferAttachment depthAttachment
The depth attachment, or format SDL_GPU_TEXTUREFORMAT_INVALID if none.
Definition Framebuffer.h:236
ident data
User data.
Definition Framebuffer.h:247
SDL_GPUSampleCount sampleCount
The MSAA sample count of all color and depth attachments.
Definition Framebuffer.h:221
Describes, and backs, a single Framebuffer attachment (color or depth).
Definition Framebuffer.h:62
SDL_FColor clearColor
The clear color, for color attachments.
Definition Framebuffer.h:74
SDL_GPUTextureFormat format
The attachment format, or SDL_GPU_TEXTUREFORMAT_INVALID to omit (depth only).
Definition Framebuffer.h:67
Uint32 layerCount
The number of array layers, or 0 or 1 for a plain 2D attachment.
Definition Framebuffer.h:99
bool doubleBuffered
If true, this attachment is double-buffered; see above.
Definition Framebuffer.h:86
float clearDepth
The clear depth value, for the depth attachment.
Definition Framebuffer.h:80
Parameters for creating a Framebuffer.
Definition Framebuffer.h:124
GPU_FramebufferAttachment colorAttachments[GPU_MAX_COLOR_TARGETS]
The color attachments, one per render target (MRT).
Definition Framebuffer.h:139
SDL_Size size
Initial framebuffer dimensions.
Definition Framebuffer.h:131
GPU_FramebufferAttachment depthAttachment
The depth attachment, or format SDL_GPU_TEXTUREFORMAT_INVALID to omit.
Definition Framebuffer.h:151
Uint32 numColorTargets
The number of color attachments; 0 to omit color entirely.
Definition Framebuffer.h:144
SDL_GPUSampleCount sampleCount
MSAA sample count; SDL_GPU_SAMPLECOUNT_1 for no multisampling.
Definition Framebuffer.h:158
The RenderDevice encapsulates an SDL_GPUDevice and provides methods for allocating GPU resources,...
Definition RenderDevice.h:63
The SDL_Size type.
Definition Types.h:47
An SDL_GPUTexture and the metadata describing it.
Definition Texture.h:60