26#include <Objectively/Object.h>
42typedef struct CommandBufferInterface CommandBufferInterface;
127struct CommandBufferInterface {
132 ObjectInterface objectInterface;
162 ComputePass *(*beginComputePass)(
CommandBuffer *self,
const SDL_GPUStorageTextureReadWriteBinding *storageTextures, Uint32 numStorageTextures,
const SDL_GPUStorageBufferReadWriteBinding *storageBuffers, Uint32 numStorageBuffers);
187 RenderPass *(*beginRenderPass)(
CommandBuffer *self,
const SDL_GPUColorTargetInfo *colorTargets, Uint32 numColorTargets,
const SDL_GPUDepthStencilTargetInfo *depthStencil);
static void blitTexture(const CommandBuffer *self, const SDL_GPUBlitInfo *info)
Definition CommandBuffer.c:158
static bool cancel(CommandBuffer *self)
Definition CommandBuffer.c:166
static void generateMipmaps(const CommandBuffer *self, SDL_GPUTexture *texture)
Definition CommandBuffer.c:183
static bool acquireSwapchainTexture(const CommandBuffer *self, SwapchainTexture *swapchain)
Definition CommandBuffer.c:57
OBJECTIVELYGPU_EXPORT Class * _CommandBuffer(void)
Definition CommandBuffer.c:356
struct Fence Fence
Definition CommandBuffer.h:37
#define OBJECTIVELYGPU_EXPORT
Definition Types.h:35
A recorded sequence of GPU commands for a single frame.
Definition CommandBuffer.h:81
RenderDevice * device
The RenderDevice that this CommandBuffer belongs to.
Definition CommandBuffer.h:102
void pushVertexUniformData(const CommandBuffer *self, Uint32 slot, const void *data, Uint32 length)
Pushes uniform data for the current vertex shader.
Definition CommandBuffer.c:250
void pushDebugGroup(const CommandBuffer *self, const char *name)
Begins a named debug group in the command stream.
Definition CommandBuffer.c:234
Object object
The superclass.
Definition CommandBuffer.h:86
void pushUniformData(const CommandBuffer *self, Uint32 slot, const void *data, Uint32 length)
Pushes the same uniform data to slot for both the current vertex and fragment shaders.
Definition CommandBuffer.c:258
void insertDebugLabel(const CommandBuffer *self, const char *text)
Inserts an arbitrary debug label into the command stream.
Definition CommandBuffer.c:210
CommandBufferInterface * interface[0]
The interface type.
Definition CommandBuffer.h:92
bool waitAndAcquireSwapchainTexture(const CommandBuffer *self, SwapchainTexture *swapchain)
Blocks until a swapchain texture is available, then acquires it.
Definition CommandBuffer.c:301
void pushFragmentUniformData(const CommandBuffer *self, Uint32 slot, const void *data, Uint32 length)
Pushes uniform data for the current fragment shader.
Definition CommandBuffer.c:242
void popDebugGroup(const CommandBuffer *self)
Ends the innermost active debug group.
Definition CommandBuffer.c:218
bool submit(CommandBuffer *self)
Submits this command buffer to the GPU for execution.
Definition CommandBuffer.c:267
ident data
User data.
Definition CommandBuffer.h:121
SDL_GPUCommandBuffer * commands
The underlying SDL command buffer.
Definition CommandBuffer.h:97
void pushComputeUniformData(const CommandBuffer *self, Uint32 slot, const void *data, Uint32 length)
Pushes uniform data for the current compute shader.
Definition CommandBuffer.c:226
A scoped compute pass for recording GPU compute dispatches.
Definition ComputePass.h:56
A scoped copy pass for uploading CPU data and copying GPU resources.
Definition CopyPass.h:55
An SDL_GPUFence, signaled once a submitted CommandBuffer's GPU work completes.
Definition Fence.h:55
An off-screen render target grouping a color and/or depth texture.
Definition Framebuffer.h:194
The RenderDevice encapsulates an SDL_GPUDevice and provides methods for allocating GPU resources,...
Definition RenderDevice.h:63
A scoped render pass for recording draw commands into a CommandBuffer.
Definition RenderPass.h:57
The SDL_Size type.
Definition Types.h:47
The swapchain texture acquired for a single frame.
Definition CommandBuffer.h:50
SDL_GPUTexture * texture
The swapchain render target for this frame.
Definition CommandBuffer.h:55
SDL_Size size
The swapchain dimensions in pixels.
Definition CommandBuffer.h:65
SDL_GPUTextureFormat format
The swapchain texture format.
Definition CommandBuffer.h:60