CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::HLSLShader Class Referencefinal

A shader that must be compiled as a "HLSL Shading Language". More...

#include <CeresEngine/Material/Shader.hpp>

Inheritance diagram for CeresEngine::HLSLShader:
CeresEngine::TResource< HLSLShader, Shader > CeresEngine::Shader CeresEngine::TResource< Shader > CeresEngine::Resource CeresEngine::IReflectable

Public Member Functions

ShadingLanguage getShadingLanguage () const noexcept final
 Specifies the shading language of the shader resource.
 
Optional< ShaderBinarycompile (ShaderType type, const ShaderSpecializationConstants &specializationConstants={}) const final
 Compiles the shader into a binary that can be loaded by the render API.
 
- Public Member Functions inherited from CeresEngine::TResource< HLSLShader, Shader >
ResourceHandle< HLSLShadergetResourceHandle () const noexcept
 Generates a hash for the provided type.
 
SPtr< HLSLShadergetShared () noexcept
 Gets a shared pointer to the resource.
 
SPtr< const HLSLShadergetShared () const noexcept
 Gets a shared pointer to the resource.
 
const ResourceTypeInfogetResourceType () const noexcept override
 Returns the resource type information descriptor.
 
 TResource (ResourceData &data, InputStream &dataStream)
 
void serialize (OutputStream &dataStream) const override
 Serializes a resource by writing data to dataStream.
 
- Public Member Functions inherited from CeresEngine::Shader
 Shader ()=default
 
 Shader (const ShaderSource &source, const ShaderStages &stage)
 
 ~Shader () noexcept override=default
 
const ShaderSourcegetSource () const noexcept
 The shader source to compile the final shader to.
 
void setSource (const ShaderSource &source)
 The shader source to compile the final shader to.
 
Async< Optional< ShaderBinary > > compileAsync (ShaderType type, ShaderSpecializationConstants specializationConstants={})
 Asynchronously compiles the shader into a binary that can be loaded by the render API.
 
String getSourceName () const
 Gets the shader source name.
 
- Public Member Functions inherited from CeresEngine::TResource< Shader >
ResourceHandle< ShadergetResourceHandle () const noexcept
 Generates a hash for the provided type.
 
SPtr< ShadergetShared () noexcept
 Gets a shared pointer to the resource.
 
SPtr< const ShadergetShared () const noexcept
 Gets a shared pointer to the resource.
 
const ResourceTypeInfogetResourceType () const noexcept override
 Returns the resource type information descriptor.
 
 TResource (ResourceData &data, InputStream &dataStream)
 
void serialize (OutputStream &dataStream) const override
 Serializes a resource by writing data to dataStream.
 
- Public Member Functions inherited from CeresEngine::Resource
 Resource ()
 Default constructor for the Resource class.
 
 Resource (ResourceData &data)
 Creates a new Resource instance by passing a ResourceData instance.
 
virtual ~Resource () noexcept=default
 Resource virtual destructor.
 
ResourceManagergetResourceManager () const noexcept
 
HResource getResourceHandle () const noexcept
 Generates a hash for the provided type.
 
UUID getResourceID () const noexcept
 
HResource getParentResource () const noexcept
 A parent resource to which this resource is attached to.
 
SPtr< ResourceMetadatagetResourceMetadata () const noexcept
 A pointer to the user-defined resource metadata.
 
const PackagePtrgetPackage () const noexcept
 The package from which the resource was loaded from.
 
template<typename T = Resource>
SPtr< TgetShared () noexcept
 Gets a shared pointer to the resource.
 
template<typename T = Resource>
SPtr< const TgetShared () const noexcept
 Gets a shared pointer to the resource.
 
 Resource (ResourceData &data, InputStream &dataStream)
 Creates a new resource by reading data from dataStream.
 
- Public Member Functions inherited from CeresEngine::IReflectable
virtual ~IReflectable () noexcept=default
 

Private Types

using super = TResource< HLSLShader, Shader >
 

Additional Inherited Members

- Static Public Member Functions inherited from CeresEngine::Resource
template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 
- Protected Member Functions inherited from CeresEngine::Shader
ShaderSource preProcessShader (const ShaderSource &sourceCode, const ShaderSpecializationConstants &specializationConstants, const URI &includeSearchPath) const
 Runs the shader pre-processor on the shader.
 
Optional< ShaderBinarycompileShaderInternal (const ShaderSource &sourceCode, ShadingLanguage language, const URI &includeSearchPath) const
 Internal method to compile the given shaderSource using the ShaderC compiler.
 
- Protected Member Functions inherited from CeresEngine::Resource
HResourceStream createStream (const ResourceStreamFlags &flags=ResourceStreamFlag::Default)
 Creates a new resource stream.
 
void destroyStream (HResourceStream &stream)
 Destroys a stream.
 
void markAsDirty ()
 Marks the resource as dirty.
 
- Protected Attributes inherited from CeresEngine::Shader
ShaderStages mStages
 A set of stages supported by the shader.
 
ShaderSource mSource = ShaderSource(ShaderType::Undefined, "")
 The shader source to compile the final shader to.
 

Detailed Description

A shader that must be compiled as a "HLSL Shading Language".

Member Typedef Documentation

◆ super

Member Function Documentation

◆ compile()

Optional< ShaderBinary > CeresEngine::HLSLShader::compile ( ShaderType  type,
const ShaderSpecializationConstants specializationConstants = {} 
) const
finalvirtual

Compiles the shader into a binary that can be loaded by the render API.

Parameters
typeThe type of shader to compile.

Implements CeresEngine::Shader.

◆ getShadingLanguage()

ShadingLanguage CeresEngine::HLSLShader::getShadingLanguage ( ) const
inlinefinalvirtualnoexcept

Specifies the shading language of the shader resource.

Implements CeresEngine::Shader.


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