summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
...
* Language Server Enhancements (#7604)Yong He2025-07-03
| | | | | | | | | | | | | | | | | | | | | | | * Language Server: auto-select the best candidate in signature help. * Fix constructor call highlighting + goto definition. * Add test. * format code * Improve ctor signature help. * Add tests. * Fix decl path printing for extension children. * Allow goto definition to show core module source. * c++ compile fix. --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Replace SLANG_ALIGN_OF with C++11 alignof (#7523)Julius Ikkala2025-07-03
| | | | | * Replace SLANG_ALIGN_OF with C++11 alignof * Fix formatting (again)
* Fix for mixed block/embedded usage of structs in SPIRV (#7608)James Helferty (NVIDIA)2025-07-03
| | | | | | | | | | | | | | | | | | | | | | * Add test for mixed use of uniform/ParameterBlock Adds a test that uses the same struct as a parameter and as a ParameterBlock. * Fix for SPIRV block declaration issue Fixes #7431 * Fix formatting * Collect struct param usage in first pass Reduces number of iterations over the entire program. * more formatting fixes * formatting * Remove unused variable
* Remove a test from expected-failure-github for MacOS (#7526)Jay Kwak2025-07-03
| | | | | This commit removes the following test from expected-failure-github.txt because the issue is addressed on slang-rhi side. tests/compute/cbuffer-legalize.slang.2 syn (mtl)
* Don't use access::sample for multisample texture in metal (#7601)Gangzheng Tong2025-07-03
| | | | | | | | | | | | | | * don't use access::sample for multisample texture * Add test case * format code (#7603) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Enable tests for CUDA (#7593)Mukund Keshava2025-07-03
| | | | | | | | Enable intrinsic tests for cuda. Most of these tests were either disabled or just not enabled for cuda. Fixes #7592 Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
* Remove swiftshader (#7600)Gangzheng Tong2025-07-02
|
* Fix crash when using wrong type for inout parameter with WGSL target (#7588)Copilot2025-07-02
| | | | | | | | | | | | | | | | | | | | | * Initial plan * Fix crash in WGSL L-value cast lowering with type mismatches Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Apply formatting to fix Co-authored-by: csyonghe <2652293+csyonghe@users.noreply.github.com> * Update test to verify successful compilation instead of error checking 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>
* [HLSL, SPIRV_1_3] Hoist OpSelect returning a composite into `if`/`else` (#7594)ArielG-NV2025-07-02
| | | | | | | | | | | | | | | | | | | * emit var and hoist out OpSelect if Composite * cleanup comment * address review check for version in spv context use phi node instead of using var move inst's using a list (not in-place modification) * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Run full check on merge_queue, but not on push. (#7596)Yong He2025-07-02
| | | | | | | * Run full check on merge_queue, but not on push. * Fix. * Update copilot instructions.
* add task shader alias (#7372)Sirox2025-07-02
| | | | | | | | | | | * 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>
* Fix spurious vk::binding warnings when attribute is present (#7581)Copilot2025-07-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Don't run full gpu tests on merge queue. (#7587)Yong He2025-07-02
| | | | | | | | | | | * Don't run full gpu tests on merge queue. * Fix yml. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Fix diagnostics not appearing when semantic tokens are disabled (#7477) (#7532)Harsh Aggarwal (NVIDIA)2025-07-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Fix for emitting ArrayStride decoration for arrays of opaque types (#7568)Jerran Schmidt2025-07-02
| | | | | | | | | * WIP opaque type decoration fix * Clearer intent * Formatting * Added test for fix
* Add copilot environment configuration. (#7586)Yong He2025-07-02
| | | | | | | | | | | * Add copilot environment configuration. * Add instructions. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Defer immutable buffer loads when emitting spirv. (#7579)Yong He2025-07-02
| | | | | | | | | | | | | * Defer immutable buffer loads when emitting spirv. * Fix. * Fix. * Fix. * Fix tests. * Fix test.
* Comment SLANG_OVERRIDE options (#7584)Ellie Hermaszewska2025-07-02
| | | Closes https://github.com/shader-slang/slang/issues/7309
* Misc language server improvements. (#7569)Yong He2025-07-01
| | | | | | | | | | | | | * Misc language server improvements. * Fix. * Fix decl path printing for existential lookup. * More existential decl path fix. * Polish. * Fix test.
* extend fiddle to allow custom lua splices in more places (#7559)Ellie Hermaszewska2025-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* update slang-rhi (#7494)Simon Kallweit2025-07-01
|
* Allow Link time constant array length sizing, warn on unsupported ↵Ellie Hermaszewska2025-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add arguments for controlling floating point denormal mode (#7461)aidanfnv2025-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Remove some cruft/complexity from IR serialization (#7483)Theresa Foley2025-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* fix spirv-opt bug (#7565)kaizhangNV2025-06-30
| | | | | | Close #7491. As the PR KhronosGroup/SPIRV-Tools#6198 is already merged, we can switch spirv-tools repo to upstream repo now.
* Allow a compiler warning on MacOS (#7561)Jay Kwak2025-06-30
| | | | | | | | | | | | 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>
* Remove redundant [payload] attribute (Fix #7528) (#7555)Harsh Aggarwal (NVIDIA)2025-06-30
| | | | | | | | | | | | 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.
* Emit sample index when constructing a `OpImageTexelPointer` (#7563)ArielG-NV2025-06-30
| | | | | | | | | | | * fix #7554 * format code * test ms and non ms texture --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Add MLP training examples. (#7550)Yong He2025-06-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Reset minimum cmake version to 3.22 (#7548)Gangzheng Tong2025-06-30
| | | | | * Reset minimum cmake version to 3.22 * update slang-rhi
* Implement IFloat.scale for vectors, matrices (#7545)James Helferty (NVIDIA)2025-06-30
| | | | | | | | | | | | | | | | | | | | | | | * 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
* Support the GLSL/SPIR-V Built-in variable `DeviceIndex` (#7552)ArielG-NV2025-06-29
| | | | | | | | | | | * Support DeviceIndex * format code * regenerate command line reference --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Minimal optional constraints (#7422)Julius Ikkala2025-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Enable Vulkan Validation Layer in CI (#7543)Gangzheng Tong2025-06-27
| | | | | | | | | | | | | * 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.
* Don't call destructor, it causes UB when reading inst afterwards (#7544)Julius Ikkala2025-06-27
|
* Move separate-debug-info arg to target options (#7540)jarcherNV2025-06-27
| | | | | | | | | | | | | * 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>
* Update spirv-tool submodule to include the debug instruct fix (#7541)kaizhangNV2025-06-26
| | | | | | | | | | | | * 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.
* Hide atomics struct from reflection api (#7520)James Helferty (NVIDIA)2025-06-26
| | | | | | | | | | | | | | | | | | | | * 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
* Support `mad` in WGSL (#7538)Mehmet Oguz Derin2025-06-26
|
* Fix tuple AST & IR layout size queries (#7502)Julius Ikkala2025-06-26
| | | | | * Fix tuple AST & IR layout size queries * Don't peephole sizeof if size is still indeterminate
* Fix for OpUConvert producing invalid opcode when to/from signs differ (#7398)Jerran Schmidt2025-06-26
| | | | | | | | | | | | | | | | | * 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
* Fix the invalid SPIRV decoration issue (#7527)kaizhangNV2025-06-26
| | | | | | | | | | | | | | * 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.
* Correct the scope for DebugLocalVariable (#7516)Lujin Wang2025-06-26
| | | | | | | | | | | | | | | | * 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.
* Use LoadLibraryExA instead of LoadLibraryA (#7535)jarcherNV2025-06-26
| | | | Slangpy uses AddDllDirectory to specify locations of Slang DLL files. LoadLibraryA ignores this so instead use LoadLibraryExA.
* Update spirv-tools to for SDK v2025.3 (#7519)Gangzheng Tong2025-06-26
|
* Set current astbuilder for reflection API (#7488)Mukund Keshava2025-06-26
| | | | | | | | | | | | | | | | | 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
* Add matrix operand for OpCooperativeVectorMatrixMulAddNV (#7524)Gangzheng Tong2025-06-26
| | | | | | | | | | | * 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>
* Fix Phi elimination pass sometimes leaving broken insts in release builds ↵Julius Ikkala2025-06-25
| | | | | | | | | (#7499) * Make phi elimination pass modify branches in-place * Add test and fix formatting * Avoid double removal of param insts
* Fix ambiguous reference for 'extern' and 'export' (#7515)kaizhangNV2025-06-25
| | | | | | Close #7509. When there are both `export` and `extern` decls in lookup result, we should remove all `extern` decls.
* Fix generation of wgsl case arms (#7374)Swoorup Joshi2025-06-25
| | | | | | | | | * Fix generation of wgsl case arms * Added test case to test generation of switch case --------- Co-authored-by: Harsh Aggarwal (NVIDIA) <haaggarwal@nvidia.com>