MayaFlux 0.4.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 1255 of file ShaderFoundry.cpp.

1256{
1257 auto vk_stage = Core::VKShaderModule::detect_stage_from_extension(filepath);
1258 if (!vk_stage.has_value()) {
1259 return std::nullopt;
1260 }
1261
1262 switch (*vk_stage) {
1263 case vk::ShaderStageFlagBits::eCompute:
1264 return ShaderStage::COMPUTE;
1265 case vk::ShaderStageFlagBits::eVertex:
1266 return ShaderStage::VERTEX;
1267 case vk::ShaderStageFlagBits::eFragment:
1268 return ShaderStage::FRAGMENT;
1269 case vk::ShaderStageFlagBits::eGeometry:
1270 return ShaderStage::GEOMETRY;
1271 case vk::ShaderStageFlagBits::eTessellationControl:
1273 case vk::ShaderStageFlagBits::eTessellationEvaluation:
1275 case vk::ShaderStageFlagBits::eMeshEXT:
1276 return ShaderStage::MESH;
1277 case vk::ShaderStageFlagBits::eTaskEXT:
1278 return ShaderStage::TASK;
1279 default:
1280 return std::nullopt;
1281 }
1282}
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::MESH, MayaFlux::Portal::Graphics::TASK, 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: