diff options
Diffstat (limited to 'source/slang/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 4fa6f5130..2861b82ca 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -138,6 +138,41 @@ Profile getEffectiveProfile(EntryPointRequest* entryPoint, TargetRequest* target } } + // Now consider the possibility that the chosen stage might force an "upgrade" + // to the profile level. + ProfileVersion stageMinVersion = ProfileVersion::Unknown; + switch( effectiveProfile.getFamily() ) + { + case ProfileFamily::DX: + switch(effectiveProfile.GetStage()) + { + default: + break; + + case Stage::RayGeneration: + case Stage::Intersection: + case Stage::ClosestHit: + case Stage::AnyHit: + case Stage::Miss: + case Stage::Callable: + stageMinVersion = ProfileVersion::DX_6_1; + break; + + // TODO: Add equivalent logic for geometry, tessellation, and compute stages. + } + break; + + // TODO: Add equivalent logic for the GL/VK case. + + default: + break; + } + + if( stageMinVersion > effectiveProfile.GetVersion() ) + { + effectiveProfile.setVersion(stageMinVersion); + } + return effectiveProfile; } |
