|
Ream v0.1.0-1
C++ graphics library for Linux
|
A compiled OpenGL ES shader specialized for a set of features. More...
#include <RGLShader.h>
Inheritance diagram for RGLShader:Public Types | |
| enum | Features : UInt32 |
| Feature flags controlling shader specialization. More... | |
Public Member Functions | |
| ~RGLShader () noexcept | |
| Deletes the underlying GL shader object. | |
| GLuint | id () const noexcept |
| Returns the GL shader object name. | |
| GLenum | type () const noexcept |
Returns the GL shader stage (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER). | |
| CZBitset< Features > | features () const noexcept |
| Returns the feature flags this shader was compiled for. | |
| RGLDevice * | device () const noexcept |
| Returns the device this shader belongs to. | |
Public Member Functions inherited from RObject | |
| RObject ()=default | |
| Constructs a default RObject. | |
Static Public Member Functions | |
| static std::shared_ptr< RGLShader > | GetOrMake (RGLDevice *device, CZBitset< Features > features, GLenum type) noexcept |
| Returns the cached shader for the given device, feature set, and type, compiling it if needed. | |
Static Public Attributes | |
| static constexpr CZBitset< Features > | VertFeatures { HasImage | HasMask } |
| Subset of Features that affect the vertex shader (the rest only affect the fragment shader). | |
A compiled OpenGL ES shader specialized for a set of features.
The GL backend uses a single über-shader whose behavior is controlled by preprocessor defines derived from a Features bitmask. RGLShader compiles one variant per (feature set, shader type) and caches it in the RGLDevice's per-thread context data. Programs (RGLProgram) combine a vertex and a fragment variant sharing the same feature set.
| enum Features : UInt32 |
Feature flags controlling shader specialization.
The lowest 2 bits encode the blend mode, the middle bits are boolean capabilities, and the upper 4 bits encode an optional image effect.
|
noexcept |
Deletes the underlying GL shader object.
|
staticnoexcept |
Returns the cached shader for the given device, feature set, and type, compiling it if needed.
| device | The target device (uses its per-thread context data). |
| features | The feature flags describing the desired shader variant. |
| type | The GL shader stage (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER). |
nullptr on compilation failure.
|
inlinenoexcept |
Returns the GL shader object name.
|
inlinenoexcept |
Returns the GL shader stage (GL_VERTEX_SHADER or GL_FRAGMENT_SHADER).
|
inlinenoexcept |
Returns the feature flags this shader was compiled for.
|
inlinenoexcept |
Returns the device this shader belongs to.