1#ifndef SBGL_GRAPHICS_HAL_H
2#define SBGL_GRAPHICS_HAL_H
112 int32_t vertexOffset,
113 uint32_t instanceCount
void sbgl_gfx_Shutdown(sbgl_GfxContext *ctx)
void sbgl_gfx_Draw(sbgl_GfxContext *ctx, uint32_t vertexCount, uint32_t firstVertex, uint32_t instanceCount)
sbgl_GfxContext * sbgl_gfx_Init(sbgl_Window *window, struct SblArena *arena, const sbgl_ResourceLimits *limits, bool enableValidation)
Initializes the graphics backend with configurable resource limits.
sbgl_Buffer sbgl_gfx_CreateBuffer(sbgl_GfxContext *ctx, sbgl_BufferUsage usage, size_t size, const void *data)
void sbgl_gfx_EndRenderPass(sbgl_GfxContext *ctx)
Ends the current graphics rendering pass.
void sbgl_gfx_DestroyBuffer(sbgl_GfxContext *ctx, sbgl_Buffer buffer)
uint64_t sbgl_gfx_GetBufferDeviceAddress(sbgl_GfxContext *ctx, sbgl_Buffer buffer)
Retrieves the 64-bit GPU virtual address for a buffer.
void sbgl_gfx_BindPipeline(sbgl_GfxContext *ctx, sbgl_Pipeline pipeline)
void sbgl_gfx_BindBuffer(sbgl_GfxContext *ctx, sbgl_Buffer buffer, sbgl_BufferUsage usage)
bool sbgl_gfx_BeginFrame(sbgl_GfxContext *ctx)
Starts a new frame, acquiring an image and starting the command buffer.
void sbgl_gfx_MemoryBarrier(sbgl_GfxContext *ctx, sbgl_BarrierType type)
void sbgl_gfx_UnmapBuffer(sbgl_GfxContext *ctx, sbgl_Buffer buffer)
void sbgl_gfx_DestroyComputePipeline(sbgl_GfxContext *ctx, sbgl_ComputePipeline pipeline)
float sbgl_gfx_GetGpuTime(sbgl_GfxContext *ctx)
Retrieves the elapsed GPU time for the previous frame in milliseconds.
void sbgl_gfx_DrawIndexed(sbgl_GfxContext *ctx, uint32_t indexCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t instanceCount)
sbgl_Shader sbgl_gfx_LoadShader(sbgl_GfxContext *ctx, sbgl_ShaderStage stage, const uint32_t *bytecode, size_t size)
sbgl_Pipeline sbgl_gfx_CreatePipeline(sbgl_GfxContext *ctx, const sbgl_PipelineConfig *config)
void sbgl_gfx_PushConstants(sbgl_GfxContext *ctx, size_t size, const void *data)
void * sbgl_gfx_MapBuffer(sbgl_GfxContext *ctx, sbgl_Buffer buffer)
void sbgl_gfx_DrawIndirect(sbgl_GfxContext *ctx, sbgl_Buffer buffer, size_t offset, uint32_t drawCount)
Submits a batch of draw calls stored in a GPU buffer.
void sbgl_gfx_FillBuffer(sbgl_GfxContext *ctx, sbgl_Buffer buffer, size_t offset, size_t size, uint32_t value)
Performs a hardware-accelerated buffer fill.
sbgl_GfxTransientAllocation sbgl_gfx_AllocateTransient(sbgl_GfxContext *ctx, size_t size, uint32_t alignment)
Allocates a slice of GPU-visible memory for transient per-frame data.
void sbgl_gfx_DestroyShader(sbgl_GfxContext *ctx, sbgl_Shader shader)
sbgl_ComputePipeline sbgl_gfx_CreateComputePipeline(sbgl_GfxContext *ctx, sbgl_Shader shader)
void sbgl_gfx_DeviceWaitIdle(sbgl_GfxContext *ctx)
void sbgl_gfx_DestroyPipeline(sbgl_GfxContext *ctx, sbgl_Pipeline pipeline)
int32_t sbgl_gfx_GetLastVkResult(sbgl_GfxContext *ctx)
Retrieves the last VkResult from the backend for error inspection.
void sbgl_gfx_DestroyBufferDeferred(sbgl_GfxContext *ctx, sbgl_Buffer buffer)
Marks a buffer for destruction after current frames complete.
uint32_t sbgl_gfx_GetFrameIndex(sbgl_GfxContext *ctx)
Retrieves the current backend frame index.
void sbgl_gfx_EndFrame(sbgl_GfxContext *ctx)
Submits the current frame's commands and presents the image.
void sbgl_gfx_BindComputePipeline(sbgl_GfxContext *ctx, sbgl_ComputePipeline pipeline)
void sbgl_gfx_DispatchCompute(sbgl_GfxContext *ctx, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ)
void sbgl_gfx_BeginRenderPass(sbgl_GfxContext *ctx, float r, float g, float b, float a)
Starts a graphics rendering pass.
sbgl_BufferUsage
Buffer usage flags.
sbgl_BarrierType
Memory barrier types for compute synchronization.
uint32_t sbgl_Buffer
Handle for a GPU-side buffer.
uint32_t sbgl_Shader
Handle for a shader module.
sbgl_ShaderStage
Shader stage flags.
uint32_t sbgl_ComputePipeline
Handle for a compute pipeline.
uint32_t sbgl_Pipeline
Handle for a graphics pipeline.
sbgl_ResourceLimits limits
Represents a slice of a persistent GPU buffer used for transient data.
Configuration for creating a graphics pipeline.
Resource limits for engine initialization.