summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-modifier.h
diff options
context:
space:
mode:
authorArielG-NV <159081215+ArielG-NV@users.noreply.github.com>2024-08-28 15:06:23 -0400
committerGitHub <noreply@github.com>2024-08-28 12:06:23 -0700
commit65240d074b4ddec55e56962ebf8de46207bcf5fa (patch)
treefa887d3de8ab55c7498eae2d5bf61966818135a1 /source/slang/slang-ast-modifier.h
parent638e5fb000d4e242a91e8b653da4a72daec0efda (diff)
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 <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-ast-modifier.h')
-rw-r--r--source/slang/slang-ast-modifier.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/source/slang/slang-ast-modifier.h b/source/slang/slang-ast-modifier.h
index 14e945e25..8c9cb484f 100644
--- a/source/slang/slang-ast-modifier.h
+++ b/source/slang/slang-ast-modifier.h
@@ -924,17 +924,15 @@ class InstanceAttribute : public Attribute
int32_t value;
};
-// A `[shader("stageName")]` attribute, which marks an entry point
-// to be compiled, and specifies the stage for that entry point
-class EntryPointAttribute : public Attribute
+// A `[shader("stageName")]`/`[shader("capability")]` attribute which
+// marks an entry point for compiling. This attribute also specifies
+// the 'capabilities' implicitly supported by an entry point
+class EntryPointAttribute : public Attribute
{
SLANG_AST_CLASS(EntryPointAttribute)
-
- // The resolved stage that the entry point is targetting.
- //
- // TODO: This should be an accessor that uses the
- // ordinary `args` list, rather than side data.
- Stage stage;
+
+ // The resolved capailities for our entry point.
+ CapabilitySet capabilitySet;
};
// A `[__vulkanRayPayload(location)]` attribute, which is used in the