Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
EngineCore::MaterialShader Struct Reference

#include <MaterialShader.h>

Collaboration diagram for EngineCore::MaterialShader:

Public Member Functions

 MaterialShader ()=default
 MaterialShader (const std::filesystem::path &meshShaderPath, const std::filesystem::path &fragmentShaderPath)
void setPipeline (GraphicsPipeline *pipeline)
 Sets the pipeline which corresponds to.
std::filesystem::path getMeshShaderPath () const
 Getter for the mesh shader path.
std::filesystem::path getFragShaderPath () const
 Getter for the fragment shader path.
GraphicsPipelinegetPipeline () const
PipelineMaterialPayload getPipelineData () const
std::string toString () const

Static Public Member Functions

static std::string getPipelineNameFromString (PipelineNames pipelineName)
 Gets the pipeline name as string.
static PipelineNames getPipelineNameFromString (const std::string &pipelineName)
 Converts the string name of a pipeline into the actual pipeline enum.

Static Private Member Functions

static const BidirectionalMap< std::string, PipelineNames > & getMaterialNameMap ()

Private Attributes

DynamicMaterialUniformData dynamicUniformData = {}
std::filesystem::path meshShaderPath = ""
std::filesystem::path fragmentShaderPath = ""
PipelineMaterialPayload pipelineData = {}
GraphicsPipelinepipeline = nullptr
std::string defaultMeshShader = "assets/Engine/shaders/Output/triangle.mesh.spv"
std::string defaultFragShader = "assets/Engine/shaders/Output/triangle.frag.spv"

Detailed Description

Definition at line 17 of file MaterialShader.h.

Constructor & Destructor Documentation

◆ MaterialShader() [1/2]

EngineCore::MaterialShader::MaterialShader ( )
default

◆ MaterialShader() [2/2]

EngineCore::MaterialShader::MaterialShader ( const std::filesystem::path & meshShaderPath,
const std::filesystem::path & fragmentShaderPath )

Definition at line 8 of file MaterialShader.cpp.

References fragmentShaderPath, and meshShaderPath.

Member Function Documentation

◆ getFragShaderPath()

std::filesystem::path EngineCore::MaterialShader::getFragShaderPath ( ) const
nodiscard

Getter for the fragment shader path.

Returns
relative path to the fragment shader

Definition at line 24 of file MaterialShader.cpp.

References fragmentShaderPath.

◆ getMaterialNameMap()

const BidirectionalMap< std::string, PipelineNames > & EngineCore::MaterialShader::getMaterialNameMap ( )
staticprivate

Definition at line 71 of file MaterialShader.cpp.

References EngineCore::DIFFUSE_FLAT_COLOR, EngineCore::DIFFUSE_SHADER, EngineCore::DYNAMIC_TEXTURES, BidirectionalMap< T, U >::insert(), EngineCore::L0_SHADER, EngineCore::L1_SHADER, EngineCore::L2_SHADER, EngineCore::MOVABLE_DIFFUSE_SHADER, EngineCore::NORMALS_SHADER, and EngineCore::STATIC_LIGHTMAP.

Referenced by getPipelineNameFromString(), and getPipelineNameFromString().

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

◆ getMeshShaderPath()

std::filesystem::path EngineCore::MaterialShader::getMeshShaderPath ( ) const
nodiscard

Getter for the mesh shader path.

Returns
relative path to the mesh shader

Definition at line 17 of file MaterialShader.cpp.

References meshShaderPath.

◆ getPipeline()

GraphicsPipeline * EngineCore::MaterialShader::getPipeline ( ) const
nodiscard

Definition at line 36 of file MaterialShader.cpp.

References pipeline.

◆ getPipelineData()

PipelineMaterialPayload EngineCore::MaterialShader::getPipelineData ( ) const
nodiscard

Definition at line 50 of file MaterialShader.cpp.

References pipelineData.

◆ getPipelineNameFromString() [1/2]

PipelineNames EngineCore::MaterialShader::getPipelineNameFromString ( const std::string & pipelineName)
static

Converts the string name of a pipeline into the actual pipeline enum.

Parameters
pipelineNamethe string to convert to a pipeline name
Returns
pipeline name

Definition at line 62 of file MaterialShader.cpp.

References DEFAULT_MATERIAL_PIPELINE, and getMaterialNameMap().

Here is the call graph for this function:

◆ getPipelineNameFromString() [2/2]

std::string EngineCore::MaterialShader::getPipelineNameFromString ( PipelineNames pipelineName)
static

Gets the pipeline name as string.

Parameters
pipelineNamewhich pipeline to get the string for
Returns
string of the pipeline name

Definition at line 31 of file MaterialShader.cpp.

References getMaterialNameMap().

Referenced by EngineCore::AssetManager::initMaterialStorageBuffer(), and EngineCore::GltfLoader::VulkanSchneeMaterialExtension::VulkanSchneeMaterialExtension().

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

◆ setPipeline()

void EngineCore::MaterialShader::setPipeline ( GraphicsPipeline * pipeline)

Sets the pipeline which corresponds to.

Parameters
pipelineWhat pipeline this material corresponds to

Definition at line 41 of file MaterialShader.cpp.

References pipeline.

◆ toString()

std::string EngineCore::MaterialShader::toString ( ) const
nodiscard

Definition at line 55 of file MaterialShader.cpp.

References meshShaderPath.

Member Data Documentation

◆ defaultFragShader

std::string EngineCore::MaterialShader::defaultFragShader = "assets/Engine/shaders/Output/triangle.frag.spv"
private

Definition at line 79 of file MaterialShader.h.

◆ defaultMeshShader

std::string EngineCore::MaterialShader::defaultMeshShader = "assets/Engine/shaders/Output/triangle.mesh.spv"
private

Definition at line 78 of file MaterialShader.h.

◆ dynamicUniformData

DynamicMaterialUniformData EngineCore::MaterialShader::dynamicUniformData = {}
private

Definition at line 66 of file MaterialShader.h.

◆ fragmentShaderPath

std::filesystem::path EngineCore::MaterialShader::fragmentShaderPath = ""
private

Definition at line 69 of file MaterialShader.h.

Referenced by getFragShaderPath(), MaterialShader(), and MaterialShader().

◆ meshShaderPath

std::filesystem::path EngineCore::MaterialShader::meshShaderPath = ""
private

Definition at line 68 of file MaterialShader.h.

Referenced by getMeshShaderPath(), MaterialShader(), MaterialShader(), and toString().

◆ pipeline

GraphicsPipeline* EngineCore::MaterialShader::pipeline = nullptr
private

Definition at line 75 of file MaterialShader.h.

Referenced by getPipeline(), MaterialShader(), and setPipeline().

◆ pipelineData

PipelineMaterialPayload EngineCore::MaterialShader::pipelineData = {}
private

Definition at line 71 of file MaterialShader.h.

Referenced by getPipelineData().


The documentation for this struct was generated from the following files: