Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
ShaderSource Class Reference
+ Inheritance diagram for ShaderSource:
+ Collaboration diagram for ShaderSource:

Public Member Functions

 ShaderSource ()
 
 ~ShaderSource () override
 
u32 getShaderIdDirect (const std::string &name, MaterialType material_type, NodeDrawType drawtype) override
 
u32 getShader (const std::string &name, MaterialType material_type, NodeDrawType drawtype) override
 
ShaderInfo getShaderInfo (u32 id) override
 
void processQueue () override
 
void insertSourceShader (const std::string &name_of_shader, const std::string &filename, const std::string &program) override
 
void rebuildShaders () override
 
void addShaderConstantSetterFactory (IShaderConstantSetterFactory *setter) override
 
- Public Member Functions inherited from IWritableShaderSource
 IWritableShaderSource ()=default
 
virtual ~IWritableShaderSource ()=default
 
- Public Member Functions inherited from IShaderSource
 IShaderSource ()=default
 
virtual ~IShaderSource ()=default
 

Private Member Functions

ShaderInfo generateShader (const std::string &name, MaterialType material_type, NodeDrawType drawtype)
 

Private Attributes

std::thread::id m_main_thread
 
SourceShaderCache m_sourcecache
 
std::vector< ShaderInfom_shaderinfo_cache
 
std::mutex m_shaderinfo_cache_mutex
 
std::vector< std::unique_ptr< IShaderConstantSetterFactory > > m_setter_factories
 

Constructor & Destructor Documentation

◆ ShaderSource()

ShaderSource::ShaderSource ( )

References addShaderConstantSetterFactory(), m_main_thread, and m_shaderinfo_cache.

+ Here is the call graph for this function:

◆ ~ShaderSource()

ShaderSource::~ShaderSource ( )
override

References RenderingEngine::get_video_driver(), m_shaderinfo_cache, and m_shaderinfo_cache_mutex.

+ Here is the call graph for this function:

Member Function Documentation

◆ addShaderConstantSetterFactory()

void ShaderSource::addShaderConstantSetterFactory ( IShaderConstantSetterFactory * setter)
inlineoverridevirtual
Note
Takes ownership of setter.

Implements IWritableShaderSource.

References m_setter_factories.

Referenced by ShaderSource().

+ Here is the caller graph for this function:

◆ generateShader()

ShaderInfo ShaderSource::generateShader ( const std::string & name,
MaterialType material_type,
NodeDrawType drawtype )
private

◆ getShader()

u32 ShaderSource::getShader ( const std::string & name,
MaterialType material_type,
NodeDrawType drawtype )
overridevirtual

Reimplemented from 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().

+ Here is the call graph for this function:

◆ getShaderIdDirect()

u32 ShaderSource::getShaderIdDirect ( const std::string & name,
MaterialType material_type,
NodeDrawType drawtype )
overridevirtual

Reimplemented from IShaderSource.

References ShaderInfo::drawtype, errorstream, generateShader(), infostream, m_main_thread, m_shaderinfo_cache, m_shaderinfo_cache_mutex, ShaderInfo::material_type, and ShaderInfo::name.

Referenced by getShader().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShaderInfo()

ShaderInfo ShaderSource::getShaderInfo ( u32 id)
overridevirtual

Reimplemented from IShaderSource.

References m_shaderinfo_cache, and m_shaderinfo_cache_mutex.

◆ insertSourceShader()

void ShaderSource::insertSourceShader ( const std::string & name_of_shader,
const std::string & filename,
const std::string & program )
overridevirtual

Implements IWritableShaderSource.

References SourceShaderCache::insert(), m_main_thread, m_sourcecache, and sanity_check.

+ Here is the call graph for this function:

◆ processQueue()

void ShaderSource::processQueue ( )
overridevirtual

Implements IWritableShaderSource.

◆ rebuildShaders()

void ShaderSource::rebuildShaders ( )
overridevirtual

Implements IWritableShaderSource.

References ShaderInfo::drawtype, generateShader(), RenderingEngine::get_video_driver(), m_shaderinfo_cache, m_shaderinfo_cache_mutex, ShaderInfo::material_type, and ShaderInfo::name.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_main_thread

std::thread::id ShaderSource::m_main_thread
private

◆ m_setter_factories

std::vector<std::unique_ptr<IShaderConstantSetterFactory> > ShaderSource::m_setter_factories
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

SourceShaderCache ShaderSource::m_sourcecache
private

The documentation for this class was generated from the following file: