summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-07-02add task shader alias (#7372)Sirox
* alias amplification shader as task shader and add mesh shader profile * add task shader stage alias to capabilities * regenerate command line reference --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2025-07-02Fix spurious vk::binding warnings when attribute is present (#7581)Copilot
* Initial plan * Fix spurious vk::binding warnings when attribute is present - Modified _maybeDiagnoseMissingVulkanLayoutModifier to check for GLSLBindingAttribute before warning - Changed function to return bool indicating if warning was actually issued - Updated call sites to properly track warning state to reduce duplicates - Tested fix resolves the issue while preserving correct warnings when needed Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Add test case for vk::binding spurious warning fix Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Update test to use filecheck format as requested Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Remove full file path from CHECK directives as requested Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Fix code formatting with clang-format Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Fix behavioral regression in vk-bindings test caused by warning flag logic Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
2025-07-02Don't run full gpu tests on merge queue. (#7587)Yong He
* Don't run full gpu tests on merge queue. * Fix yml. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2025-07-02Fix diagnostics not appearing when semantic tokens are disabled (#7477) (#7532)Harsh Aggarwal (NVIDIA)
* Fix diagnostics not appearing when semantic tokens are disabled (#7477) Previously, the language server only triggered module loading and compilation through semantic token requests. When semantic tokens were disabled, didOpenTextDocument and didChangeTextDocument would only update the workspace without compiling modules, meaning no diagnostics were generated. This change: - Adds module loading to didOpenTextDocument for .slang/.hlsl files - Adds module loading to didChangeTextDocument for .slang/.hlsl files - Triggers diagnostic updates via resetDiagnosticUpdateTime for Slang files - Ensures diagnostics appear immediately when opening/editing files - Maintains backward compatibility with existing LSP features Additionally fixes JSON serialization to properly handle NullResponse types by serializing them as JSON null instead of empty objects, improving LSP protocol compliance. Now diagnostics work correctly regardless of semantic token settings. * Revert: Remove unrelated change - will pick up in seprate PR * Fix module state corruption when checkAllTranslationUnits throws Add try/catch in Linkage::loadParsedModule to properly clean up module maps when checkAllTranslationUnits() fails with an exception. This prevents incorrect state in WorkspaceVersion::getOrLoadModule where failed modules remained in the loaded modules map, causing subsequent calls to return stale/invalid module references. * Update to address review comments * update: remove explicit checking for .slang and .hlsl
2025-07-02Fix for emitting ArrayStride decoration for arrays of opaque types (#7568)Jerran Schmidt
* WIP opaque type decoration fix * Clearer intent * Formatting * Added test for fix
2025-07-02Add copilot environment configuration. (#7586)Yong He
* Add copilot environment configuration. * Add instructions. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2025-07-02Defer immutable buffer loads when emitting spirv. (#7579)Yong He
* Defer immutable buffer loads when emitting spirv. * Fix. * Fix. * Fix. * Fix tests. * Fix test.
2025-07-02Comment SLANG_OVERRIDE options (#7584)Ellie Hermaszewska
Closes https://github.com/shader-slang/slang/issues/7309
2025-07-01Misc language server improvements. (#7569)Yong He
* Misc language server improvements. * Fix. * Fix decl path printing for existential lookup. * More existential decl path fix. * Polish. * Fix test.
2025-07-01extend fiddle to allow custom lua splices in more places (#7559)Ellie Hermaszewska
* Add fkYAML submodule * Generate slang-ir-inst-defs.h from slang-ir-inst-defs.yaml * generate ir-inst-defs.h * neaten things * neaten inst def parser * add rapidyaml submodule * remove fkyaml * remove fkyaml submodule * remove use of ir-inst-defs.h * format and warnings * fix wasm build * tidy * remove rapidyaml * Extend fiddle to allow custom splices in more places * Use lua to describe ir insts * fix * neaten * neaten * neaten * spelling * neaten * comment comment out assert * merge
2025-07-01update slang-rhi (#7494)Simon Kallweit
2025-07-01Allow Link time constant array length sizing, warn on unsupported ↵Ellie Hermaszewska
functionality (#7067) * Add link time array layout test * Add link time constant array size compilation test * Link time constant array size test * Allow getting link time array size Closes https://github.com/shader-slang/slang/issues/6753 * format * Switch to SIMPLE test and check output * Implement without binary api changes * diagnose on link time constant sized array * fix test --------- Co-authored-by: Yong He <yonghe@outlook.com>
2025-07-01Add arguments for controlling floating point denormal mode (#7461)aidanfnv
* Implement -fp-denorm-mode slangc arg * Split fp-denorm-mode into 3 args for fp16/32/64 * Remove redundant option categories * Use emitInst for multiple of the same OpExecutionMode * Fix formatting * Remove -denorm any * Re-add option categories * emitinst for ftz * Use enums for type text * Remove extra categories again * Add tests for denorm mode * Move denorm mode to post linking * format code (#8) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> * regenerate command line reference (#9) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> * Clean up tests * Fix option text * format code (#10) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> * Add tests for "any" mode * Return "any" enum if option not set * Simplify emission logic * Add support for generic entrypoints * Move denorm modes to end of CompilerOptionName enum * format code (#11) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> * Move new enum members to before CountOf * Add not checks to tests, fix generic test, add functionality tests * Rename denorm to fpDenormal * Clean up functional test * Rename denorm test dir * Fix formatting, regenerate cmdline ref * Fold simple tests into functional tests, add more dxil checks * Remove no-op DX tests, make tests more consistent * Disable VK functionality tests that will fail on the CI configs * Fix formatting * Add comments to disabled tests explaining why --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2025-07-01Remove some cruft/complexity from IR serialization (#7483)Theresa Foley
* Remove some cruft/complexity from IR serialization This is a very simple cleanup to unnecessary code paths and remove some flexibility that isn't actually needed, to hopefully simplify the task of more completely overhauling the approach to IR serialization in a later change. The concrete feature that gets removed here is a debug-only feature (which thus shouldn't be affecting any users of Slang) that was added long ago in the life of the compiler as we were working to truly separate the front- and back-ends. At the time there was a lot of code in the compiler back-end that still made use of AST-level data structures, and thus got in the way of our goal to support separate compilation and linking (such that final code generation can only depend on the IR, and not the AST). The option was used to cause the Slang IR to be serialized out and then read back in as part of compilation, to try and enforce that only the wanted constructs could pass through that bottleneck. The idea was only ever half implemented, however, because it made use of a secondary implementation path in IR serialization that supported serializing the "raw" source locations (which are heavily dependent on AST-level information, even down to the number of bytes in source files). This change removes the feature entirely, since it is no longer useful for its intended purpose, and its presence causes there to be entire second code path for source locations in IR serialization that would need to have test coverage if we wanted to be sure it kept working. In addition, our pre-existing infrastructure for module serialization had various options that have either stopped being useful, or were not really useful at the time they were introduced. For example: there are no places in the code today where we attempt to serialize out a module without including both the serialized AST and IR. If that was a feature that we ever supported, the relevant code got removed at some preceding point without breaking any of our tests or (seemingly) upsetting users. Similarly, the options being passed into writing of a serialized module included both a flag to control whether source locations should be serialized *and* a pointer to the `SourceManager` to use in that case... but it was only ever meaningful to set both, or neither. The option has been changed to just be the `SourceManager` pointer, and the name has been updated to reflect its very narrow intended use case. * format code * fixup * regenerate command line reference --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
2025-06-30fix spirv-opt bug (#7565)kaizhangNV
Close #7491. As the PR KhronosGroup/SPIRV-Tools#6198 is already merged, we can switch spirv-tools repo to upstream repo now.
2025-06-30Allow a compiler warning on MacOS (#7561)Jay Kwak
This PR is to allow a compiler warning even when all warnings are requested to be treated as errors. The following pattern is very common in Slang code base: if (auto var = as<...>(...)) And when `var` is not used, the compiler prints a warning. Alternatively we can remove `auto var =` part but there are too many. Co-authored-by: Jay Kwak <jkwak@jkwak-mlt.client.nvidia.com>
2025-06-30Remove redundant [payload] attribute (Fix #7528) (#7555)Harsh Aggarwal (NVIDIA)
Removes the PayloadAttribute class and related infrastructure that was made redundant by PR #6595, which added ray payload access qualifiers (PAQs) per the DXR spec. The new [raypayload] attribute with access qualifiers provides the same functionality. Changes: - Remove PayloadAttribute class from slang-ast-modifier.h - Remove [payload] attribute syntax from core.meta.slang - Remove PayloadDecoration IR instruction and related processing - Remove HLSL emission of [payload] attribute - Remove IR lowering support for old PayloadAttribute The new [raypayload] attribute with PAQ support remains unchanged.
2025-06-30Emit sample index when constructing a `OpImageTexelPointer` (#7563)ArielG-NV
* fix #7554 * format code * test ms and non ms texture --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2025-06-30Add MLP training examples. (#7550)Yong He
* Add MLP training examples. * Formatting fix. * Fix. * Improve documentation on coopvector. * Improve doc. * Update doc. * Fix typo. * Cleanup shader. * Cleanup. * Fix test. * Fix type check recursion. * Fix. * Fix. * Fix override check.
2025-06-30Reset minimum cmake version to 3.22 (#7548)Gangzheng Tong
* Reset minimum cmake version to 3.22 * update slang-rhi
2025-06-30Implement IFloat.scale for vectors, matrices (#7545)James Helferty (NVIDIA)
* Test for IFloat.scale usage Test that using IFloat.scale doesn't cause an internal compiler error. * Generic implementation of IFloat.scale() Fixes #7156 * Implement IFloat.scale for matrix Adds matrix implementation and test coverage. * Avoid explicitly constructing a matrix * Remove intrinsicOp from IFloat.scale impls Updates IFloat.scale implementations: - Remove __intrinsic_op($(kIROp_Mul)) since we're providing an implementation - Add [__unsafeForceInlineEarly] where missing
2025-06-29Support the GLSL/SPIR-V Built-in variable `DeviceIndex` (#7552)ArielG-NV
* Support DeviceIndex * format code * regenerate command line reference --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2025-06-28Minimal optional constraints (#7422)Julius Ikkala
* Parse optional witness syntax * Allow failing optional constraint * Make `is` work with optional constraint * Allow using optional constraint in checked if statements * Fix tests * Make it work with structs * Fix MSVC build error * Disallow using `as` with optional constraints * Update test to match split is/as errors * Add tests * Fix uninitialized variables in tests * Add tests of incorrect uses & fix related bugs * Mention optional constraints in docs * format code * Fix type unification with NoneWitness * Fix formatting --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Nathan V. Morrical <natemorrical@gmail.com>
2025-06-27Enable Vulkan Validation Layer in CI (#7543)Gangzheng Tong
* Disable spirv-opt for the tests with debugfunction VVL errors * Enable VVL in CI * Add 2 expected failure tests until we update VVL to 1.4.319 which contains the fix * update slang-rhi * Revert "Disable spirv-opt for the tests with debugfunction VVL errors" This reverts commit 5327460057f533af81ea60a556e43abe805d5816.
2025-06-27Don't call destructor, it causes UB when reading inst afterwards (#7544)Julius Ikkala
2025-06-27Move separate-debug-info arg to target options (#7540)jarcherNV
* Move separate-debug-info arg to target options The separate-debug-info command line option is listed under debugging options, move this to the target options section which includes other similar flags like -g and -emit-spirv-directly. * regenerate command line reference --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2025-06-26Update spirv-tool submodule to include the debug instruct fix (#7541)kaizhangNV
* Update spirv-tool submodule to include the debug instruct fix Update spirv-tool to our forked repo that include the fix of spirv-val bug. It mistakenly relocates the `DebugFunctionDefinition`. The upstream PR is: https://github.com/KhronosGroup/SPIRV-Tools/pull/6198 But it's still pending on review. Issue #7491 will keep track the process, when the upstream PR is merged, we need to restore the repo back to upstream repo.
2025-06-26Hide atomics struct from reflection api (#7520)James Helferty (NVIDIA)
* Atomic reflection unit test Test that Atomic<int> is reflected as a scalar/int instead of a struct named Atomic. * Hide AtomicType from reflection Leverage the fact that returned variables go through convert() to centralize the unwrapping of the AtomicType struct. Fixes #6257 * Clean up unit test a bit - rename bar to buf (since one of them is not Atomic and thus not a barrier) - validate deeper into the fields of bufC - remove debug code
2025-06-26Support `mad` in WGSL (#7538)Mehmet Oguz Derin
2025-06-26Fix tuple AST & IR layout size queries (#7502)Julius Ikkala
* Fix tuple AST & IR layout size queries * Don't peephole sizeof if size is still indeterminate
2025-06-26Fix for OpUConvert producing invalid opcode when to/from signs differ (#7398)Jerran Schmidt
* Fix for OpUConvert outputting scalar type for mixed sign vector type conversions * Fix compiler warning * Added regression test for UConvert vector fix * Formatting * getUnsignedType helper * Formatting * Fix for addtional int types * Helper function to convert signed type to unsigned type
2025-06-26Fix the invalid SPIRV decoration issue (#7527)kaizhangNV
* Fix the invalid SPIRV decoration issue Close #7508. SPIRV doesn't allow decoration on type with Private or Function storage class. In our lowering logic, if the array type is used by buffer type it will always have stride operand after lowering, so if the array is not used by buffer type, it must be used only by thread_local or group_shared variable, and it will not have stride operand. For this case, we don't need to emit stride decoration for SPIRV.
2025-06-26Correct the scope for DebugLocalVariable (#7516)Lujin Wang
* Correct the scope for DebugLocalVariable All of the DebugLocalVariable instructions have their scope set to DebugCompilationUnit. The scope should instead be set to a DebugFunction, or a DebugLexicalBlock which is recursively inside a DebugFunction. Register the debug info for the function instructions, which helps findDebugScope() to find the right DebugFunction scope for DebugLocalVariable. * Add a test for DebugLocalVariable To check the scope, which should be a DebugFunction.
2025-06-26Use LoadLibraryExA instead of LoadLibraryA (#7535)jarcherNV
Slangpy uses AddDllDirectory to specify locations of Slang DLL files. LoadLibraryA ignores this so instead use LoadLibraryExA.
2025-06-26Update spirv-tools to for SDK v2025.3 (#7519)Gangzheng Tong
2025-06-26Set current astbuilder for reflection API (#7488)Mukund Keshava
With the test code in the issue, a crash was observed inside Slang::DeclRefBase::getParent() while accessing the astbuilder which was nullptr. This PR adds a fix for that. For the test code in the issue, we now get: ================================================ found Outer<float>::Inner: true found foo function: true function name: "foo" parameter count: 1 attempting getParameterByIndex(0): true getParameterByIndex(0) succeeded: true parameter name: "param" parameter type: "float" ================================================ Fixes #6546
2025-06-26Add matrix operand for OpCooperativeVectorMatrixMulAddNV (#7524)Gangzheng Tong
* Add matrix operand for OpCooperativeVectorMatrixMulAddNV * update tests to use the supported UINT32 input component type * Add MatrixCSignedComponentsKHR for coopVecMatMulAddPacked --------- Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
2025-06-25Fix Phi elimination pass sometimes leaving broken insts in release builds ↵Julius Ikkala
(#7499) * Make phi elimination pass modify branches in-place * Add test and fix formatting * Avoid double removal of param insts
2025-06-25Fix ambiguous reference for 'extern' and 'export' (#7515)kaizhangNV
Close #7509. When there are both `export` and `extern` decls in lookup result, we should remove all `extern` decls.
2025-06-25Fix generation of wgsl case arms (#7374)Swoorup Joshi
* Fix generation of wgsl case arms * Added test case to test generation of switch case --------- Co-authored-by: Harsh Aggarwal (NVIDIA) <haaggarwal@nvidia.com>
2025-06-24Document supported compiler versions in building.md (#7512)Ellie Hermaszewska
* Document supported compiler versions in building.md Closes https://github.com/shader-slang/slang/issues/7376 * multiple checked versions
2025-06-22Add default implementation for determinant (#7505)Julius Ikkala
Co-authored-by: Nathan V. Morrical <natemorrical@gmail.com>
2025-06-22Fix a small typo in CPU target docs (#7507)Mehmet Oguz Derin
Compiler word was missing after C/C++ in CPU target documentation. Thank you in advance!
2025-06-21Update spirv-tools and spirv-headers (#7500)jarcherNV
Update spirv-tools to commit: 108b19e5c6979f496deffad4acbe354237afa7d3 Update spirv-headers to commit: 2a611a970fdbc41ac2e3e328802aed9985352dca Update spirv-tools-generated from the spirv-tools build.
2025-06-19Enabling optix ci pipeline (#7311)Harsh Aggarwal (NVIDIA)
* Revert "Disable OptiX tests by default. (#1331)" This reverts commit e45f8c1f49855cebe90b6722324ec24146ff5a3d. * Enable optix submodule to build Add support for default entry points in compilation Implemented logic to check for defined entry points in the module when no explicit entry points are provided. If found, these entry points are added to the `specializedEntryPoints` list, with the assumption that no specialization is needed for them at this time. * Disable optix if cuda is not enabled * Add submodule OptixSDK path in search * Distinguish user-explicit vs auto-detected SLANG_ENABLE_OPTIX When SLANG_ENABLE_OPTIX is explicitly set by user and CUDA is not available, show SEND_ERROR to maintain strict validation. When OptiX is auto-detected (e.g., local submodule present) but CUDA unavailable, gracefully disable with STATUS message to allow builds to continue. This addresses review feedback to keep error for explicit requests while handling auto-detection gracefully. * Apply CMake formatting to SLANG_ENABLE_OPTIX validation logic * revert: slang-rhi changes as those are merged independently as in PR # slang-rhi#400
2025-06-19remove sccache due to the instability (#7484)Gangzheng Tong
2025-06-19Fix wasm releases (#7313)Elie Michel
* Update ci.yml * Update ci.yml --------- Co-authored-by: Harsh Aggarwal (NVIDIA) <haaggarwal@nvidia.com> Co-authored-by: Yong He <yonghe@outlook.com>
2025-06-19Fix cuda_fp16 header issue (#7476)Mukund Keshava
* Fix cuda_fp16 header issue This fixes the header include issue. However, it does not add a diagnostic. That will be added in a separate PR. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2025-06-19Always emit DepthReplacing execution mode when writing to FragDepth (#7450)dubiousconst282
2025-06-19Update slang-rhi (#7457)Simon Kallweit
* update slang-rhi * enable all slang-rhi tests