Mountain  1.0.0
Simple C++ 2D Game Framework
Mountain::ComputeShader Class Reference
+ Inheritance diagram for Mountain::ComputeShader:
+ Collaboration diagram for Mountain::ComputeShader:

Public Member Functions

MOUNTAIN_API bool_t SetSourceData (const Pointer< File > &shader) override
 Loads a single compute shader file. More...
 
MOUNTAIN_API bool_t Load (const char_t *buffer, int64_t length)
 Loads raw compute shader code. More...
 
MOUNTAIN_API void Load () override
 Creates the compute shader in OpenGL.
 
MOUNTAIN_API void Unload () override
 Destroys the compute shader in OpenGL.
 
MOUNTAIN_API void ResetSourceData () override
 Unloads the compute shader.
 
MOUNTAIN_API bool_t Reload (bool_t reloadInBackend) override
 
MOUNTAIN_API void Dispatch (uint32_t groupsX=1, uint32_t groupsY=1, uint32_t groupsZ=1) const
 
- Public Member Functions inherited from Mountain::ShaderBase
MOUNTAIN_API void SetUniform (const char_t *keyName, int32_t value) const
 Sets an int (signed, 32 bits) variable in a shader.
 
MOUNTAIN_API void SetUniform (const char_t *keyName, uint32_t value) const
 Sets an uint (unsigned, 32 bits) variable in a shader.
 
MOUNTAIN_API void SetUniform (const char_t *keyName, bool_t value) const
 Sets a bool (signed, 32 bits) variable in a shader.
 
MOUNTAIN_API void SetUniform (const char_t *keyName, float_t value) const
 Sets a float (32 bits) variable in a shader.
 
MOUNTAIN_API void SetUniform (const char_t *keyName, Vector2i value) const
 Sets a Vector2 (2 floats, 64 bits) variable in a shader.
 
MOUNTAIN_API void SetUniform (const char_t *keyName, Vector2 value) const
 Sets a Vector2 (2 floats, 64 bits) variable in a shader.
 
MOUNTAIN_API void SetUniform (const char_t *keyName, const Vector3 &value) const
 Sets a Vector3 (3 floats, 96 bits) variable in a shader.
 
MOUNTAIN_API void SetUniform (const char_t *keyName, const Vector4 &value) const
 Sets a Vector4 (4 floats, 128 bits) variable in a shader.
 
MOUNTAIN_API void SetUniform (const char_t *keyName, const Color &value) const
 Sets a Color (4 floats, 128 bits) variable in a shader.
 
MOUNTAIN_API void SetUniform (const char_t *keyName, const Matrix2 &value) const
 Sets a Matrix2 (4 floats, 128 bits) variable in a shader.
 
MOUNTAIN_API void SetUniform (const char_t *keyName, const Matrix3 &value) const
 Sets a Matrix3 (9 floats, 288 bits) variable in a shader.
 
MOUNTAIN_API void SetUniform (const char_t *keyName, const Matrix &value) const
 Sets a Matrix (16 floats, 512 bits) variable in a shader.
 
MOUNTAIN_API uint32_t GetId () const
 Gets the internal id of the shader.
 

Static Public Attributes

static MOUNTAIN_API constexpr std::array FileExtensions
 Allowed extensions for compute shaders. More...
 

Additional Inherited Members

- Public Attributes inherited from Mountain::ShaderBase
std::unordered_set< std::filesystem::path > dependentShaderFiles
 List of files that are included in this shader file.
 
- Protected Member Functions inherited from Mountain::ShaderBase
bool_t CheckCompileError (uint32_t id, std::string_view type, const std::string &code) const
 
bool_t CheckLinkError () const
 
int32_t GetUniformLocation (const char_t *keyName) const
 
- Static Protected Member Functions inherited from Mountain::ShaderBase
static void ReplaceIncludes (std::string &code, const std::filesystem::path &path, std::unordered_set< std::filesystem::path > &replacedFiles)
 
- Protected Attributes inherited from Mountain::ShaderBase
uint32_t m_Id = 0
 

Detailed Description

Definition at line 10 of file compute_shader.hpp.

Member Function Documentation

◆ Load()

MOUNTAIN_API bool_t Mountain::ComputeShader::Load ( const char_t *  buffer,
int64_t  length 
)

Loads raw compute shader code.

Parameters
bufferRaw data
lengthRaw data length

◆ SetSourceData()

MOUNTAIN_API bool_t Mountain::ComputeShader::SetSourceData ( const Pointer< File > &  shader)
override

Loads a single compute shader file.

Parameters
shaderFile
Returns
Whether the load succeeded

Member Data Documentation

◆ FileExtensions

MOUNTAIN_API constexpr std::array Mountain::ComputeShader::FileExtensions
static
Initial value:
{
".comp",
".compute"
}

Allowed extensions for compute shaders.

Definition at line 15 of file compute_shader.hpp.


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