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;
138struct RenderDeviceInterface {
143 ObjectInterface objectInterface;
203 Buffer *(*createBufferWithConstMem)(
RenderDevice *self, SDL_GPUBufferUsageFlags usage,
const void *mem, Uint32 size);
216 Buffer *(*createBufferWithData)(
RenderDevice *self, SDL_GPUBufferUsageFlags usage,
const Data *data);
355 Texture *(*createTexture)(
RenderDevice *self,
const SDL_GPUTextureCreateInfo *info,
const void *pixels);
387 Texture *(*createSolidColorTexture)(
RenderDevice *self, SDL_GPUTextureType type, Uint32 layerCount, Uint32 rgba);
437 SDL_GPUTextureFormat (*getSwapchainTextureFormat)(
const RenderDevice *self);
481 Shader *(*loadShader)(
RenderDevice *self,
const char *name,
const SDL_GPUShaderCreateInfo *info);
525 const char *vertexShaderName,
const SDL_GPUShaderCreateInfo *vertexShaderInfo,
526 const char *fragmentShaderName,
const SDL_GPUShaderCreateInfo *fragmentShaderInfo,
527 SDL_GPUGraphicsPipelineCreateInfo *info);
539 bool (*setAllowedFramesInFlight)(
const RenderDevice *self, Uint32 allowed);
564 bool (*setSwapchainParameters)(
const RenderDevice *self, SDL_GPUSwapchainComposition composition, SDL_GPUPresentMode mode);
576 void (*setWindow)(
RenderDevice *self, SDL_Window *window);
601 bool (*supportsPresentMode)(
const RenderDevice *self, SDL_GPUPresentMode mode);
611 bool (*supportsSwapchainComposition)(
const RenderDevice *self, SDL_GPUSwapchainComposition composition);
623 bool (*textureSupportsFormat)(
const RenderDevice *self, SDL_GPUTextureFormat format, SDL_GPUTextureType type, SDL_GPUTextureUsageFlags usage);
634 bool (*textureSupportsSampleCount)(
const RenderDevice *self, SDL_GPUTextureFormat format, SDL_GPUSampleCount sample_count);
static void generateMipmaps(const CommandBuffer *self, SDL_GPUTexture *texture)
Definition CommandBuffer.c:183
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:743
#define OBJECTIVELYGPU_EXPORT
Definition Types.h:35
An SDL_GPUBuffer (vertex, index, indirect, storage, etc.) and its metadata.
Definition Buffer.h:61
A recorded sequence of GPU commands for a single frame.
Definition CommandBuffer.h:81
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:177
Parameters for creating a Framebuffer.
Definition Framebuffer.h:108
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:86
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:132
Definition QueryPool.h:52
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:50
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