Repository navigation
Conversation
Member
|
I think it needs a rebase (conflicts) |
xen2
reviewed
Sep 13, 2026
| case Op.OpFunction when depth > 0: | ||
| result.Add(((OpFunction)i).ResultId); | ||
| break; | ||
| if ((FunctionType)member.Type == signature) |
Member
There was a problem hiding this comment.
After the rebase, this should skip composition functions, like ResolveEntryPoint now does on master (#3382).
A composition that also derives from ComputeShaderBase has its own CSMain in the same group. Right now it would end up in the chain, and its [numthreads] could win over the real entry point's.
if ((FunctionType)member.Type == signature && !compositionFunctions.Contains(member.IdRef))
Contributor
Author
There was a problem hiding this comment.
Good catch, missed that. Done.
Each override of an entry point compiles with its own execution modes on its own function id. The interface processor moved only the modes of the most derived method to the wrapper. The base modes stayed on a function that is no longer an entry point, and spirv-val rejected the module. A hull override without attributes failed earlier, because FindOutputPatchSize looked at the most derived method only. The processor now walks the override chain from the most derived method down. The first declaration of each mode wins. Repeats from a base method are dropped. The patch constant decoration and the output patch size use the same walk. Fixes stride3d#3430 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VHYKv129fEUp6sxMbybZWf
A composition that derives from the same compute base has its own CSMain in the method group. Without the filter it joined the chain and its [numthreads] won over the entry point's. ResolveOverrideChain now skips the functions that CollectCompositionFunctions found, as ResolveEntryPoint does. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VHYKv129fEUp6sxMbybZWf
sasvdw
force-pushed
the
fix/sdsl-entrypoint-override-execution-modes
branch
from
September 13, 2026 12:57
8556d6a to
09dc1c3
Compare
Contributor
Author
rebased and ready for reveiw! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Details
Each override of an entry point compiles with its own execution modes on its own function id.
InterfaceProcessor.GenerateStreamWrappermoved only the modes of the most derived method to the wrapper. The base modes stayed on a function that is no longer an entry point, andspirv-valrejected the module whileMergeSDSLreturned true. A hull override without attributes failed earlier, becauseFindOutputPatchSizelooked at the most derived method only.Policy. The most derived declaration of each mode wins. An override that restates an attribute replaces the base value. An override that omits it keeps the base value.
ComputeShaderBase.CSMaincarries[numthreads(ThreadNumberX, ...)], so an override that only adds setup and callsbase.CSMain()keeps itsLocalSize. The stricter option, drop unless restated, is the same code without the walk to the base, so it is cheap to switch if preferred.Change.
ResolveOverrideChainreturns the function ids of the entry point and the methods it overrides, base first. The method group also holds overloads and composition functions, so the chain keeps only members with the entry point's signature and skips composition functions, asResolveEntryPointdoes.GenerateStreamWrapperwalks the chain from the most derived method down, moves the first declaration of each mode to the wrapper, and drops repeats.FindOutputPatchSizeandResolveHullPatchConstantEntryPointuse the same walk.Tests. New cases in
StrideShaderTests, each against a corpus shader:CSNumThreadsOverride: the override restates[numthreads]. OneLocalSize, the derived value.CSNumThreadsInherit: the override omits it. OneLocalSize, the base value.HSOverride: the override declares no hull attributes.outputcontrolpointsandpatchconstantfunccome from the base.ComposeNumThreadsRootandComposeNumThreadsInheritRoot: the composed helper derives from the same base and carries its own[numthreads]. It stays out of the chain, so the root's value, or the base's, wins.The override cases fail on master, two with the validator error and one in
FindOutputPatchSize. The composition cases fail without the composition filter.Related Issue
Fixes #3430
Types of changes
Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01VHYKv129fEUp6sxMbybZWf