From 65240d074b4ddec55e56962ebf8de46207bcf5fa Mon Sep 17 00:00:00 2001 From: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:06:23 -0400 Subject: Allow capabilities to be used with `[shader("...")]` (#4928) * Allow capabilities to be used with `[shader("...")]` Fixes: #4917 Changes: 1. Allow using capabilities instead of `Stage`s with `EntryPointAttribute`. 2. When resolving capabilities for an entrypoint+profile (per entrypoint) in `resolveStageOfProfileWithEntryPoint` add our `EntryPointAttribute` and resolved capability 3. Added tests and some capabilities related clean-up * fix a warning made by a mistake in syntax * change fineStageByName to assume it is passed a stage without a '_' * test with and without prefix '_' * cleanup some profiles and reprisentation to work better with 'Stage' and 'Profile' This use case is why we need to clean all profile-usage into `CapabilityName`s directly. * change how we compare * only change profiles * let all capabilities be resolved by 'shader' profile for now * fix warning checks I accidently broke * meshshading_internal to _meshshading --------- Co-authored-by: Yong He --- source/slang/slang.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index aa114e44d..23e25249d 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -1749,7 +1749,7 @@ CapabilitySet TargetRequest::getTargetCaps() // If the user specified a explicit profile, we should pull // a corresponding atom representing the target version from the profile. - CapabilitySet profileCaps = CapabilitySet(optionSet.getProfile().getCapabilityName()); + CapabilitySet profileCaps = optionSet.getProfile().getCapabilityName(); bool isGLSLTarget = false; switch(getTarget()) -- cgit v1.2.3