28#include <SDL3/SDL_gpu.h>
29#include <SDL3/SDL_surface.h>
31#include <Objectively/Data.h>
32#include <Objectively/Object.h>
51typedef struct RenderDeviceInterface RenderDeviceInterface;
130struct RenderDeviceInterface {
135 ObjectInterface objectInterface;
191 Buffer *(*createBufferWithConstMem)(
RenderDevice *self, SDL_GPUBufferUsageFlags usage,
const void *mem, Uint32 size);
204 Buffer *(*createBufferWithData)(
RenderDevice *self, SDL_GPUBufferUsageFlags usage,
const Data *data);
343 Texture *(*createTexture)(
RenderDevice *self,
const SDL_GPUTextureCreateInfo *info,
const void *pixels);
375 Texture *(*createSolidColorTexture)(
RenderDevice *self, SDL_GPUTextureType type, Uint32 layerCount, Uint32 rgba);
421 SDL_GPUTextureFormat (*getSwapchainTextureFormat)(
const RenderDevice *self);
463 Shader *(*loadShader)(
RenderDevice *self,
const char *name,
const SDL_GPUShaderCreateInfo *info);
507 const char *vertexShaderName,
const SDL_GPUShaderCreateInfo *vertexShaderInfo,
508 const char *fragmentShaderName,
const SDL_GPUShaderCreateInfo *fragmentShaderInfo,
509 SDL_GPUGraphicsPipelineCreateInfo *info);
521 bool (*setAllowedFramesInFlight)(
const RenderDevice *self, Uint32 allowed);
546 bool (*setSwapchainParameters)(
const RenderDevice *self, SDL_GPUSwapchainComposition composition, SDL_GPUPresentMode mode);
558 void (*setWindow)(
RenderDevice *self, SDL_Window *window);
568 bool (*supportsPresentMode)(
const RenderDevice *self, SDL_GPUPresentMode mode);
578 bool (*supportsSwapchainComposition)(
const RenderDevice *self, SDL_GPUSwapchainComposition composition);
590 bool (*textureSupportsFormat)(
const RenderDevice *self, SDL_GPUTextureFormat format, SDL_GPUTextureType type, SDL_GPUTextureUsageFlags usage);
601 bool (*textureSupportsSampleCount)(
const RenderDevice *self, SDL_GPUTextureFormat format, SDL_GPUSampleCount sample_count);
static void generateMipmaps(const CommandBuffer *self, SDL_GPUTexture *texture)
Definition CommandBuffer.c:157
CommandBuffer wraps an SDL_GPUCommandBuffer for a single frame.
QueryPool wraps an SDL_GPUQueryPool, owning its handle and metadata.
OBJECTIVELYGPU_EXPORT Class * _RenderDevice(void)
Definition RenderDevice.c:716
#define OBJECTIVELYGPU_EXPORT
Definition Types.h:35
An SDL_GPUBuffer (vertex, index, indirect, storage, etc.) and its metadata.
Definition Buffer.h:60
A recorded sequence of GPU commands for a single frame.
Definition CommandBuffer.h:80
An SDL_GPUComputePipeline: a compiled compute program and its binding layout.
Definition ComputePipeline.h:50
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:127
Parameters for creating a Framebuffer.
Definition Framebuffer.h:56
An SDL_GPUGraphicsPipeline: the compiled vertex/fragment program plus all fixed-function render state...
Definition GraphicsPipeline.h:51
An SDL_GPUQueryPool and its metadata.
Definition QueryPool.h:96
The RenderDevice encapsulates an SDL_GPUDevice and provides methods for allocating GPU resources,...
Definition RenderDevice.h:63
SDL_GPUShaderFormat shaderFormats
Definition RenderDevice.h:89
float maxAnisotropy
The anisotropic filtering level applied by createSamplerLinearRepeat and createSamplerLinearClamp....
Definition RenderDevice.h:97
SDL_GPUDevice * device
The SDL_GPUDevice.
Definition RenderDevice.h:79
Object object
The superclass.
Definition RenderDevice.h:68
RenderDeviceInterface * interface
The interface.
Definition RenderDevice.h:74
Framebuffer * framebuffer
The present-target Framebuffer driven by beginFrame/endFrame, or NULL.
Definition RenderDevice.h:104
SDL_Window * window
The SDL_Window associated with device.
Definition RenderDevice.h:84
ident data
User data.
Definition RenderDevice.h:124
Definition QueryPool.h:61
An SDL_GPUSampler describing texture filter and address modes.
Definition Sampler.h:51
An SDL_GPUShader: one compiled programmable stage of a graphics pipeline.
Definition Shader.h:51
The swapchain texture acquired for a single frame.
Definition CommandBuffer.h:49
An SDL_GPUTexture and the metadata describing it.
Definition Texture.h:60
A CPU-accessible SDL_GPUTransferBuffer for staging data to or from the GPU.
Definition TransferBuffer.h:59