MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ detect_stage_from_extension()

std::optional< ShaderStage > MayaFlux::Portal::Graphics::ShaderFoundry::detect_stage_from_extension ( const std::string &  filepath)
static

Auto-detect shader stage from file extension.

Parameters
filepathPath to shader file
Returns
Detected stage, or nullopt if unknown

Delegates to VKShaderModule::detect_stage_from_extension().

Definition at line 1232 of file ShaderFoundry.cpp.

1233{
1234 auto vk_stage = Core::VKShaderModule::detect_stage_from_extension(filepath);
1235 if (!vk_stage.has_value()) {
1236 return std::nullopt;
1237 }
1238
1239 switch (*vk_stage) {
1240 case vk::ShaderStageFlagBits::eCompute:
1241 return ShaderStage::COMPUTE;
1242 case vk::ShaderStageFlagBits::eVertex:
1243 return ShaderStage::VERTEX;
1244 case vk::ShaderStageFlagBits::eFragment:
1245 return ShaderStage::FRAGMENT;
1246 case vk::ShaderStageFlagBits::eGeometry:
1247 return ShaderStage::GEOMETRY;
1248 case vk::ShaderStageFlagBits::eTessellationControl:
1250 case vk::ShaderStageFlagBits::eTessellationEvaluation:
1252 default:
1253 return std::nullopt;
1254 }
1255}
static std::optional< vk::ShaderStageFlagBits > detect_stage_from_extension(const std::string &filepath)
Auto-detect shader stage from file extension.

References MayaFlux::Portal::Graphics::COMPUTE, MayaFlux::Core::VKShaderModule::detect_stage_from_extension(), MayaFlux::Portal::Graphics::FRAGMENT, MayaFlux::Portal::Graphics::GEOMETRY, MayaFlux::Portal::Graphics::TESS_CONTROL, MayaFlux::Portal::Graphics::TESS_EVALUATION, and MayaFlux::Portal::Graphics::VERTEX.

Referenced by load_shader().

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