Releases: shader-slang/slang
v2025.5
79aebc18d disable nanothread dependency (#6312) 8d47910e9 slang-rhi cmake integration (#6261) 654b96933 Add test for visibility in translation unit with multiple source files (#6306) 252e13cb3 Mark slangpy as deprecated and remove from user-guide. (#6300) f5551eb94 Uncomment a previously failing test case (#6303) d00fa5ced Update a3-reference.md (#6309) bae87afb2 Support stage_switch. (#6311) 075b10e69 Don't overwrite existing module decl scopes when parsing new source files (#6292) 6b63ff026 Allow tuples to work with initializer list. (#6301) 78f26f076 Add floating-point pack/unpack proposal (#6191) bbaaab48a Fix matrix comparison operators on CPU (#6296) f5700bd3e Fix inline markdown rendering (#6294) 3527f0975 Enable D3D12 experimental feature to use coopvec (#6290) d8a8559a5 maxtessfactor attribute should take a floating point value (#6289) f6cbb81e1 Fix DCE for calls to functions that have associations (#6272) 7911c9437 Use two-stage parsing to disambiguate generic app and comparison. (#6281) 613f43a08 Switch back to Falcor (#6295) 9ec6b9168 Feature/initialize list side branch (#6058) 4b3506450 Fix autodiff issue for vector<T, N> (#6275) d3e5f39ca Use 0.0.7 version of VK-GL-CTS-for-Slang on nightly CTS CI (#6278) fe77f076b Fix non-square matrix derivatives (#6282) 78a6389aa Fix warning about push constants, shaderRecordEXT (#6269) 77c59d4a1 Correct NVAPI include (#6263) b832338c1 Fix parsing of nested generic app. (#6259) bcf5302dd Auto enable `-fvk-use-entrypoint-name` when there is more than one entrypoint. (#6260) bc2f20aab Fix native Windows ARM64 build. (#6244) 0a6828572 Add support for WGSL subgroup operations (#6213) 2949b786a Update Slang-RHI and enable any debug layers up-front (#6226) 16b7be65d Fix build issue when SLANG_EMBED_CORE_MODULE is OFF. (#6243)
v2025.4
Slang v2025.4 Changes: 5173c8748 Include slang-glsl-module.dll in releases, for precompiled glsl module. (#6239) a026df756 Respect per-target debug options (#6193) eebe84907 Distribute slang-glsl-module.bin in release packages. (#6233) ae778e342 [Docs] Auto-diff documentation overhaul (#6202) 21893763c Declare `VariablePointers` capability when needed. (#6231)
v2025.3.3
Supports Cooperative Vector
=== Breaking changes ===
No breaking changes
=== All changes for this release ===
fb052bf Support cooperative vector including Vulkan-Header (#6228)
7a8131d Add coop-vec insts to non-differentiable insts list (#6227)
ba9b278 Support cooperative vector (#6223)
2ae194d Fix ConstantIntVal::toText when the val is a enum. (#6224) (#6225:client support)
cbcb97a Update SPIRV submodules and fix tests (#6222)
2ba6458 Fix combined sampler documentation and warning (#6207) (#5938:quality & productivity)
6052043 Fix the type coerce issue (#6215)
c18c436 Fix loophole in hoisting where an OpVar
's uses might not be properly registered for replacement (#6212)
1c282b8 Implement WaveMultiPrefix* for SPIRV and GLSL (#6182) (#6180:client support)
cf66563 Fix exact-match witness synthesis for static functions (#6204)
1f99c20 Fix UIntSet calcSubtract to handle mismatched buffer sizes (#6205)
f4e3692 Proposal for Cooperative Vector in Slang (#6209)
b3c6212 Add slangpy proposal (#6156)
c356d3a Allow requiring glsl language extensions on structs (#6173)
a5b1aa0 Added const version for the operator[] in Matrix (#6186)
92a48f6 Delete invalid ASSERT in isTypeOperandEqual
. (#6196) (#6194:quality & productivity)
4b9a342 Fix geometry shader related modifier lowering. (#6197) (#6185:quality & productivity)
cd27fbd Add a unit test to cover type-conformance compilation API. (#6178) (#6179:quality & productivity)
31bb5ea Add an example for reflection of parameter blocks (#6161)
f030a5a Properly plumbing layout for global varyings. (#6198) (#6188:quality & productivity)
vulkan-sdk-1.4.304.1
Merge/vsdk 1.4.304 (#6199) * Fix prebuilt dependencies filenames on non-windows platforms (#5848) * Correct casing of windows includes (#5849) * Bump imgui for include fix (#5854) * Add missing header for _getpid() (#5852) * Set default hidden visibility for all source on gcc (#5850) * Correctly distinguish between windows and MSVC (#5851) Partially sorts https://github.com/shader-slang/slang/issues/5843 * Add SLANG_ENABLE_DXIL (#5853) * WGSL: Fix issue where global calls are generated (#5768) * Split out SPIR-V -specific legalization of global functions This is a refactoring and should not affect generated code. * Move global inst inlining code into separate function This is a refactoring and should not affect generated code. * Take SPIR-V -specific parts out of GlobalInstInliningContext This is a refactoring and should not affect generated code. * Move 'inlineGlobalValues' to generic inlining context This is a refactoring and should not affect generated code. * Move 'setInsertBeforeOutsideASM' to generic inlining context This is a refactoring and should not affect generated code. * Move generic inlining context into own file This is a refactoring and should not affect generated code. * Run global inlining for WGSL as well * Make the 'getOutsideASM' function generic as well * Enable language-feature/constants/static-const-in-generic-interface.slang for WebGPU * Clarify when it's safe to remove and deallocate an IRInst * Remove globals if they're left unused after inlining This closes #5607. * Handle IRGlobalValueRef in C-like emitter * format code --------- Co-authored-by: slangbot <[email protected]> * Add an example for using the reflection API (#5839) * Add an example for using the reflection API The example program is meant to accompany a document that goes into more detail about the mental model behind the reflection API and the way this program drives it. Ideally this program can land before the document goes live, and then the document can be published with a link to the example. After that, the example could be updated to include links into the live document. Along with adding the example program, this change also adds some convenience functions to the reflection API to avoid cases where the program would otherwise need to cast between `slang::ParameterCategory` and `SlangParameterCategory`. * format code * fixup: error noticed by clang --------- Co-authored-by: slangbot <[email protected]> * use Release over RelWithDebInfo for ci (#5846) This will necessetate changing the "required tests" setting on the GitHub repo Co-authored-by: Yong He <[email protected]> * Bit extract (#5847) * promoting bitfield extraction and insertion to become intrinsics for internal compiler use * removing duplicate intrinsics from glsl.meta.slang * refactor: update function signatures of bitfield extraction and insertion to use uint as the parameter type for offset and bits. --------- Co-authored-by: Nate Morrical <[email protected]> Co-authored-by: Yong He <[email protected]> * Make slang-rhi's NVAPI support conditional on SLANG_ENABLE_NVAPI (#5855) * bump slang-rhi * More precise slang-rhi settings --------- Co-authored-by: Yong He <[email protected]> * Update reflection API chapter in User Guide (#5868) * Update reflection API chapter in User guide The new version of the chapter is intended to accompany the `reflection-api` example program, and reflects (pun intended) the best practices that the Slang project team wants to encourage for interacting with the reflection API. * Rebuild TOCs * Enable exprs for all supported GLSL layout qualifiers (#5857) * install mono for toc generation (#5877) Closes https://github.com/shader-slang/slang/issues/5876 * Support matrix negation in metal backend. (#5891) * Fix `getArgumentValueFloat` when arg is int. (#5888) * Fix `getArgumentValueFloat` when arg is int. * format code --------- Co-authored-by: slangbot <[email protected]> * Update 09-reflection.md (#5886) * Fix entrypoint auto discovery logic. (#5885) * Fix entrypoint auto discovery logic. * format code --------- Co-authored-by: slangbot <[email protected]> * Implement bitcast for 64-bit date type (#5895) Close #5470 * implement bitcast for 64-bit date type * Move 'ensurePrelude' to base class to remove duplication * Assert on 'double' type for Metal target, as Metal doesn't have 'double' support * Support specializing generic entrypoints in `findAndCheckEntryPoint`. (#5890) * Add verification logic on push and specialization constants. (#5887) * Add verification logic on push and specialization constants. * format code --------- Co-authored-by: slangbot <[email protected]> * Add slang example tests to CI (#5879) * Examples: Don't proceed if 'initializeBase' fails * Examples: Only access gWindow if it's been initialized * Examples: Free memory from CommandLineToArgvW * Add example run step to CI Lots of examples are still unexpectedly failing, but is one small step towards addressing issue #5520. * Allow `Optional`, `Tuple` and `bool` to be used in varying input/output. (#5889) * Allow `Optional` and `Tuple` to be used in varying input/output. * Fix. * format code * Fix. * Fix test. * Fix. * enhance test. * Fix. * format code --------- Co-authored-by: slangbot <[email protected]> * Fix metadata of register space and varying params. (#5906) * Support explicit `[vk::location(n)]` binding on metal/wgsl. (#5907) * Check decl nesting for namespaces. (#5910) * Fix the parser issue for not recognize Generic<T>[N] (#5912) Close #5911. In this issue, if we define the generic in source file 1, and import it into source file 2, then when parsing the reference of that generic in source file 2, we will not parse the generic directly, instead we have a logic to speculate it as generics first with a fake diagnostic sink, and if there is no error report, we will consider it as a actual generic and will parse it again. In this logic, we will also disambiguate the expression based on the following token, but we didn't consider the token '[', so we will finally not treat the expression as generic. The fix is just simply add '[' here. Co-authored-by: Yong He <[email protected]> * Refresh list of failing examples (#5904) This helps to address issue #5520. * Fix issues reported by 'shellcheck' (#5913) * Fix issues reported by 'shellcheck' This helps to address issue #5520. * format code --------- Co-authored-by: slangbot <[email protected]> * Report error when generated spirv is empty. (#5899) * Report error when generated spirv is empty. * format code --------- Co-authored-by: slangbot <[email protected]> Co-authored-by: Ellie Hermaszewska <[email protected]> * Readme corrections (#5874) Closes https://github.com/shader-slang/slang/issues/4806 * Add HLSL texture sample with status intrinsics (#5901) * Implement HLSL texture sample with status intrinsics * fix test and cleanup --------- Co-authored-by: Yong He <[email protected]> * Enable more examples in CI (#5915) * CI: examples: Add support for filtering on platform * Add platform field to example run IDs - Remove the reflection-api entry for Windows. - Add 'aarch64' as platform for all 'macos' entries. - Add 'x86_64' as platform for all other entries. - This will implicitly enable all aarch64 tests for Linux. This helps to address issue #5520. * Add base vertex and base instance system values (#5918) * Add base vertex and base instance system values * Fixed incorrect stage in tests * Fix crash during loop unrolling. (#5920) * Check subscript/property accessor for differentiability. (#5922) * Fix WASM build (#5925) There is no objcopy and strip for WASM, so disable debug info stripping. This closes #5924. * Fixed stage and result field names in json reflection (#5927) * update CTS package (#5935) * Reflection API Wasm Bindings Part1 (#5936) * add a lot of missing classes, functios and enums * typescript defintion generation * formatting * format code --------- Co-authored-by: slangbot <[email protected]> * Support dispatchComputeIndirect and draw(Indexed)Indirect with count buffer for Vulkan (#5929) * Support gfx ComputeCommandEncoder::dispatchComputeIndirect for Vulkan * Support count buffer for Vulkan in gfx RenderCommandEncoder::drawIndirect and RenderCommandEncoder::drawIndexedIndirect * Fix an unintended change * Fix format issue --------- Co-authored-by: Yong He <[email protected]> * Add packed 8bit builtin types (#5939) * Add packed bytes builtin type * fix test * Fix parsing GLSL SSBO arrays / bindless descriptors (#5932) * Fix parsing GLSL SSBO arrays / bindless descriptors * Clean up SSBO array parsing * Fix mutable SSBO arrays not being detected as such * Allow sized SSBO arrays * format code --------- Co-authored-by: slangbot <[email protected]> Co-authored-by: Yong He <[email protected]> * Fix tiny typos (#5944) * Implement HLSL pack/unpack math intrinsics (#5934) * Prevent constant folding for specialization constants (#5953) * Skip uninitialized-use warning on hitAttributeEXT-decorated globals (#5952) * Add a basic WebGPU example (#5923) * Add a basic WebGPU example This helps to address #5656. * Use serial await rather than Promise.all * Fix requirement candidate lookup to prefer decls in the same paraent as the inheritance decl. (#5965) * Check mismatching method parameter direction against interface declaration. (#5964) * Add `RaytracingAccelerationStructure::__init(uint64_t)`. (#5967) * LanguageServer: fix highlighting of wrapper type. (#5968) * Check for undefined %id in spirv_asm block. (#5966) * Fix `getInheritanceInfo` for `ExtractExistentialType`. (#5971) * Add terminateRayEXT & ignoreIntersectionEXT (#5974) * Fix reflection for metal vector [[id]] location. (#5943) * add missing IR_LEAF_ISA for MetalMeshType (#5975) Co-authored-by: Yong He <[email protected]> * Fixed incorrect condition in Session::queryInterface. (#5978) An AND operator was used where an OR should have been used. * Allow explicit test root (#5980) * Correct IR generation for no-diff pointer type (#5976) * Correct IR generation for no-diff pointer type Close #5805 There is an issue on checking whether a pointer type parameter is no_diff, we should first check whether this parameter is an Attribute type first, then check the data type. In the back-propagate pass, for the pointer type parameter, we should load this parameter to a temp variable, then pass it to the primal function call. Otherwise, the temp variable will no be initialized, which will cause the following calculation wrong. * Fix parameter location reflection for pure data paramblocks. (#5956) * Create DirectDeclRef when creating Decl to prevent invalid dedup. (#5945) * Create DirectDeclRef when creating Decl to prevent invalid dedup. * Fix test. * fix * update slang-rhi * Make 'shared' keyword map to 'groupshared' in GLSL mode (#6003) * CI: Build the full slang-wasm.[js|wasm] targets instead of just the slang library. (#5998) A recent build breakage for slang-wasm.[js|wasm] was not noticed by CI since it built the slang library target instead of the slang-wasm.js "executable" target. (We added a that used objcopy to split debug info from executables. objcopy does not report errors when it finds object files with unexpected format inside static libraries, but it *does* report errors when it's run on an exceutable of unexpected format, such as in the case of slang-wasm.js.) This closes #5959. * Fix GLSL mix(T,T,bool) SPIR-V output (#6006) * Add support for textureLod with sampler2DArrayShadow (#6009) * Add `Bindless<T>` proposal. (#6002) * Add `Bindless<T>` proposal. * Clarify on what happesn if native bindless T has different size/alignment. * Add discussion on alternatives. * Update reviewer. * Properly set D3D12SDKPath (#5993) * Properly set D3D12SDKPath Closes https://github.com/shader-slang/slang/issues/5992 This commit have an effect on slang-test.exe and test-server.exe. When we run slang-test.exe, it uses D3D12Core.DLL located at `build/{Release,Debug}/bin/D3D12`, which is `D3D12` from where the executable file is located at. This has been working fine but we found a case where it doesn't work properly. This commit sets D3D12SDKPath value explicitly to avoid potential problems. * Use disassemble API from SPIRV-Tools (#6001) * Use disassemble API from SPIRV-Tools This commit uses C API version of SPIRV disassemble function rather than calling spirv-dis.exe. This allows us to use a correct version of SPIRV disassble function that Slangc.exe is using. The implementation is mostly copied from external/spirv-tools/tools/dis/dis.cpp, which is a source file for building spirv-dis.exe. This commit also includes a fix for a bug in RPC communication to `test-server`. When an RPC connection to `test-server.exe` is reused and the second test abruptly fails due to a compile error or SPIRV validation error, the output from the first test run was incorrectly reused as the output for the second test. This commit resets the RPC result before waiting for the response so that even when the RPC connection is erratically disconnected, the result from the previous run will not be reused incorrectly. Some of the tests appear to be relying on this type of behavior. By using an option, `-skip-spirv-validation`, the RPC connection will continue without an interruption. * Fix some robustness issues in the examples (#5984) * examples: Make hello-world example exit gracefully if VK cannot be initialized - Check if VK API function pointers are valid before using them - Return 0 and exit if VK initialization fails - Enable hello-world example * examples: Fixes for ray-tracing examples - Assert that accelleration structure buffer is not nullptr - Check if buffer creation succeeded before proceeding - This makes initialization not hang, but it still fails. Therefore, the test expectations are just updated to point to another issue. - Enable ray-tracing tests on Windows * Add example showing how to use Slang/WASM (#5996) This closes #5656. * Check whether array element is fully specialized (#6000) * Check whether array element is fully specialized close #5776 When we start specialize a "specialize" IR, we should make sure all the elements are fully specialized, but we miss checking the elements of an array. This change will check the it. * add test * add all wrapper types into the check * add utility function to check if the type is wrapper type --------- Co-authored-by: zhangkai <[email protected]> Co-authored-by: Yong He <[email protected]> * Lower varying parameters as pointers instead of SSA values. (#5919) * Add executable test on matrix-typed vertex input. * Fix emit logic of matrix layout qualifier. * Pass fragment shader varying input by constref to allow EvaluateAttributeAtCentroid etc. to be implemented correctly. * Add backtraces to examples (#5973) * examples: Log stack trace on exceptions For now, this is only implemented on Windows. This helps to address #5520. * examples: Print log file if there is any * format code --------- Co-authored-by: slangbot <[email protected]> Co-authored-by: Yong He <[email protected]> * slang-test: Ensure runtime is consistent (#6021) I hit issue #5305 again after re-generating the build directory, building and then running slang-test. In other words, D3D12 and Slang-RHI/WebGPU/D3D12 failed to create a device due to the runtime being incosistent. Bilding copy-prebuilt-binaries fixed it, and so it's best to make this step a dependency of slang-test. * Add SampleCmpLevel intrinsics (#6004) * add SampleCmpLevel intrinsics * update tests * fix typo * fix broken glsl test * refactor SampleCmpLevelZero * fix metallib test * fix broken test on dx12 --------- Co-authored-by: Yong He <[email protected]> * Add parentheses to make precedence explicit (#6030) * Add parentheses to make precedence explicit Add parentheses for a few cases that Dawn/Tint (WGSL compiler) complains about. Closes #6005. * format code --------- Co-authored-by: slangbot <[email protected]> Co-authored-by: Yong He <[email protected]> * Pass compiler specific args to GCC and Visual Studio too (#6019) Co-authored-by: Yong He <[email protected]> * update slang-rhi (#6045) * [Auto-diff] Overhaul auto-diff type tracking + Overhaul dynamic dispatch for differentiable functions (#5866) * Overhauled the auto-diff system for dynamic dispatch * More fixes * remove intermediate dumps * Update slang-ast-type.h * More fixes + add a workaround for existential no-diff * Update reverse-control-flow-3.slang * remove dumps * remove more dumps * Delete working-reverse-control-flow-3.hlsl * Cleanup comments + unused variables * More comment cleanup * Add support for lowering `DiffPairType(TypePack)` & `MakePair(MakeValuePack, MakeValuePack)` * Fix array of issues in Falcor tests. * Update slang-ir-autodiff-pairs.cpp * More fixes for Falcor image tests * Small fixups. --------- Co-authored-by: Yong He <[email protected]> * Upgrade actions/upload-artifact from v3 to v4 (#6051) The version 3 of actions/upload-artifact will be deprecated soon. https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/ This commit upgrades to v4. There is a document describing how to migrate/upgrade: https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md The breaking change on v4 is that the uploaded files are immutable and we can no longer append files with the same name. We don't seem to be doing it so it should be fine for us. Closes #6050 * Fix implicit string conversion breaking NativeStrings (#6035) * Fix implicit string conversion breaking NativeStrings * Allow string literals to coerce to either string type * Add test for CPU string passing --------- Co-authored-by: Yong He <[email protected]> * `[[shader_record]] / [[push_constant]]` Param Annotations Proposal (#6053) * Add files via upload Adding first draft at proposal to disambiguate the use of uniform with ray tracing entry points. * Update and rename 000-shader-record.md to 017-shader-record.md * Support a storage class, NodePayloadAMDX, for SPIRV work-graphs (#6052) In order to unblock experiments with SPIRV work-graphs, Slang needs to support the storage class, `NodePayloadAMDX`. Note that this commit is only to support a storage class, `NodePayloadAMDX`. There are many parts required for work-graphs hasn't been implemented yet. The implementation of `DispatchNodeInputRecord` is not required, but it is implemented mostly for a testing purpose. Closes #6049 Co-authored-by: Yong He <[email protected]> * Add CalculateLevelOfDetail* overloads for comparison samplers (#6018) * add CalculateLevelOfDetail* intrinsics for comparison samplers * fix dx12 test * fix metallib test * fix merge conflict --------- Co-authored-by: Yong He <[email protected]> * Add exhaustive associativity test for WGSL (#6056) This closes #6005. * Initial implementation of SP#015 `DescriptorHandle<T>`. (#6028) * Initial implementation of `ResourcePtr<T>`. * Update docs * Fix build error. * Add more discussion. * Update documentation. * Update TOC. * Fix. * Fix. * Add test case for custom `getResourceFromBindlessHandle`. * Add namehint to generated descriptor heap param. * Fix. * Fix. * format code * Rename to `DescriptorHandle`, and add `T.Handle` alias. * Fix compiler error. * Fix. * Fix build. * Renames. * Fix documentation. * Documentation fix. --------- Co-authored-by: slangbot <[email protected]> * Fix Metal type layout reflection for nested parameter blocks. (#6042) * Fix potential test failures due to SPIRV validation failure (#6047) There are a few tests that are currently passing but could fail when conditions change little bit. When slang-test runs with `test-server`, the spirv validation fails and the test gets reported as failed even though they are actually passing. To avoid the potential problem, this commit adds an empty entry point. Co-authored-by: Yong He <[email protected]> * WGSL: Convert signed vector shift amounts to unsigned (#6023) * WGSL: Fixes for signed shift amounts - Handle the case of vector shift amounts - Closes #5985 - Move handling of scalar case from emit to legalization - Add tests for bitshifts. * Move the binary operator legalization function to a common place * Metal: Legalize binary operations Closes #6029. * Fix Metal filecheck test The int shift amounts are now converted to unsigned. * format code --------- Co-authored-by: slangbot <[email protected]> Co-authored-by: Yong He <[email protected]> * Add overload for select to handle Optional<T> (#6022) Fixes #6020 Co-authored-by: Yong He <[email protected]> * Fix `markNonContextParamsAsSideEffectFree`. (#6054) * Fix CUDA reflection for acceleration structure handle size. (#6055) * Find OptiX headers (#6071) * add support for finding OptiX headers * add documentation * fix linux path * Don't initialize temp var for out parameters. (#6076) * Fix simplify if-else (#6077) * Fix simplify if-else The if-else optimization observes that at if at least one true/false block is merely an unconditional jump to the after block, that the whole if-else can be replaced with a jump to the after block. But it's important to copy the phi arguments from the aforementioned unconditional jump, rather than what is present in the 'true' block, since the 'true' block might actually just be the after block itself. Below, the ifElse() would be replaced with an unconditional jump to block %39, but with the `phi` arguments copied from the branch to %29, which is an unrelated block. ifElse(%38, %39, %40, %39) block %40: unconditionalBranch(%39) block %39: unconditionalBranch(%29, 0 : Float) block %29( [nameHint("ret")] param %ret : Float): Fixes issue #5972 * format code --------- Co-authored-by: slangbot <[email protected]> Co-authored-by: Yong He <[email protected]> * Fix inaccurate documentation in member function mutability. (#6065) * Fix inaccurate documentation in member function mutability. * Change throw to result in for specificity. --------- Co-authored-by: Yong He <[email protected]> * update slang-rhi + fix nvrtc options (#6080) * update slang-rhi * pass --dopt=on to nvrtc when enabling debug information * fix leaks in slang-rhi * update slang-rhi * only use --dopt when available --------- Co-authored-by: Yong He <[email protected]> * Fix #5354, change diagnostic definition error message and expect output in test (#6067) Co-authored-by: Yong He <[email protected]> * Implement specialization constant support in numthreads / local_size (#5963) * Allow using specialization constants in numthreads attribute * Add support for GLSL local_size_x_id syntax * Fix overeager specialization constant parsing * Add diagnostics for specialization constant numthreads * Remove unused variable * Fix local_size_x_id not finding existing specialization constant * Allow materializeGetWorkGroupSize to reference specialization constants * Use SpvOpExecutionModeId for modes that require it * Cleanup specialization constant numthreads code * Add tests for specialization constant work group sizes * Fix implicit Slang::Int -> int32_t cast * Fix querying thread group size in reflection API --------- Co-authored-by: Yong He <[email protected]> * Fix documentation on DescriptorHandle. (#6062) * Fix documentation on DescriptorHandle. * Fix. * format code --------- Co-authored-by: slangbot <[email protected]> * Fix issue with specialization using arithmetic expressions (#6084) * Fix optix varying legalization. (#6089) * Fix optix varying legalization. * Add test. * Reuse code for Metal and WGSL entry point legalization (#6063) * Refactor to reuse common for metal and wgsl entry point legalization * refactor system val work item * refactor simplify user names * clean up fix semantic field of struct * improve code layout * split wgsl/metal to seperate classes and cleanup * remove extra includes * remove dead code comments * minor cleanup * squash merge from master and resolve conflict * apply metal spec const thread count changes * Revert "apply metal spec const thread count changes" This reverts commit c42d707fd25ee0328598650d3235cd2322810ccc. * Revert "squash merge from master and resolve conflict" This reverts commit 06db88ef7001bdfe93fb23af35af0d026b255dee. * Merge remote-tracking branch 'origin/master' * apply metal spec const thread count changes * Revert "apply metal spec const thread count changes" This reverts commit 3b9e6f53cee2e6076ac2b7a0d015a1ed2cbbd627. * Revert "Merge remote-tracking branch 'origin/master'" This reverts commit 99869d573a46dadeb24445405f5a1e37a8e03d0d. * apply metal spec const thread count changes --------- Co-authored-by: Yong He <[email protected]> * Implement AnyValue marshalling for 8-bit integers (#6059) * Implement anyvalue marshalling for 8-bit integers * Fix missing offset from int8/uint8 case * Disable anyvalue 8-bit test for DXIL Because it doesn't support 8-bit values anyway. --------- Co-authored-by: Yong He <[email protected]> * Emit errors when seeing a matrix with row/col count of 1 (#6044) Such matrices aren't well supported except by D3D targets. Therefore, generate an error rather than outputting invalid code for non-D3D targets. This closes #5987. Co-authored-by: Yong He <[email protected]> * Inline global constants that contains opaque handles for legalization. (#6098) * Inline global constants that contains opaque handles for legalization. * Add diagnostics on opaque type global variables. * Fix. * Fix test. * Fix argument buffer tier2 layout computation. (#6101) * support SV_ViewIndex for Metal (#6103) Co-authored-by: Yong He <[email protected]> * Implement Packed Dot Product intrinsics (#6068) * implement dot acc intrinsics * fix sm version * fix test * improve comment --------- Co-authored-by: Yong He <[email protected]> * C-like emitter: Add parenthesis when combining relational and bitwise… (#6070) * C-like emitter: Add redundant parentheses in several cases This is required since the Dawn WGSL compiler requires parentheses even though precedence rules could resolve order of operations. This closes #6005. * Fix tests/metal/byte-address-buffer The output now includes parentheses around shift expressions appearing as operands in bitwise expressions, so update the test accordingly. * format code --------- Co-authored-by: slangbot <[email protected]> Co-authored-by: Yong He <[email protected]> * Fix cyclic lookups with UnscopedEnums (#6110) * Fix cyclic lookups with UnscopedEnums * Add test with multiple unscoped enums with explicit types --------- Co-authored-by: Yong He <[email protected]> * Fix resource specialization issue where store insts from inlined calls are not considered properly. (#6099) * Fix resource specialization issue where stores from inlined calls are not considered. * Format * Move global variable initialization into entry points for WGSL (#6106) * Add test that reproduces the issue in #5986 * Call moveGlobalVarInitializationToEntryPoints for WGSL as well This closes #5986. --------- Co-authored-by: Yong He <[email protected]> * Fix prebound parameter pack - argument list matching logic. (#6111) * Fix prebound parameter pack - argument list matching logic. * Move tests. * Fix. * Fix `-capability` arg in SPIRV debug command line output. (#6114) * hoist entry point params for wgsl (#6116) Co-authored-by: Yong He <[email protected]> * Fix nullptr in generic specialization (#6066) * Fix nullptr in generic specialization * Fix formatting * Revert "Fix nullptr in generic specialization" and add emitPtrLit instead * Add type parameter to getPtrValue() --------- Co-authored-by: Yong He <[email protected]> * Avoid using the backend validation when using test server (#6094) * Avoid using the backend validation when using test server Currently with a debug build, the backend validation such as Vulkan-Validation-Layer or DXC validation is enabled all the time. It means there is a higher chance that we see warning messages while running slang-test with a debug build. However, those warning messages incorrectly treated as the testing result when using test-server. This is mainly because of the fact that the Slang implemention for the RPC commucation expects only one time output result. As soon as any warning is printed, the testing process is incorrectly considered as completed even though it might be still in the middle of initializing the device. This commit disables the backend validation when using the test-server. * format code (#31) Co-authored-by: slangbot <[email protected]> --------- Co-authored-by: slangbot <[email protected]> Co-authored-by: slangbot <[email protected]> Co-authored-by: Yong He <[email protected]> * Fix interface requirement lowering for generic accessors (#6123) * Refactor _Texture to constrain on texel types. (#6115) * Refactor _Texture to constrain on texel types. * Fix tests. * Fix. * Disable glsl texture test because rhi can't run it correctly. * Allow __subscript<T> syntax. (#6124) * Allow __subscript<T> syntax. * Fix. * Add groupshared atomic array test. (#6107) * Add groupshared atomic array test. * Fix test. * Add diagnostic for function body followed by a `;`;. (#6122) * Fix circularity issue when checking multiple generic interface constraints. (#6121) * Fix circularity issue with checking multiple generic interface constraints * Create multi-generic-interface-constraint.slang * Update multi-generic-interface-constraint.slang * Update slang-check-inheritance.cpp --------- Co-authored-by: Yong He <[email protected]> * Create CNAME * Delete CNAME * test-server should use d3d12core.dll from bin directory (#6095) * Implement Quad Control intrinsics (#5981) * Make -depfile work for binary modules output too (#6126) * Fix upper 32 bits of 64-bit AnyValue packing (#6127) * Fix def-use issue from multi-level break elimination (#6134) * Generate IDs for every witness table (#6129) Co-authored-by: Yong He <[email protected]> * Fix gcc downstream compiler optimization level corresponding to OptimizationLevel::Maximal (#6137) * Fix bug: IgnoreInheritance in lookup (#6146) * Fix bug: IgnoreInheritance in lookup When specifying IgnoreInheritance in lookup, it will ignore all members in the self extension for generic, the reason is that it doesn't specialize the target type of the extension decl when comparing with self type, so it will result that every type is unequal to the target type. * Catch all exceptions from loadModule* and link API calls. (#6143) This closes #5950. * Bump spirv-tools to 9295a8b94ed0751565fa9cda6d949f5e388b32d9 (#6145) Pick up fix to https://github.com/shader-slang/slang/issues/5859 * Remove unnecessary parameters from Metal entry point signature (#6131) * fix metal entry point global params * address review comments, cleanup and test * remove dead code * undo accidental change * address review comments and cleanup * minor fix and cleanup --------- Co-authored-by: Yong He <[email protected]> * Use SPIRV integer vector dot product instructions (#6141) * Use SPIRV integer vector dot product instructions * fix test --------- Co-authored-by: Yong He <[email protected]> * Add validation for destination of atomic operations (#6093) * Reimplement the GLSL atomic* functions in terms of __intrinsic_op Many of these functions map directly to atomic IR instructions. The functions taking atomic_uint are left as they are. This helps to address #5989, since the destination pointer type validation can then be written only for the atomic IR instructions. * Add validation for atomic operations Diagnose an error if the destination of the atomic operation is not appropriate, where appropriate means it's either: - 'groupshared' - from a device buffer This closes #5989. * Add tests for GLSL atomics destination validation Attempting to use the GLSL atomic functions on destinations that are neither groupshared nor from a device buffer should fail with the following error: error 41403: cannot perform atomic operation because destination is neither groupshared nor from a device buffer. * Validate atomic operations after address space specialization Address space specialization for SPIR-V is not done as part of `linkAndOptimizeIR`, as it is for e.g. Metal, so opt out and add a separate call for SPIR-V. * Allow unchecked in/inout parameters for non-SPIRV targets * Clean up callees left without uses during address space specialziation * format code --------- Co-authored-by: slangbot <[email protected]> Co-authored-by: Yong He <[email protected]> * Cache and reuse glsl module. (#6152) * Cache and reuse glsl module. * Fix. * Implement record/replay for the new api. * Fix record replay. * Fix test. * Fix incorrect resolve of specialization instance (#6162) * Fix incorrect resolve of specialization instance While checking the uninitialized variables, we were not resolving the specialized instance correctly. This commit repeats the resolve while the result is a specialization instance. A new test is added for this: tests/diagnostics/uninitialized-generic.slang After the problem is fixed, it revealed another problem in existing tests: tests/compute/nested-generics2.slang tests/diagnostics/uninitialized-local-variables.slang When a struct has a member variable whose type is a generic type, we cannot iterate over its member variables yet, because the type is unknown until the generic function/struct is specialized. We will have to give up checking for these cases. * Fix static build and install (#6158) * Add SLANG_ENABLE_RELEASE_LTO cmake option * Fix cmake static build * Disable install SlangTargets to avoid static build failing * improve error message on generic value decls (#6169) Co-authored-by: Yong He <[email protected]> * Add bgra8 format (#6163) * add brga8 format * add tests * minor fixes * cleanup * maybe fix broken quad control test * add missing xslang flag on test --------- Co-authored-by: Yong He <[email protected]> * Add intptr_t abs/min/max operations for CPU & CUDA targets (#6160) * Add intptr_t abs/min/max operations for CPU & CUDA targets * Define intptr_t and uintptr_t with CUDACC_RTC --------- Co-authored-by: Yong He <[email protected]> * Some usability improvements to formatting script (#6153) * Sharpen the requirements for formatting * Add option to only format files changed since a given revision * Avoid divison-by-zero when total is zero * format code --------- Co-authored-by: slangbot <[email protected]> * Fix depth texture sampling on Metal. (#6168) * DNI: try using sparse checkout for MDL-SDK (#6190) * Fix an incorrect iteration with a workList (#6177) * Fix an incorrect iteration with a workList We cannot modify workList while iterating it, because its type `List` is actually an array container. * Change based on the feedback * Use `Index` instead of `int` for for-loop index --------- Co-authored-by: Yong He <[email protected]> --------- Co-authored-by: Ellie Hermaszewska <[email protected]> Co-authored-by: Anders Leino <[email protected]> Co-authored-by: slangbot <[email protected]> Co-authored-by: Theresa Foley <[email protected]> Co-authored-by: Yong He <[email protected]> Co-authored-by: kaizhangNV <[email protected]> Co-authored-by: Nate Morrical <[email protected]> Co-authored-by: Darren <[email protected]> Co-authored-by: Stan <[email protected]> Co-authored-by: arya <[email protected]> Co-authored-by: AdamYuan <[email protected]> Co-authored-by: Julius Ikkala <[email protected]> Co-authored-by: Yuki Nishidate <[email protected]> Co-authored-by: Pétur Darri Pétursson <[email protected]> Co-authored-by: bspeice <[email protected]> Co-authored-by: Jay Kwak <[email protected]> Co-authored-by: zhangkai <[email protected]> Co-authored-by: Simon Kallweit <[email protected]> Co-authored-by: Sai Praveen Bangaru <[email protected]> Co-authored-by: mTvare <[email protected]> Co-authored-by: Entropy Lost <[email protected]> Co-authored-by: wij <[email protected]> Co-authored-by: slangbot <[email protected]> Co-authored-by: Khronos Group Web Services <[email protected]> Co-authored-by: spking11 <[email protected]> Co-authored-by: Dario Mylonopoulos <[email protected]>
v2025.3.2
=== Breaking changes ===
None
=== All changes for this release ===
da3dc98 Fix an incorrect iteration with a workList (#6177)
1f1892d DNI: try using sparse checkout for MDL-SDK (#6190)
3ecbeac Fix depth texture sampling on Metal. (#6168) (#6166:client support)
a7958af Some usability improvements to formatting script (#6153)
1abba25 Add intptr_t abs/min/max operations for CPU & CUDA targets (#6160)
0dd9076 Add bgra8 format (#6163) (#5469:client support)
92c9fff improve error message on generic value decls (#6169) (#6139:quality & productivity)
ac174d2 Fix static build and install (#6158) (#5821:client support)
a9ce752 Fix incorrect resolve of specialization instance (#6162)
v2025.3.1
Slang v2025.3.1 Changes: 8000e0ede Cache and reuse glsl module. (#6152) 04353fb76 Add validation for destination of atomic operations (#6093) 18f12ad9c Use SPIRV integer vector dot product instructions (#6141) 14211ec3c Remove unnecessary parameters from Metal entry point signature (#6131) ea98e24d3 Bump spirv-tools to 9295a8b94ed0751565fa9cda6d949f5e388b32d9 (#6145) a4d67a0b0 Catch all exceptions from loadModule* and link API calls. (#6143)
v2025.3
Slang v2025.3 Breaking Change: fc77070fd Refactor _Texture to constrain on texel types. (#6115) This change adds generic constraint to what is allowed in a texture type, and can potentially break existing generic code that specializes a `Texture2D<T>` etc. with a generic `T` that isn't constraint by `ITexelElement`. All Changes: 151bdb837 Fix bug: IgnoreInheritance in lookup (#6146) 4c2c0856c Fix gcc downstream compiler optimization level corresponding to OptimizationLevel::Maximal (#6137) 681224561 Generate IDs for every witness table (#6129) b11c25749 Fix def-use issue from multi-level break elimination (#6134) f3d7aa6ce Fix upper 32 bits of 64-bit AnyValue packing (#6127) d09b6bccd Make -depfile work for binary modules output too (#6126) a85c350df Implement Quad Control intrinsics (#5981) 87a081602 test-server should use d3d12core.dll from bin directory (#6095) 955c10bb9 Delete CNAME be78f2714 Create CNAME 9d9997670 Fix circularity issue when checking multiple generic interface constraints. (#6121) d046082c5 Add diagnostic for function body followed by a `;`;. (#6122) dc69d85f8 Add groupshared atomic array test. (#6107) d1a13a730 Allow __subscript<T> syntax. (#6124) fc77070fd Refactor _Texture to constrain on texel types. (#6115) 3ff257816 Fix interface requirement lowering for generic accessors (#6123) f68d493d5 Avoid using the backend validation when using test server (#6094) ddc4a1799 Fix nullptr in generic specialization (#6066) 91430870a hoist entry point params for wgsl (#6116) e743c17f7 Fix `-capability` arg in SPIRV debug command line output. (#6114) 3666c66e2 Fix prebound parameter pack - argument list matching logic. (#6111) dfb369e87 Move global variable initialization into entry points for WGSL (#6106)
v2025.2.2
What's Changed
- Fix optix varying legalization. by @csyonghe in #6089
- Reuse code for Metal and WGSL entry point legalization by @fairywreath in #6063
- Implement AnyValue marshalling for 8-bit integers by @juliusikkala in #6059
- Emit errors when seeing a matrix with row/col count of 1 by @aleino-nv in #6044
- Inline global constants that contains opaque handles for legalization. by @csyonghe in #6098
- Fix argument buffer tier2 layout computation. by @csyonghe in #6101
- support SV_ViewIndex for Metal by @fairywreath in #6103
- Implement Packed Dot Product intrinsics by @fairywreath in #6068
- C-like emitter: Add parenthesis when combining relational and bitwise… by @aleino-nv in #6070
- Fix cyclic lookups with UnscopedEnums by @juliusikkala in #6110
- Fix resource specialization issue where store insts from inlined calls are not considered properly. by @saipraveenb25 in #6099
Full Changelog: v2025.2.1...v2025.2.2
v2025.2.1
What's Changed
- Find OptiX headers by @skallweitNV in #6071
- Don't initialize temp var for out parameters when generating the backward diff function by @saipraveenb25 in #6076
- Fix simplify if-else by @cheneym2 in #6077
- Fix inaccurate documentation in member function mutability. by @entropylost in #6065
- update slang-rhi + fix nvrtc options by @skallweitNV in #6080
- Fix #5354, change diagnostic definition error message and expect output in test by @wijiler in #6067
- Implement specialization constant support in numthreads / local_size by @juliusikkala in #5963
- Fix formatting and documentation on DescriptorHandle. by @csyonghe in #6062
- Fix issue with specialization using arithmetic expressions by @saipraveenb25 in #6084
New Contributors
- @entropylost made their first contribution in #6065
- @wijiler made their first contribution in #6067
Full Changelog: v2025.2...v2025.2.1
v2025.2
Slang v2025.2 Changes: a985e240a Fix CUDA reflection for acceleration structure handle size. (#6055) 4104aa7f9 Fix `markNonContextParamsAsSideEffectFree`. (#6054) f199640bb Add overload for select to handle Optional<T> (#6022) 803e0c9f9 WGSL: Convert signed vector shift amounts to unsigned (#6023) 6437f2d37 Fix potential test failures due to SPIRV validation failure (#6047) 548453338 Fix Metal type layout reflection for nested parameter blocks. (#6042) 5290c5806 Initial implementation of SP#015 `DescriptorHandle<T>`. (#6028) 4cfae806a Add exhaustive associativity test for WGSL (#6056) 2b76466c4 Add CalculateLevelOfDetail* overloads for comparison samplers (#6018) 55ff4686e Support a storage class, NodePayloadAMDX, for SPIRV work-graphs (#6052) fce63c2c5 `[[shader_record]] / [[push_constant]]` Param Annotations Proposal (#6053) e8217c700 Fix implicit string conversion breaking NativeStrings (#6035) b72e62f5c Upgrade actions/upload-artifact from v3 to v4 (#6051) 87f00a36a [Auto-diff] Overhaul auto-diff type tracking + Overhaul dynamic dispatch for differentiable functions (#5866) 6706c1a77 update slang-rhi (#6045) 46149eeb2 Pass compiler specific args to GCC and Visual Studio too (#6019) dab6cec1e Add parentheses to make precedence explicit (#6030) 2249d6ffb Add SampleCmpLevel intrinsics (#6004) 63b8d9e1d slang-test: Ensure runtime is consistent (#6021)