|
ObjectivelyGPU
Object oriented graphics framework for SDL3 and C
|
An SDL_GPUShader: one compiled programmable stage of a graphics pipeline.
More...
#include <Shader.h>
Public Member Functions | |
| Shader * | initWithDevice (Shader *self, RenderDevice *device, const SDL_GPUShaderCreateInfo *info) |
Initializes this Shader from a fully-populated SDL_GPUShaderCreateInfo. | |
| Class * | _Shader (void) |
| The Shader archetype. | |
Data Fields | |
| Object | object |
| The superclass. | |
| SDL_GPUShader * | shader |
| The underlying SDL shader. | |
| SDL_GPUShaderFormat | format |
| The shader format. | |
| SDL_GPUShaderStage | stage |
| The shader stage (vertex or fragment). | |
| ident | data |
| User data. | |
Protected Attributes | |
| ShaderInterface * | interface |
| The interface. | |
An SDL_GPUShader: one compiled programmable stage of a graphics pipeline.
Shader owns its underlying SDL_GPUShader and releases it in dealloc, so a shader is freed with release like any other Objectively object. A shader need only outlive the GraphicsPipeline creation that consumes it, after which it may be released. Pass the shader handle into the pipeline's create info.
| Shader * initWithDevice | ( | Shader * | self, |
| RenderDevice * | device, | ||
| const SDL_GPUShaderCreateInfo * | info | ||
| ) |
Initializes this Shader from a fully-populated SDL_GPUShaderCreateInfo.
The designated (and only) initializer: a thin wrapper over SDL_CreateGPUShader. All fields of info, including code, code_size, format, and entrypoint, must be set by the caller. Prefer RenderDevice::loadShader, which resolves a compiled blob from the Resource system, selects the device-appropriate format, and fills these fields in.
| self | The Shader. |
| device | The RenderDevice used to create and release the shader. Retained. |
| info | The Shader creation parameters with all fields populated. |
NULL on failure. | ident Shader::data |
User data.
| SDL_GPUShaderFormat Shader::format |
The shader format.
|
protected |
The interface.
| Object Shader::object |
The superclass.
| SDL_GPUShader* Shader::shader |
The underlying SDL shader.
| SDL_GPUShaderStage Shader::stage |
The shader stage (vertex or fragment).