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;
131struct RenderDeviceInterface {
136 ObjectInterface objectInterface;
196 Buffer *(*createBufferWithConstMem)(
RenderDevice *self, SDL_GPUBufferUsageFlags usage,
const void *mem, Uint32 size);
209 Buffer *(*createBufferWithData)(
RenderDevice *self, SDL_GPUBufferUsageFlags usage,
const Data *data);
348 Texture *(*createTexture)(
RenderDevice *self,
const SDL_GPUTextureCreateInfo *info,
const void *pixels);
381 Texture *(*createSolidColorTexture)(
RenderDevice *self, SDL_GPUTextureType type, Uint32 layerCount, Uint32 rgba);
431 SDL_GPUTextureFormat (*getSwapchainTextureFormat)(
const RenderDevice *self);
475 Shader *(*loadShader)(
RenderDevice *self,
const char *name,
const SDL_GPUShaderCreateInfo *info);
519 const char *vertexShaderName,
const SDL_GPUShaderCreateInfo *vertexShaderInfo,
520 const char *fragmentShaderName,
const SDL_GPUShaderCreateInfo *fragmentShaderInfo,
521 SDL_GPUGraphicsPipelineCreateInfo *info);
533 bool (*setAllowedFramesInFlight)(
const RenderDevice *self, Uint32 allowed);
558 bool (*setSwapchainParameters)(
const RenderDevice *self, SDL_GPUSwapchainComposition composition, SDL_GPUPresentMode mode);
570 void (*setWindow)(
RenderDevice *self, SDL_Window *window);
581 bool (*supportsPresentMode)(
const RenderDevice *self, SDL_GPUPresentMode mode);
591 bool (*supportsSwapchainComposition)(
const RenderDevice *self, SDL_GPUSwapchainComposition composition);
603 bool (*textureSupportsFormat)(
const RenderDevice *self, SDL_GPUTextureFormat format, SDL_GPUTextureType type, SDL_GPUTextureUsageFlags usage);
614 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:719
#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:194
Parameters for creating a Framebuffer.
Definition Framebuffer.h:124
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
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
RenderDeviceInterface * interface[0]
The interface type.
Definition RenderDevice.h:74
ident data
User data.
Definition RenderDevice.h:125
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