group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
ShaderUtils.hpp File Reference

Shared shader-loading utilities used by Renderer and ParticleRenderer. More...

#include <SDL3/SDL.h>
Include dependency graph for ShaderUtils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

SDL_GPUShader * loadShader (SDL_GPUDevice *dev, const char *path, SDL_GPUShaderFormat format, SDL_GPUShaderStage stage, Uint32 samplerCount, Uint32 uniformBufferCount, Uint32 storageBufferCount, Uint32 storageTextureCount)
 Load a compiled shader from disk and create an SDL GPU shader object.

Detailed Description

Shared shader-loading utilities used by Renderer and ParticleRenderer.

Function Documentation

◆ loadShader()

SDL_GPUShader * loadShader ( SDL_GPUDevice * dev,
const char * path,
SDL_GPUShaderFormat format,
SDL_GPUShaderStage stage,
Uint32 samplerCount,
Uint32 uniformBufferCount,
Uint32 storageBufferCount,
Uint32 storageTextureCount )

Load a compiled shader from disk and create an SDL GPU shader object.

Parameters
devThe GPU device.
pathPath to the compiled shader file (.spv or .msl).
formatShader format (SPIR-V or MSL).
stageVertex or fragment stage.
samplerCountNumber of texture samplers declared in the shader.
uniformBufferCountNumber of uniform buffers declared in the shader.
storageBufferCountNumber of storage buffers declared in the shader.
storageTextureCountNumber of storage textures declared in the shader.
Returns
The created shader, or nullptr on failure (error logged via SDL_Log).
Here is the caller graph for this function: