|
| | ShaderSource () |
| |
| | ~ShaderSource () override |
| |
| u32 | getShaderIdDirect (const std::string &name, const ShaderConstants &input_const, video::E_MATERIAL_TYPE base_mat, IShaderUniformSetterRC *setter_cb) |
| |
| u32 | getShader (const std::string &name, const ShaderConstants &input_const, video::E_MATERIAL_TYPE base_mat, IShaderUniformSetterRC *setter_cb=nullptr) override |
| | Generates or gets a shader.
|
| |
| const ShaderInfo & | getShaderInfo (u32 id) override |
| | returns information about an existing shader
|
| |
| void | processQueue () override |
| |
| void | insertSourceShader (const std::string &name_of_shader, const std::string &filename, const std::string &program) override |
| |
| void | rebuildShaders () override |
| |
| void | addShaderConstantSetter (std::unique_ptr< IShaderConstantSetter > setter) override |
| |
| void | addShaderUniformSetterFactory (std::unique_ptr< IShaderUniformSetterFactory > setter) override |
| |
| bool | supportsSampler2DArray () const override |
| | Returns true if 'sampler2DArray' is supported in GLSL.
|
| |
| | IWritableShaderSource ()=default |
| |
| virtual | ~IWritableShaderSource ()=default |
| |
| | IShaderSource ()=default |
| |
| virtual | ~IShaderSource ()=default |
| |
| u32 | getShader (const std::string &name, MaterialType material_type, NodeDrawType drawtype=NDT_NORMAL, bool array_texture=false) |
| | Helper: Generates or gets a shader suitable for nodes and entities.
|
| |
| u32 | getShaderRaw (const std::string &name, bool blendAlpha=false) |
| | Helper: Generates or gets a shader for common, general use.
|
| |
◆ ShaderSource()
| ShaderSource::ShaderSource |
( |
| ) |
|
◆ ~ShaderSource()
| ShaderSource::~ShaderSource |
( |
| ) |
|
|
override |
◆ addShaderConstantSetter()
◆ addShaderUniformSetterFactory()
◆ generateShader()
| void ShaderSource::generateShader |
( |
ShaderInfo & | info | ) |
|
|
private |
Unique name of this shader, for debug/logging
References ShaderInfo::base_material, dumpShaderProgram(), errorstream, fmtgettext(), RenderingEngine::get_video_driver(), SourceShaderCache::getOrLoad(), infostream, ShaderInfo::input_constants, m_constant_setters, m_fully_programmable, m_have_glsl3, m_sourcecache, m_uniform_factories, ShaderInfo::material, ShaderInfo::name, putConstant(), ShaderInfo::setter_cb, trim(), and warningstream.
Referenced by getShaderIdDirect(), and rebuildShaders().
◆ getShader()
Generates or gets a shader.
Note that the input constants are not for passing the entire world into the shader. Use IShaderConstantSetter to handle user settings.
- Parameters
-
| name | name of the shader (directory on disk) |
| input_const | primary key constants for this shader |
| base_mat | base material to use |
| setter_cb | additional uniform setter to use |
- Returns
- shader ID
- Note
base_material only controls alpha behavior
Implements IShaderSource.
References errorstream, getShaderIdDirect(), infostream, GetResult< Key, T, Caller, CallerData >::item, GetResult< Key, T, Caller, CallerData >::key, m_main_thread, and MutexedQueue< T >::pop_frontNoEx().
◆ getShaderIdDirect()
◆ getShaderInfo()
| const ShaderInfo & ShaderSource::getShaderInfo |
( |
u32 | id | ) |
|
|
overridevirtual |
◆ insertSourceShader()
| void ShaderSource::insertSourceShader |
( |
const std::string & | name_of_shader, |
|
|
const std::string & | filename, |
|
|
const std::string & | program ) |
|
overridevirtual |
◆ processQueue()
| void ShaderSource::processQueue |
( |
| ) |
|
|
overridevirtual |
◆ putConstant()
| void ShaderSource::putConstant |
( |
std::ostream & | os, |
|
|
const ShaderConstants::mapped_type & | it ) |
|
inlineprivate |
◆ rebuildShaders()
| void ShaderSource::rebuildShaders |
( |
| ) |
|
|
overridevirtual |
◆ supportsSampler2DArray()
| bool ShaderSource::supportsSampler2DArray |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ m_constant_setters
◆ m_fully_programmable
| bool ShaderSource::m_fully_programmable = false |
|
private |
◆ m_have_glsl3
| bool ShaderSource::m_have_glsl3 = false |
|
private |
◆ m_main_thread
| std::thread::id ShaderSource::m_main_thread |
|
private |
◆ m_shaderinfo_cache
| std::vector<ShaderInfo> ShaderSource::m_shaderinfo_cache |
|
private |
◆ m_shaderinfo_cache_mutex
| std::mutex ShaderSource::m_shaderinfo_cache_mutex |
|
private |
◆ m_sourcecache
◆ m_uniform_factories
The documentation for this class was generated from the following file: