public

Inheritance Graph

graph BT
	ShaderObjectInfo
	click ShaderObjectInfo "classRendering_1_1ShaderObjectInfo"

Description

Storage for shader type and shader code. There is no GL handle stored in here. When compiling an object, the handle is returned and has to be stored by the caller.

Public Static Attributes

   
   
const uint32_t SHADER_STAGE_VERTEX
   
const uint32_t SHADER_STAGE_FRAGMENT
   
const uint32_t SHADER_STAGE_GEOMETRY
   
const uint32_t SHADER_STAGE_TESS_CONTROL
   
const uint32_t SHADER_STAGE_TESS_EVALUATION
   
const uint32_t SHADER_STAGE_COMPUTE
   
const uint32_t SHADER_STAGE_TASK
   
const uint32_t SHADER_STAGE_MESH

Public Functions

   
   
const std::string & getCode() const
   
uint32_t getType() const
   
ShaderObjectInfo & addDefine(const std::string & key, const std::string & value)
   
uint32_t compile() const
   
const Util::FileName & getFileName() const

Public Static Functions

   
   
ShaderObjectInfo createVertex(const std::string & code)
   
ShaderObjectInfo createFragment(const std::string & code)
   
ShaderObjectInfo createGeometry(const std::string & code)
   
ShaderObjectInfo createCompute(const std::string & code)
   
ShaderObjectInfo createMesh(const std::string & code)
   
ShaderObjectInfo createTask(const std::string & code)
   
ShaderObjectInfo loadVertex(const Util::FileName & file)
Load a VertexShaderObject from the given file.
   
ShaderObjectInfo loadFragment(const Util::FileName & file)
Load a FragmentShaderObject from the given file.
   
ShaderObjectInfo loadGeometry(const Util::FileName & file)
Load a GeometryShaderObject from the given file.
   
ShaderObjectInfo loadCompute(const Util::FileName & file)
Load a ComputeShaderObject from the given file.
   
ShaderObjectInfo loadMesh(const Util::FileName & file)
Load a MeshShaderObject from the given file.
   
ShaderObjectInfo loadTask(const Util::FileName & file)
Load a TaskShaderObject from the given file.

Documentation

variable
Rendering::ShaderObjectInfo::SHADER_STAGE_VERTEX

public static
 
 
const uint32_t SHADER_STAGE_VERTEX

Defined in Rendering/Shader/ShaderObjectInfo.h:35


variable
Rendering::ShaderObjectInfo::SHADER_STAGE_FRAGMENT

public static
 
 
const uint32_t SHADER_STAGE_FRAGMENT

Defined in Rendering/Shader/ShaderObjectInfo.h:36


variable
Rendering::ShaderObjectInfo::SHADER_STAGE_GEOMETRY

public static
 
 
const uint32_t SHADER_STAGE_GEOMETRY

Defined in Rendering/Shader/ShaderObjectInfo.h:37


variable
Rendering::ShaderObjectInfo::SHADER_STAGE_TESS_CONTROL

public static
 
 
const uint32_t SHADER_STAGE_TESS_CONTROL

Defined in Rendering/Shader/ShaderObjectInfo.h:38


variable
Rendering::ShaderObjectInfo::SHADER_STAGE_TESS_EVALUATION

public static
 
 
const uint32_t SHADER_STAGE_TESS_EVALUATION

Defined in Rendering/Shader/ShaderObjectInfo.h:39


variable
Rendering::ShaderObjectInfo::SHADER_STAGE_COMPUTE

public static
 
 
const uint32_t SHADER_STAGE_COMPUTE

Defined in Rendering/Shader/ShaderObjectInfo.h:40


variable
Rendering::ShaderObjectInfo::SHADER_STAGE_TASK

public static
 
 
const uint32_t SHADER_STAGE_TASK

Defined in Rendering/Shader/ShaderObjectInfo.h:41


variable
Rendering::ShaderObjectInfo::SHADER_STAGE_MESH

public static
 
 
const uint32_t SHADER_STAGE_MESH

Defined in Rendering/Shader/ShaderObjectInfo.h:42


function
Rendering::ShaderObjectInfo::getCode

public const inline
   
   
const std::string & getCode( ) const

Defined in Rendering/Shader/ShaderObjectInfo.h:54


function
Rendering::ShaderObjectInfo::getType

public const inline
   
   
uint32_t getType( ) const

Defined in Rendering/Shader/ShaderObjectInfo.h:57


function
Rendering::ShaderObjectInfo::addDefine

public inline
     
     
ShaderObjectInfo & addDefine( const std::string & key,
  const std::string & value
)    

Defined in Rendering/Shader/ShaderObjectInfo.h:60


function
Rendering::ShaderObjectInfo::compile

public const
   
   
uint32_t compile( ) const

Use GL to compile the source stored in this shader object.

Returns

Handle of the compiled GL shader, or0in case of an error

Defined in Rendering/Shader/ShaderObjectInfo.h:71


function
Rendering::ShaderObjectInfo::getFileName

public const inline
   
   
const Util::FileName & getFileName( ) const

Defined in Rendering/Shader/ShaderObjectInfo.h:133


function
Rendering::ShaderObjectInfo::createVertex

public static
     
     
ShaderObjectInfo createVertex( const std::string & code )

Create a VertexShaderObject from the given code

Note: Inserts “#define SG_VERTEX_SHADER” before the first line.

Defined in Rendering/Shader/ShaderObjectInfo.h:78


function
Rendering::ShaderObjectInfo::createFragment

public static
     
     
ShaderObjectInfo createFragment( const std::string & code )

Create a FragmentShaderObject from the given code

Note: Inserts “#define SG_FRAGMENT_SHADER” before the first line.

Defined in Rendering/Shader/ShaderObjectInfo.h:85


function
Rendering::ShaderObjectInfo::createGeometry

public static
     
     
ShaderObjectInfo createGeometry( const std::string & code )

Create a GeometryShaderObject from the given code

Note: Inserts “#define SG_GEOMETRY_SHADER” before the first line.

Defined in Rendering/Shader/ShaderObjectInfo.h:92


function
Rendering::ShaderObjectInfo::createCompute

public static
     
     
ShaderObjectInfo createCompute( const std::string & code )

Create a ComputeShaderObject from the given code

Note: Inserts “#define SG_COMPUTE_SHADER” before the first line.

Defined in Rendering/Shader/ShaderObjectInfo.h:99


function
Rendering::ShaderObjectInfo::createMesh

public static
     
     
ShaderObjectInfo createMesh( const std::string & code )

Create a MeshShaderObject from the given code

Note: Inserts “#define SG_MESH_SHADER” before the first line.

Defined in Rendering/Shader/ShaderObjectInfo.h:106


function
Rendering::ShaderObjectInfo::createTask

public static
     
     
ShaderObjectInfo createTask( const std::string & code )

Create a TaskShaderObject from the given code

Note: Inserts “#define SG_TASK_SHADER” before the first line.

Defined in Rendering/Shader/ShaderObjectInfo.h:113


function
Rendering::ShaderObjectInfo::loadVertex

public static
     
     
ShaderObjectInfo loadVertex( const Util::FileName & file )

Load a VertexShaderObject from the given file.

Defined in Rendering/Shader/ShaderObjectInfo.h:116


function
Rendering::ShaderObjectInfo::loadFragment

public static
     
     
ShaderObjectInfo loadFragment( const Util::FileName & file )

Load a FragmentShaderObject from the given file.

Defined in Rendering/Shader/ShaderObjectInfo.h:119


function
Rendering::ShaderObjectInfo::loadGeometry

public static
     
     
ShaderObjectInfo loadGeometry( const Util::FileName & file )

Load a GeometryShaderObject from the given file.

Defined in Rendering/Shader/ShaderObjectInfo.h:122


function
Rendering::ShaderObjectInfo::loadCompute

public static
     
     
ShaderObjectInfo loadCompute( const Util::FileName & file )

Load a ComputeShaderObject from the given file.

Defined in Rendering/Shader/ShaderObjectInfo.h:125


function
Rendering::ShaderObjectInfo::loadMesh

public static
     
     
ShaderObjectInfo loadMesh( const Util::FileName & file )

Load a MeshShaderObject from the given file.

Defined in Rendering/Shader/ShaderObjectInfo.h:128


function
Rendering::ShaderObjectInfo::loadTask

public static
     
     
ShaderObjectInfo loadTask( const Util::FileName & file )

Load a TaskShaderObject from the given file.

Defined in Rendering/Shader/ShaderObjectInfo.h:131