diff options
Diffstat (limited to 'source/slang/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index b95b21bb5..e99f94484 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -858,7 +858,7 @@ Profile getEffectiveProfile(EntryPoint* entryPoint, TargetRequest* target) case CodeGenTarget::SPIRVAssembly: if(targetProfile.getFamily() != ProfileFamily::GLSL) { - targetProfile.setVersion(ProfileVersion::GLSL_110); + targetProfile.setVersion(ProfileVersion::GLSL_150); } break; @@ -869,7 +869,7 @@ Profile getEffectiveProfile(EntryPoint* entryPoint, TargetRequest* target) case CodeGenTarget::DXILAssembly: if(targetProfile.getFamily() != ProfileFamily::DX) { - targetProfile.setVersion(ProfileVersion::DX_4_0); + targetProfile.setVersion(ProfileVersion::DX_5_1); } break; } @@ -1608,6 +1608,8 @@ CapabilitySet TargetRequest::getTargetCaps() break; } + CapabilitySet targetCap = CapabilitySet(atoms); + CapabilitySet latestSpirvCapSet = CapabilitySet(CapabilityName::spirv_latest); CapabilityName latestSpirvAtom = (CapabilityName)latestSpirvCapSet.getExpandedAtoms()[0].getExpandedAtoms().getLast(); for (auto atom : rawCapabilities) @@ -1623,7 +1625,11 @@ CapabilitySet TargetRequest::getTargetCaps() atom = (CapabilityName)((Int)CapabilityName::glsl_spirv_1_0 + ((Int)atom - (Int)CapabilityName::spirv_1_0)); } } - atoms.add(atom); + if (!targetCap.isIncompatibleWith(atom)) + { + // Only add atoms that are compatible with the current target. + atoms.add(atom); + } } cookedCapabilities = CapabilitySet(atoms); |
