|
group2 0.1.0
CSE 125 Group 2
|
Classes | |
| struct | ShaderInfo |
| Descriptor for a single shader stage: file path, stage, and resource counts. More... | |
| struct | VertexInputLayout |
| Vertex buffer layout: stride (pitch) and per-attribute descriptions. More... | |
| struct | PipelineDescription |
| struct | BufferUpload |
| Describes a pending CPU-to-GPU buffer upload: target buffer, source data, and byte size. More... | |
Functions | |
| ImGui_ImplSDLGPU3_InitInfo | createImGuiInfo (SDL_GPUDevice *device, SDL_Window *window) |
| Create an ImGui initialization info struct for SDL3 GPU rendering. | |
| SDL_GPUVertexAttribute | makeAttribute (Uint32 location, SDL_GPUVertexElementFormat format, Uint32 offset, Uint32 bufferSlot=0) |
| Build an SDL_GPUVertexAttribute descriptor. | |
| SDL_GPUColorTargetInfo | makeColorTargetClear (SDL_GPUTexture *texture, SDL_FColor clearColor) |
| Create a color render-target info with a clear color. | |
| SDL_GPUColorTargetInfo | makeColorTargetLoad (SDL_GPUTexture *texture) |
| Create a color render-target info with a clear color. | |
| SDL_GPUDepthStencilTargetInfo | makeDepthTarget (SDL_GPUTexture *texture, Uint8 layer, bool store, bool reverseZ) |
| Create a depth/stencil render-target info that clears to depth 1.0. | |
| SDL_GPUTextureSamplerBinding | makeTextureSamplerBinding (SDL_GPUTexture *texture, SDL_GPUSampler *sampler) |
| Create a texture-sampler binding pair for fragment shader use. | |
| SDL_GPUShaderFormat | selectShaderFormat (SDL_GPUDevice *device) |
| Pick the best available shader format for the given device. | |
| SDL_GPUShader * | loadShader (SDL_GPUDevice *device, const char *path, SDL_GPUShaderFormat format, SDL_GPUShaderStage stage, Uint32 samplerCount, Uint32 uniformBufferCount, Uint32 storageBufferCount, Uint32 storageTextureCount) |
| Load and compile a shader from disk (explicit parameters). | |
| SDL_GPUShader * | loadShader (SDL_GPUDevice *device, const ShaderInfo &shaderInfo, SDL_GPUShaderFormat format) |
| Load and compile a shader from a ShaderInfo descriptor. | |
| SDL_GPUGraphicsPipeline * | createGraphicsDepthPipeline (SDL_GPUDevice *device, PipelineDescription pipelineDesc) |
| SDL_GPUGraphicsPipeline * | createGraphicsPipeline (SDL_GPUDevice *device, SDL_GPUTextureFormat &colorFormat, SDL_GPUShaderFormat shaderFormat, const ShaderInfo &vertexShaderInfo, const ShaderInfo &fragmentShaderInfo, const VertexInputLayout &vertexInputLayout, bool enableDepth=true, bool overBlending=false) |
| Create a full graphics pipeline from vertex/fragment shaders and vertex layout. | |
| SDL_GPUGraphicsPipeline * | createGraphicsPipeline (SDL_GPUDevice *device, const std::vector< SDL_GPUTextureFormat > &colorFormats, SDL_GPUShaderFormat shaderFormat, const ShaderInfo &vertexShaderInfo, const ShaderInfo &fragmentShaderInfo, const VertexInputLayout &vertexInputLayout, bool enableDepth=true, bool overBlending=false) |
| Create a graphics pipeline with multiple color render targets. | |
| SDL_GPUBuffer * | createBuffer (SDL_GPUDevice *device, size_t bufferSize, SDL_GPUBufferUsageFlags usage) |
| Allocate a GPU buffer of the given size and usage. | |
| SDL_GPUTransferBuffer * | createTransferBuffer (SDL_GPUDevice *device, size_t transferBufferSize, bool upload) |
| Allocate a GPU transfer buffer for upload or download. | |
| SDL_GPUTransferBuffer * | createUploadBuffer (SDL_GPUDevice *device, size_t transferBufferSize) |
| Allocate a GPU transfer buffer for uploading data. | |
| void | uploadBuffers (SDL_GPUDevice *device, SDL_GPUCommandBuffer *cmd, const std::vector< BufferUpload > &uploads) |
| Batch-upload multiple CPU buffers to their corresponding GPU buffers. | |
| SDL_GPUTexture * | createEmptyTextureD32F (SDL_GPUDevice *device, Uint32 width, Uint32 height, bool cube, Uint32 arraySize) |
| Create an empty depth texture, optionally cube/cube-array shaped. | |
| SDL_GPUTexture * | createTextureRGBA32 (SDL_GPUDevice *device, Uint32 width, Uint32 height, const void *data, SDL_GPUTextureFormat format) |
| SDL_GPUTexture * | createTextureRGBA8 (SDL_GPUDevice *device, Uint32 width, Uint32 height, const void *data, SDL_GPUTextureFormat format=SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM) |
| Create a 2D RGBA8 texture and upload pixel data to it. | |
| SDL_GPUTexture * | loadTexture (SDL_GPUDevice *device, const char *path) |
| Load an image file from disk and create a GPU texture from it. | |
| SDL_GPUTexture * | createDepthTexture (SDL_GPUDevice *device, Uint32 width, Uint32 height) |
| Create a D32_FLOAT depth texture of the given dimensions. | |
| SDL_GPUTexture * | createSampledColorTarget (SDL_GPUDevice *device, Uint32 width, Uint32 height, SDL_GPUTextureFormat format) |
| Create a sampleable 2D color render target of the given dimensions. | |
| SDL_GPUSampler * | createLinearRepeatSampler (SDL_GPUDevice *device, bool nearest) |
| Create a linear-filtering, repeat-addressing sampler. | |
| SDL_GPUSampler * | createLinearComparisonSampler (SDL_GPUDevice *device, SDL_GPUFilter filterMode, bool reverseZ) |
| Create a linear-filtering, comparison sampler (for shadow map depth comparison). | |
| SDL_GPUSampler * | createLinearClampSampler (SDL_GPUDevice *device) |
| Create a linear-filtering, clamp-to-edge sampler. | |
Variables | |
| constexpr SDL_GPUColorTargetBlendState | OVER_BLEND_MODE |
| SDL_GPUBuffer * Boilerplate::createBuffer | ( | SDL_GPUDevice * | device, |
| size_t | bufferSize, | ||
| SDL_GPUBufferUsageFlags | usage ) |
Allocate a GPU buffer of the given size and usage.
| device | The GPU device. |
| bufferSize | Size in bytes. |
| usage | Buffer usage flags (vertex, index, etc.). |
| SDL_GPUTexture * Boilerplate::createDepthTexture | ( | SDL_GPUDevice * | device, |
| Uint32 | width, | ||
| Uint32 | height ) |
Create a D32_FLOAT depth texture of the given dimensions.
| device | The GPU device. |
| width | Texture width in pixels. |
| height | Texture height in pixels. |
| SDL_GPUTexture * Boilerplate::createEmptyTextureD32F | ( | SDL_GPUDevice * | device, |
| Uint32 | width, | ||
| Uint32 | height, | ||
| bool | cube, | ||
| Uint32 | arraySize ) |
Create an empty depth texture, optionally cube/cube-array shaped.
| device | The GPU device. |
| width | Texture width in pixels. |
| height | Texture height in pixels. |
| cube | Whether to create a cube texture. |
| arraySize | Number of cube/2D array entries. |
| SDL_GPUGraphicsPipeline * Boilerplate::createGraphicsDepthPipeline | ( | SDL_GPUDevice * | device, |
| PipelineDescription | pipelineDesc ) |
| SDL_GPUGraphicsPipeline * Boilerplate::createGraphicsPipeline | ( | SDL_GPUDevice * | device, |
| const std::vector< SDL_GPUTextureFormat > & | colorFormats, | ||
| SDL_GPUShaderFormat | shaderFormat, | ||
| const ShaderInfo & | vertexShaderInfo, | ||
| const ShaderInfo & | fragmentShaderInfo, | ||
| const VertexInputLayout & | vertexInputLayout, | ||
| bool | enableDepth, | ||
| bool | overBlending ) |
Create a graphics pipeline with multiple color render targets.
| SDL_GPUGraphicsPipeline * Boilerplate::createGraphicsPipeline | ( | SDL_GPUDevice * | device, |
| SDL_GPUTextureFormat & | colorFormat, | ||
| SDL_GPUShaderFormat | shaderFormat, | ||
| const ShaderInfo & | vertexShaderInfo, | ||
| const ShaderInfo & | fragmentShaderInfo, | ||
| const VertexInputLayout & | vertexInputLayout, | ||
| bool | enableDepth = true, | ||
| bool | overBlending = false ) |
Create a full graphics pipeline from vertex/fragment shaders and vertex layout.
| device | The GPU device. |
| colorFormat | |
| shaderFormat | The shader binary format. |
| vertexShaderInfo | Vertex shader descriptor. |
| fragmentShaderInfo | Fragment shader descriptor. |
| vertexInputLayout | Vertex buffer layout description. |
| enableDepth | Enable depth testing and writing (default true). |
| overBlending |
| ImGui_ImplSDLGPU3_InitInfo Boilerplate::createImGuiInfo | ( | SDL_GPUDevice * | device, |
| SDL_Window * | window ) |
Create an ImGui initialization info struct for SDL3 GPU rendering.
| device | The GPU device. |
| window | The SDL window. |
| SDL_GPUSampler * Boilerplate::createLinearClampSampler | ( | SDL_GPUDevice * | device | ) |
Create a linear-filtering, clamp-to-edge sampler.
| device | The GPU device. |
| SDL_GPUSampler * Boilerplate::createLinearComparisonSampler | ( | SDL_GPUDevice * | device, |
| SDL_GPUFilter | filterMode, | ||
| bool | reverseZ ) |
Create a linear-filtering, comparison sampler (for shadow map depth comparison).
| device | The GPU device. |
| SDL_GPUSampler * Boilerplate::createLinearRepeatSampler | ( | SDL_GPUDevice * | device, |
| bool | nearest ) |
Create a linear-filtering, repeat-addressing sampler.
| device | The GPU device. |
| SDL_GPUTexture * Boilerplate::createSampledColorTarget | ( | SDL_GPUDevice * | device, |
| Uint32 | width, | ||
| Uint32 | height, | ||
| SDL_GPUTextureFormat | format ) |
Create a sampleable 2D color render target of the given dimensions.
| SDL_GPUTexture * Boilerplate::createTextureRGBA32 | ( | SDL_GPUDevice * | device, |
| Uint32 | width, | ||
| Uint32 | height, | ||
| const void * | data, | ||
| SDL_GPUTextureFormat | format ) |
| SDL_GPUTexture * Boilerplate::createTextureRGBA8 | ( | SDL_GPUDevice * | device, |
| Uint32 | width, | ||
| Uint32 | height, | ||
| const void * | data, | ||
| SDL_GPUTextureFormat | format = SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM ) |
Create a 2D RGBA8 texture and upload pixel data to it.
| device | The GPU device. |
| width | Texture width in pixels. |
| height | Texture height in pixels. |
| data | Pointer to RGBA8 pixel data. |
| format | GPU texture format, usually RGBA8 UNORM or sRGB. |
| SDL_GPUTransferBuffer * Boilerplate::createTransferBuffer | ( | SDL_GPUDevice * | device, |
| size_t | transferBufferSize, | ||
| bool | upload ) |
Allocate a GPU transfer buffer for upload or download.
| device | The GPU device. |
| transferBufferSize | Size in bytes. |
| upload | True for upload, false for download. |
| SDL_GPUTransferBuffer * Boilerplate::createUploadBuffer | ( | SDL_GPUDevice * | device, |
| size_t | transferBufferSize ) |
Allocate a GPU transfer buffer for uploading data.
| device | The GPU device. |
| transferBufferSize | Size in bytes. |
| SDL_GPUShader * Boilerplate::loadShader | ( | SDL_GPUDevice * | device, |
| const char * | path, | ||
| SDL_GPUShaderFormat | format, | ||
| SDL_GPUShaderStage | stage, | ||
| Uint32 | samplerCount, | ||
| Uint32 | uniformBufferCount, | ||
| Uint32 | storageBufferCount, | ||
| Uint32 | storageTextureCount ) |
Load and compile a shader from disk (explicit parameters).
| device | The GPU device. |
| path | Base path to the shader file (extension added automatically). |
| format | The shader binary format. |
| stage | Vertex or fragment stage. |
| samplerCount | Number of samplers used by the shader. |
| uniformBufferCount | Number of uniform buffers used. |
| storageBufferCount | Number of storage buffers used. |
| storageTextureCount | Number of storage textures used. |
| SDL_GPUShader * Boilerplate::loadShader | ( | SDL_GPUDevice * | device, |
| const ShaderInfo & | shaderInfo, | ||
| SDL_GPUShaderFormat | format ) |
Load and compile a shader from a ShaderInfo descriptor.
| device | The GPU device. |
| shaderInfo | Shader descriptor with path, stage, and resource counts. |
| format | The shader binary format. |
| SDL_GPUTexture * Boilerplate::loadTexture | ( | SDL_GPUDevice * | device, |
| const char * | path ) |
Load an image file from disk and create a GPU texture from it.
| device | The GPU device. |
| path | Path to the image file. |
| SDL_GPUVertexAttribute Boilerplate::makeAttribute | ( | Uint32 | location, |
| SDL_GPUVertexElementFormat | format, | ||
| Uint32 | offset, | ||
| Uint32 | bufferSlot = 0 ) |
Build an SDL_GPUVertexAttribute descriptor.
| location | Shader attribute location index. |
| format | Element format (e.g. FLOAT3). |
| offset | Byte offset within the vertex. |
| bufferSlot | Vertex buffer slot (default 0). |
| SDL_GPUColorTargetInfo Boilerplate::makeColorTargetClear | ( | SDL_GPUTexture * | texture, |
| SDL_FColor | clearColor ) |
Create a color render-target info with a clear color.
| texture | The target texture. |
| clearColor | The RGBA clear color. |
| SDL_GPUColorTargetInfo Boilerplate::makeColorTargetLoad | ( | SDL_GPUTexture * | texture | ) |
Create a color render-target info with a clear color.
| texture | The target texture. |
| SDL_GPUDepthStencilTargetInfo Boilerplate::makeDepthTarget | ( | SDL_GPUTexture * | texture, |
| Uint8 | layer, | ||
| bool | store, | ||
| bool | reverseZ ) |
Create a depth/stencil render-target info that clears to depth 1.0.
| texture | The depth texture. |
| SDL_GPUTextureSamplerBinding Boilerplate::makeTextureSamplerBinding | ( | SDL_GPUTexture * | texture, |
| SDL_GPUSampler * | sampler ) |
Create a texture-sampler binding pair for fragment shader use.
| texture | The GPU texture. |
| sampler | The GPU sampler. |
| SDL_GPUShaderFormat Boilerplate::selectShaderFormat | ( | SDL_GPUDevice * | device | ) |
Pick the best available shader format for the given device.
| device | The GPU device. |
| void Boilerplate::uploadBuffers | ( | SDL_GPUDevice * | device, |
| SDL_GPUCommandBuffer * | cmd, | ||
| const std::vector< BufferUpload > & | uploads ) |
Batch-upload multiple CPU buffers to their corresponding GPU buffers.
| device | The GPU device. |
| cmd | The command buffer to record copy commands into. |
| uploads | Vector of BufferUpload descriptors. |
|
constexpr |