SDSL rewrite#3134
Open
xen2 wants to merge 1211 commits intostride3d:masterfrom
Open
Conversation
Uniform variables with initializers (e.g. stage float x = 2.0f) are now compiled as constants instead of wrapper functions. This avoids illegal stores to cbuffer members in the generated HLSL/SPIR-V, and allows extracting DefaultValue for EffectReflection.
…oper diagnostic later)
… a LogicalGroup (thanks @johang88 for the repro)
…is shared. Also added ShaderSource in C# format in meta.hlsl
… without ImportStageOnly
Generic parameters of resource types (Texture2D, Buffer, StructuredBuffer, ByteAddressBuffer) need the same PointerType wrapping as member variables, otherwise code accessing them fails with a cast exception.
… (do not deduplicate)
Add CompositionStageInheritedNotPromotedToRoot test and surface compilation errors in RenderingTests instead of swallowing them.
… (already handled)
…ctions, and pass them directly as pointer
…if requested at same time from multiple threads
Add Frozen property and FreezeableDictionary wrapper for Types/ReverseTypes/Names. Freeze contexts after caching in ShaderCache.RegisterShader to catch accidental mutations during development. ThrowIfFrozen guards on mutating methods.
No C# code launches glslangValidator — the binary was only being copied into output by the legacy Stride.Shaders.Compiler.csproj and the active Stride.Shaders.Compilers.csproj. Drop both <StrideNativeLib> entries, the deps/glslang/ payload, the test-linux-game cleanup line that deleted it from outputs, and update the leftover comment in RestoreHelper that named it as an example.
The light-probe Z-prepass binds DSV only and was reusing StrideForwardShadingEffect.ShadowMapCaster, which works but is semantically a shadow caster. Add a dedicated ZPrepass mixin child (same alpha-discard branching as ShadowMapCaster) and switch the GBuffer render stage in DefaultGraphicsCompositorLevel10 to it. Also move the ShadowMapCaster*/ZPrepass child declarations before mixin StrideLighting in StrideForwardShadingEffect: depth-only sub-effects don't need lighting, so the alpha-discard variants no longer drag the lighting compose chain through base.PSMain().
ShadowMapCasterAlphaDiscard / ShadowMapCasterAlphaDithered used to chain through base.PSMain(), which writes streams.ColorTarget — that declared SV_Target0 in the PS output signature. Since shadow casting and the light-probe Z prepass bind only a depth target, every draw on those shaders would emit the D3D11 "PS expects RT View bound to slot 0, but none is bound" warning. Refactor both shaders to call this.Shading() directly to populate streams.shadingColorAlpha through the material surface chain, then clip without ever touching ColorTarget. The merged-effect Shading() override (MaterialSurfacePixelStageCompositor) runs the layered material chain identically to the regular pass, so per-layer contributions to the alpha are preserved. InterfaceProcessor previously dropped the Fragment entry point when nothing wrote SV_Target/SV_Depth, which would silently strip these shaders' PS entirely (clip never runs, transparent cutout pixels write depth). Detect "empty PSMain" by inspecting the SPIR-V function body instead — only the no-op PS case (e.g. ShadowMapCasterNoPixelShader) is dropped, preserving the depth-only fast path. Any side-effecting body (clip()/discard, stores, calls) keeps the PS bound.
Mini-dumps don't include the managed heap, so post-mortem analysis of shader-compiler AVs can't dereference any of the captured pointers. Switch all three Windows test crash-dump paths to full memory: - DOTNET_DbgMiniDumpType: 1 (Normal) -> 4 (FullMemory) - WER LocalDumps DumpType: 1 (Mini) -> 2 (Full) - Stride FirstChance SEH: add MiniDumpWithFullMemory and MiniDumpWithHandleData to the previous flag set (the existing MiniDumpWithFullMemoryInfo only captures region descriptors, not pages) Linux test workflow has no dump env vars set, so it's unchanged.
These were written next to the source by the old custom MSBuild tool; they are now produced by the Roslyn source generator into obj/. The on-disk siblings are dead weight (excluded from build but still in source trees and version control). The 4.3 -> 4.4 step in StridePackageUpgrader: - Renames .sdsl.cs / .sdfx.cs to .bak in the project tree (skipping obj/ and bin/) so users can recover without git. - Strips leftover csproj item nodes referencing those paths. - Strips obsolete <Generator> / <LastGenOutput> metadata from .sdsl and .sdfx items. Drop the now-unnecessary <Compile Remove> rules from Stride.Shaders.Compilers.targets. The <None Remove> rules for .sdsl and .sdfx source files stay -- they keep source files out of the default <None> glob.
CompileSincos was passing the sincos function's FunctionType to the GLSL Sin/Cos helpers, which take their result type from functionType.ReturnType. sincos returns void, so the emitted SPIR-V was OpExtInst %void Sin %x -- rejected by spirv-val with "GLSL.std.450 Sin: expected Result Type to be a 16 or 32-bit scalar or vector float type". Synthesize a function type whose ReturnType is x's float type and use that for the Sin/Cos extinsts.
…nctionType
The static intrinsic helpers (CompileFloatUnaryCall,
CompileGLSLFloatUnaryCall, CompileGLSLFloatBinaryCall,
CompileBitcastCall, MultiplyConstant, CompileBoolToScalarBoolCall)
took FunctionType only to read functionType.ReturnType. That coupled
the result-type decision to the intrinsic's declared return type,
which is wrong for void-returning intrinsics like sincos and forced a
"functionType with { ReturnType = ... }" workaround at the call site.
Take SymbolType resultType directly so the result-type intent is
local to each call site. CompileSincos can now pass the float type
without synthesizing a function type.
CompileInterlockedCall, CompileMemoryBarrierCall and
CompileControlBarrierCall never used FunctionType at all -- drop the
parameter.
# Conflicts: # .github/workflows/test-linux-game.yml # .github/workflows/test-linux-simple.yml # .github/workflows/test-windows-game.yml # .github/workflows/test-windows-simple.yml
graphics: revert SetMuteDebugOutput, also gates the callback path
…sync GPU validation
# Conflicts: # sources/Directory.Packages.props
- error.log: open with FileShare.ReadWrite|Delete so the orchestrator can copy it while still held - ScreenshotRunner: WaitForExit after Kill so the OS finishes releasing handles before we copy - ci: stop continue-on-error for D3D12/Vulkan now that they should be reliable
… same view ForwardLightingRenderFeature.Prepare threw when two effects in the same RenderView resolved to different PerView Lighting logical-group layouts (e.g. different light permutation counts). Mirror the per-hash variant pattern from MaterialRenderFeature: keep one ParameterCollectionLayout + ParameterCollection per layout hash inside RenderViewLightData, apply view parameters once per variant per frame, bind each layout's resource group from its matching variant.
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
WIP (created as non-draft for CI testing)
Related Issue
Types of changes
Checklist