Compiled GPU code for a specific stage of a ShaderProgram.
More...
#include <donut/graphics/ShaderStage.hpp>
Compiled GPU code for a specific stage of a ShaderProgram.
◆ ShaderStage() [1/2]
constexpr donut::graphics::ShaderStage::ShaderStage |
( |
| ) |
|
|
explicitconstexprdefaultnoexcept |
Construct an empty shader stage without a value.
◆ ShaderStage() [2/2]
donut::graphics::ShaderStage::ShaderStage |
( |
ShaderStageType |
type, |
|
|
const char * |
definitions, |
|
|
const char * |
sourceCode |
|
) |
| |
|
explicit |
Compile a shader stage.
- Parameters
-
type | type of shader stage, see ShaderStageType. |
definitions | non-owning pointer to the GLSL source code for constant definitions to add to the beginning of the source code, or nullptr to not add any definitions. |
sourceCode | non-owning pointer to the GLSL source code to compile, or nullptr to create an empty shader stage without a value. |
- Exceptions
-
graphics::Error | on failure to create the shader object or compile the shader code. |
std::bad_alloc | on allocation failure. |
◆ operator bool()
donut::graphics::ShaderStage::operator bool |
( |
| ) |
const |
|
inlineexplicitnoexcept |
Check if the shader stage has a value.
- Returns
- true if the shader stage has a value, false otherwise.
◆ get()
Handle donut::graphics::ShaderStage::get |
( |
| ) |
const |
|
inlinenoexcept |
Get an opaque handle to the GPU representation of the shader stage.
- Returns
- a non-owning resource handle to the GPU representation of the shader stage.
- Note
- This function is used internally by the implementations of various abstractions and is not intended to be used outside of the graphics module. The returned handle has no meaning to application code.
The documentation for this class was generated from the following file: