summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
...
* Set default mimalloc for spirv-tools but allow user to override (#8460)Gangzheng Tong2025-09-17
| | | | | | | | | | | | | | | | | | | | | | | | This PR resolves a configuration conflict where the SLANG_ENABLE_SPIRV_TOOLS_MIMALLOC option was defined twice with different defaults, causing user settings to be overridden. Changes: - Removed duplicate definition in external/CMakeLists.txt that only applied to WIN32 - Define default in main CMakeLists.txt - ON by default for Windows - OFF by default for other platforms (still need to resolve crashes so set it to `OFF` for now) Preserved user configuration - explicit -DSLANG_ENABLE_SPIRV_TOOLS_MIMALLOC=value settings are now properly respected Related to https://github.com/shader-slang/slang/issues/8158 --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Diagnostic for metal ref mesh output assignment (#8365)James Helferty (NVIDIA)2025-09-17
| | | | | | | When slang detects assignment to a mesh output reference on metal, generate a diagnostic message. (Metal mesh shader outputs must be assigned via 'set' instead of 'ref'.) Fixes #7498
* Use self-hosted runner for Windows release build (#8470)Gangzheng Tong2025-09-17
| | | | | | | | | | - Remove hard-coded Win SDK version. - Using self-hosted machine for building release package in Windows. - Remove the steps from release.yml that have been done in common steup. --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Fix LSS intrinsics for hit objects in ray tracing tests (#8469)Harsh Aggarwal (NVIDIA)2025-09-17
| | | | | | | | | | | | Enable GetLssPositionsAndRadii() call in rayGenLssIntrinsicsHitObject shader that was previously commented out. This fixes the failing ray-tracing-lss-intrinsics-hit-object test which was returning all zero values for LSS position and radius data. The hit object LSS intrinsics are now working correctly in D3D12 backend, returning proper endcap positions and radii values as expected by the test. All 27 test assertions now pass successfully. Fixes #8128
* Added __magic_enum (#8436)Ronan2025-09-17
| | | | | | | | | | | | | | | | | | | | | Fixes #8406 (and #8410). `AddressSpace`, `MemoryScope` and `AccessQualifier` are no longer `BaseType`. I added a new `__magic_enum` (very similar to `__magic_type`) syntax to be able to easily create values or these enums from the compiler. (I don't know if it was the right way to do it, but it works and the changes are small enough?). I had a weird bug: `tests/language-feature/capability/address-of.slang` was failing in `IRBuilder::_findOrEmitConstant(IRConstant& keyInst)`. When needing a new `u64(0)`, it did not find it in the `ConstantMap` first, but then failed to add it right after because it already existed in the map! But this was triggered by `IRPtrType* IRBuilder::getPtrType(IROp op, IRType* valueType, AccessQualifier accessQualifier, AddressSpace addressSpace)`, which is a strange coincidence... but I could not find the issue in what I did. I ended up bumping unordered_dense, and it solved the issue (so there was a bug in there).
* Change CI to use locally installed sdk (#8450)Mukund Keshava2025-09-17
|
* Diagnose error when the function args can't satisfy constexpr parameter ↵Gangzheng Tong2025-09-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | requirements (#7269) ## Summary This PR enhances constexpr validation by adding proper error checking when function arguments cannot satisfy constexpr parameter requirements, addressing issue #6370. ## Problem Previously, when a function declared constexpr parameters, the compiler would attempt to propagate constexpr-ness to the call site arguments, but there was insufficient validation and error reporting when this propagation failed. This could lead silent failures where constexpr requirements weren't properly enforced ## Solution This PR adds checks that: 1. **Validates constexpr arguments**: When a function parameter is marked as `constexpr`, the compiler now explicitly checks that the corresponding argument can be marked as `constexpr` 2. **Issues clear compilation errors**: added `Diagnostics::argIsNotConstexpr`) 3. **Handles both call scenarios**: The validation works for both: - Direct function calls with IR-level function definitions - Calls to function from external modules Fixes #6370 --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Enable static mimalloc in Spriv-Tools (#8419)Gangzheng Tong2025-09-16
| | | | | | | | | | | | | | | | | | | | | | * Added optional mimalloc integration for SPIRV-Tools to improve compilation performance * Cloning `mimalloc` repo to external/ on demand during cmake config * Enabled by default on Windows, configurable via `SLANG_ENABLE_SPIRV_TOOLS_MIMALLOC` CMake option, to enable static mimalloc build in spirv-tools. * There are some crashes in Linux and Mac with static mimalloc enabled, likely due to the system malloc and mimalloc mixed usage. This might be expected as mimalloc in spirv-tools is not extensively tested according to https://github.com/KhronosGroup/SPIRV-Tools?tab=readme-ov-file#dependency-on-mimalloc. So by default only Windows has this enabled. Close: https://github.com/shader-slang/slang/issues/8158 --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Fix segfault in SPIR-V header processing in SpirvInstructionHelper (#8428)Gangzheng Tong2025-09-10
| | | | | | | | | | | | | | | | | | | | The `SpirvInstructionHelper::loadBlob()` method could segfault when calling `m_headerWords.addRange()` if the SPIR-V blob contained insufficient data for the required 5-word header. To reproduce, run ``` ./build/Debug/bin/slangc.exe tests/modules/environment.slang -o tests/modules/environment.slang-module -target spirv -separate-debug-info (0): error 57004: output SPIR-V contains no exported symbols. Please make sure to specify at least one entrypoint. Segmentation fault ``` The error is expected, but the `Segmentation fault` is not. This PR adds the check to ensure the SPIR-V blob has at least `SPV_INDEX_INSTRUCTION_START * sizeof(SpvWord)` bytes (20 bytes minimum) before attempting to process the header words. Related to: https://github.com/shader-slang/slang/issues/7547
* Add FindModifier for Declarations (#8308)Xuanda Yang2025-09-10
| | | | | | Add `findModifier` for `DeclReflection` so pattern like `extern struct foo;` can be properly reflected. Closes #8009
* Fix crash when compiling specialized generic entrypoint containing a static ↵Yong He2025-09-10
| | | | | | | | | | | | | | | | | | | | | const decl. (#8392) Closes #8184. We fixed three issues with this regression test: 1. After generating IR for a `SpecializeComponentType`, we should also strip the frontend decorations from the IR so there is no HighLevelDeclDecoration that will go into the backend. 2. When lowering a static const inside a generic function, we should not give the static const a linkage, because it won't such constant will not appear in global scope. Trying to give it a linkage decoration will lead to the parent generic (for the function) to have two duplicate Export/Import decorations with different mangle names, and confuses the linker. 3. Make sure internal exceptions does not leak through `IComponentType::getEntryPointCode`/`getTargetCode`.
* Fix pointers and C-like layout in varying parameters (#8425)Julius Ikkala2025-09-10
| | | | | | | | | | | | | Closes #8409, but ended up being more about fixing another bug. While the issue itself seems to only be a simple typo fix (see second commit in this PR), I found out during writing a test that pointers never got correct locations regardless of layout. Their locations were always assigned to zero due to lacking a resource usage entry in `TypeLayout`. They were also missing the `Flat` decoration, so I went ahead and added that too. I can split this up into two separate PRs if that's preferred; both aspects just share a test right now and fix a similar-looking issue in the resulting SPIR-V.
* Squash warnings on gcc 14 (#8377)Ellie Hermaszewska2025-09-10
|
* CUDA: Fix compiler crash with unsized array field - nonuniformres-as-… (#8380)Harsh Aggarwal (NVIDIA)2025-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | …function-parameter.slang #8315 Root Cause: CUDA compilation crashed with `assert failure: !seenFinalUnsizedArrayField` because unsized arrays like `RWStructuredBuffer<uint> globalBuffer[]` were not the final field in generated parameter structs, violating the layout constraint in slang-ir-layout.cpp. Fix: Extended `collectGlobalUniformParameters` to automatically reorder struct fields for CUDA targets - regular fields first, unsized arrays last. Other targets preserve original order. Impact: - Enables CUDA support for nonuniform resource indexing as function parameters - Zero impact on existing GLSL/HLSL/SPIRV targets - Automatic handling - no manual parameter reordering required Files: slang-emit.cpp, slang-ir-collect-global-uniforms.cpp/.h, test file --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
* Check if debugVar for is debuggable types in the legalization pass (#8326)Gangzheng Tong2025-09-10
| | | | | | | | | | | | | | | | | ## Problem When generic functions with debug variables were specialized with concrete types containing non-debuggable fields (e.g., `StructuredBuffer`), the IR cloning process would create invalid `DebugVar` instructions without checking if the substituted types remained debuggable. ## Solution This fix adds a defensive check in the legalization pass that removes the debugVar created for the non-debuggable types. --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Fix language server auto-complete regression in debug build. (#8416)Yong He2025-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes this regression: ```slang struct MyType { // Regression Condition 1: there must be more than one member in the lookup scope. float v; int getSum() { return 0; } } void m(MyType t) { // Regression condition 2: the completion must be in an init expression. // Regression condition 3: none of the candidate members can coerce to the expected type. // Regression behavior: no completion candidates are shown, because // SemanticsVisitor::resolveOverloadedLookup throws an error when there are 0 applicable candidates // after type coercion filtering. Texture2D x = t.; // completion request after . here } ``` The root cause is that we shouldn't be applying candidate filtering on the candidate list when in completion checking mode. Closes #8417.
* Update SPIRV-{Tools,Headers} (#8415)Jay Kwak2025-09-10
| | | | | | | | | This updates SPIRV submodules. Unfortunately we cannot use the latest because one of PRs in SPIRV-Tools causes VVL errors on our slang-tests. The issue is tracked in - https://github.com/KhronosGroup/SPIRV-Tools/issues/6316 - https://github.com/shader-slang/slang/issues/8414 This PR also updates/simplifies the document of updating SPIRV process.
* Send notification only on scheduled CTS runs (#8418)Gangzheng Tong2025-09-09
|
* Enable ccache in slang bulid for CTS test (#8413)Gangzheng Tong2025-09-10
| | | | - Enable ccache in slang bulid for CTS test - Allow manual CI dispatch
* Always define OptixTraversableHandle (#8411)Simon Kallweit2025-09-09
| | | | This fixes an issue where non-raytracing kernels couldn't contain any RaytracingAccelerationStructure resources even when not used.
* Enable slang_lldb.py on macos (#8327)James Helferty (NVIDIA)2025-09-09
| | | | | | | macos 15.6 includes python 3.9.6 with Xcode, which doesn't understand match/case. Changing it to to the less spiffy if/elif. Co-authored-by: Yong He <yonghe@outlook.com> Co-authored-by: Sam Estep <sam@samestep.com>
* Fix #8314 - Enable tests/compute/texture-subscript.slang for CUDA (#8408)Harsh Aggarwal (NVIDIA)2025-09-09
| | | The test can be enabled
* Use wide char version of Windows API (#8390)Gangzheng Tong2025-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR modernizes the Windows-specific code by replacing ANSI Windows API functions with their Unicode (wide character) counterparts. This change ensures proper handling of Unicode file paths and strings on Windows systems. ### File Operations (`source/core/slang-io.cpp`) - `DeleteFileA` → `DeleteFileW` - `GetTempPathA` → `GetTempPathW` - `GetTempFileNameA` → `GetTempFileNameW` - `RemoveDirectoryA` → `RemoveDirectoryW` - `SHFileOperationA` → `SHFileOperationW` - `GetModuleFileNameA` → `GetModuleFileNameW` with UTF-8 conversion ### Platform Operations (`source/core/slang-platform.cpp`) - `GetModuleHandleExA` → `GetModuleHandleExW` - `LoadLibraryExA` → `LoadLibraryExW` - `LoadLibraryA` → `LoadLibraryW` - `OutputDebugStringA` → `OutputDebugStringW` ### Runtime and Tools - `MessageBoxA` → `MessageBoxW` in slang-rt - `GetCurrentDirectoryA` → `GetCurrentDirectoryW` in slang-fiddle - String literal conversion to wide strings in vk-pipeline-create --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Gangzheng Tong <gtong-nv@users.noreply.github.com> Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Don't emit ArrayStride 0 for RWStructuredBuffer pointers (#8397)Julius Ikkala2025-09-08
| | | | | | | | | | | | | | | | | Fixes #8396 by not emitting the `ArrayStride` when it would've been zero. The problem is caused by #7848, more details in the issue description. I checked that with equivalent GLSL code, glslangValidator does not emit any `ArrayStride`. I assume that the addition of `storageClass == SpvStorageClassStorageBuffer` to line 1848 is not a mistake. If it is, that addition could also be simply reverted to fix this issue, I tested that option as well. With these changes, Slang tests work locally on my PC again. Related to this; it'd be nice to have GPUs from multiple vendors in the CI to avoid this kind of thing happening again. Or even just llvmpipe; that doesn't even require a GPU and would add at least one more driver to test with.
* Enhances CI reliability and debug logging (#8393)Gangzheng Tong2025-09-07
| | | | | | | | | | | | | | | | | 1. Adds retry logic - Implements 3-attempt retry mechanism for intermittent test failures 2. Reduces parallelism for Linux - Changes server counts back to 1 for more stable execution, given the test is short in Linux for now 3. Adds detailed error logging - Enhanced diagnostic information for test parsing failures 4. Add Python 3.10 setup for slangpy tests for github runners 5. Removes submodule checkout for slang and slasngpy tests 6. Adds check-ci job - Implements consolidated CI status for simplified branch protection rule --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Relax restriction on using link-time types for shader parameters. (#8387)Yong He2025-09-05
| | | | | | | | | This change relaxes a previous restriction on link-time types and constants, so that we now allow them to be used to define shader parameters. Doing so will result in a parameter layout that is incomplete prior to linking. The PR added a test to call the reflection API on a fully linked program and ensure that we can report correct binding info.
* Remove unnecessary check and adust server count etc. in CI (#8374)Gangzheng Tong2025-09-05
| | | | | | | | | | | | | | | | - This PR removes "wasm" check from the test job, since there is no test job for "wasm" yet. - Also, move the check for slang-rhi and slangpy test to the job level to skip the setup etc. if no run is needed. - Update the macos compiler version in building.md to match the clang compiler used in CI. - Reduce the server count in Linux and Mac when running slang-test to ease the machine load - Run slangpy test with `-n auto --maxprocesses=4` to speed up --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Add check for backtrace availability (#8329)Dario Mylonopoulos2025-09-06
| | | | | | | | | | | | | | The header execinfo.h and the related backtrace functionality is not available on all linux platforms. In particular it's missing on musl linux and on Android before API version 33. This causes compilation errors on those platforms. With this change, we first check if backtrace functionality is available by checking if we are using glibc or a compatible Android version. Tested on manylinux_2_28 with glibc 2.28 and musllinux_1_2 with musl 1.2, has not been tested on Android. Co-authored-by: Yong He <yonghe@outlook.com>
* Disable a few WGSL testing using Wave functions in branches (#8386)Jay Kwak2025-09-05
| | | | | | | | | | WGSL requires Wave functions to be used only in uniform control flow. The latest compiler, Tint, started to error out when Wave functions are used in a dynamic control flow. This commit disables some of tests using Wave functions in dynamic branches. If possible, they are altered to call Wave functions in uniform control flows.
* Add warnings for overflows of integer types (#8281)jarcherNV2025-09-05
| | | | | The code int x4 = 0xFFFFFFFFFFFFFFFF previously did not produce a warning due to the value being too large for the type. This patch now checks for this and similar issues during parsing.
* Try both LoadLibrary functions on Windows (#8368)jarcherNV2025-09-05
| | | | If a given library cannot be found using LoadLibraryExA then try again using LoadLibraryA. Return an error only if both of these failed.
* Fix cache_dir path for ccache config (#8370)Gangzheng Tong2025-09-04
| | | | | | | | | | | | | | | | | | Previously we are missing `ccache --set-config=cache_dir="$ccache_dir"` and the build was using the default cache_dir. This PR fixed that and the cache are hit in reruns. ``` 📊 ccache statistics (post-build): Cacheable calls: 1198 / 1198 (100.0%) Hits: 1195 / 1198 (99.75%) Direct: 1193 / 1195 (99.83%) Preprocessed: 2 / 1195 ( 0.17%) Misses: 3 / 1198 ( 0.25%) Local storage: Cache size (GiB): 0.6 / 5.0 (11.11%) Hits: 1195 / 1198 (99.75%) Misses: 3 / 1198 ( 0.25%) ```
* Split CI to build and test jobs (#8359)Gangzheng Tong2025-09-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CI has been re-organized with the following: ``` ci.yml (Main Orchestrator) ├── filter job │ ├── Documentation Only? → Yes → Skip CI │ └── Documentation Only? → No → Continue CI │ ├── Build Jobs │ └── ci-slang-build.yml │ ├── common-setup action │ ├── Build & Package │ └── Upload Artifacts (Build package and Tests package) │ └── Test Jobs └── ci-slang-test.yml └── common-test-setup action ├── Download Tests Artifacts ← (from Build) └── Run Tests ``` To achieve fine-grained build->test dependency, instead of using `matrix strategy` in single build (or single test) job, the main ci.yml statically defines the each config of the build and test job. e.g. `build-windows-debug-cl-x86_64-gpu` and `test-windows-debug-cl-x86_64-gpu` are a pair of the build-test job for the windows/debug/ci config. Closes: https://github.com/shader-slang/slang/issues/6728 --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Fix#8128 LSS and sphere hit object intrinsics fail to compile (#8339)Harsh Aggarwal (NVIDIA)2025-09-04
| | | Update intrinsics signature as per the nvapi header
* Enable CUDA support for additional HLSL intrinsic tests (#8293)Harsh Aggarwal (NVIDIA)2025-09-04
| | | | | | | | | | | | | | | | | | | | | | | | Enable CUDA support for additional HLSL intrinsic tests by implementing missing functionality and fixing compiler bugs affecting CUDA targets. - Fix critical bug in InterlockedCompareStore64 where division used /4 instead of /8 for 64-bit types, causing incorrect memory addressing for all signed int 64_t atomics - Add signed int64_t atomic wrappers (atomicExch, atomicCAS) to CUDA prelu de that properly cast to/from unsigned types as required by CUDA's atomic API - Enable tests: atomic-intrinsics-64bit.slang - Implement CUDA support for QuadAny and QuadAll operations using warp shu ffle primitives (__shfl_sync with quad-level lane masking) - Add CUDA to quad_control capability definition in slang-capabilities.capdef - Add _slang_quadAny/_slang_quadAll helper functions to CUDA prelude - Enable tests: quad-control-comp-functionality.slang, subgroup-quad.slang --------- Co-authored-by: szihs <675653+szihs@users.noreply.github.com>
* Handle slang-test command comments better (#8363)Jay Kwak2025-09-04
| | | | | | | | | | | | | | | | | | | | | | | | Before this PR only the following was a valid line without any white-space character nor additional `/` character, ``` //TEST: ``` This PR is to allow slang-test to handle the following variants of the test command comments, ``` ///TEST: // TEST: // TEST: ////// TEST: ``` This PR revealed a regression on two tests: - tests/cpp-compiler/c-compile-shared-library.c (cpu) - tests/cpp-compiler/cpp-compile-shared-library.cpp (cpu) They are disabled as a part of this PR. And there is a new github issue to track it later, - https://github.com/shader-slang/slang/issues/8362
* Diagnose on structured buffers containing resources (#8222)Ellie Hermaszewska2025-09-03
| | | closes https://github.com/shader-slang/slang/issues/3313
* Fix#8085: Batch-9: Enable cuda tests (#8269)Harsh Aggarwal (NVIDIA)2025-09-03
|
* Add Optix Intrinsics Coverage (#8159) (#8310)Harsh Aggarwal (NVIDIA)2025-09-03
| | | Add 29 intrinsics to the list by new test
* Fix#8086: Batch-10: Enable cuda tests (#8270)Harsh Aggarwal (NVIDIA)2025-09-03
|
* manually config ccache locally (#8351)Gangzheng Tong2025-09-02
| | | | | | | | This avoids uploading the ccache to github and take the cache storage. --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Enable ccache for self-hosted runner (#8345)Gangzheng Tong2025-09-03
| | | | | | | | Related to https://github.com/shader-slang/slang/issues/6728 --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* render-test: Change D3D12 default to sm_6_5 (#8320)James Helferty (NVIDIA)2025-09-02
| | | | | | | | | Changes default for render-test to sm_6_5. Since sm_6_5 is the new default, remove the -use-dxil option, add -use-dxcb option Remove -use-dxil option from all test cases. Add -use-dxcb to two tests that needed it. Fixes #7611
* Emit DebugInfo for the legalized entry point parameters (#7703)Jay Kwak2025-09-02
| | | | | | | | | | | | | This commit is to emit the debug-info for the entry point parameters. Two things are implemented/fixed in this PR: - We were not emitting the `DebugVar` and `DebugValue` at the IR lowering level when the type of the entry point parameter is `ConstRef`. This commit handles the `ConstRef` case in a same way that the other types are handled so that `DebugVar` and `DebugValues` are properly emitted at the IR lowering level. - Two types for Geometry shaders were incorrectly treated as not valid types for the DebugInfo. They are `InputPatch` and `OutputPatch`. This commit handles them as valid types for DebugInfo.
* Remove ForceUnroll attribute from link-time specialization documentation (#8225)Copilot2025-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The link-time specialization documentation contained an incorrect example that used `[ForceUnroll]` with a link-time type method call, which would cause a compilation error. The issue was that `[ForceUnroll]` requires loop bounds to be known at compile time, but `sampler.getSampleCount()` is a method call that returns a value at runtime. **Problem:** The documentation example showed: ```csharp Sampler sampler; [ForceUnroll] for (int i = 0; i < sampler.getSampleCount(); i++) output[tid] += sampler.sample(i); ``` This would fail with error: `loop does not terminate within the limited number of iterations, unrolling is aborted.` **Solution:** Removed the `[ForceUnroll]` attribute entirely, leaving a simple loop: ```csharp Sampler sampler; for (int i = 0; i < sampler.getSampleCount(); i++) output[tid] += sampler.sample(i); ``` Since the loop bounds come from a runtime method call, there's no way for the loop to be unrolled regardless of the directive used, so the simplest solution is to remove the unroll attribute completely. - [x] Remove ForceUnroll attribute from documentation example - [x] Remove explanatory note about unroll vs ForceUnroll - [x] Remove test cases for the removed functionality - [x] Fix missing closing backticks in code block Fixes #8161. <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bmillsNV <163073245+bmillsNV@users.noreply.github.com> Co-authored-by: expipiplus1 <857308+expipiplus1@users.noreply.github.com>
* Remove unused variable in slangc::main (#8325)Jay Kwak2025-08-29
|
* [CBP] Pointer frontend changes + groupshared pointer support (#7848)ArielG-NV2025-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolves #7628 Resolves: #8197 Primary Goals: 1. Add `Access` to pointer 2. AddressSpace::GroupShared support for pointers (SPIR-V) 3. Add `__getAddress()` to replace `&` * `&` is not updated to `require(cpu)` since slangpy uses `&`. This means we must: (1) merge PR; (2) replace `&` with `__getAddress()`; (3) add `require(cpu)` to `&` Changes: * Added to `Ptr` the `Access` generic argument & logic (for `Access::Read`). * Moved the generic argument `AddressSpace` from `Ptr` to the end of the type. * Added pointer casting support between any `Ptr` as long as the `AddressSpace` is the same * Disallow globallycoherent T* and coherent T* * Disallow const T*, T const*, and const T* * Fixed .natvis display of `ConstantValue` `ValOperandNode` * Support generic resolution of type-casted integers * Added `VariablePointer` emitting for spirv + other minor logic needed for groupshared pointers Breaking Changes: * Anyone using the `AddressSpace` of `Ptr` will now have to account for the `Access` argument * we disallow various syntax paired with `Ptr` and `T*` --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Enable slangpy and slang-rhi tests for Mac (#8297)Gangzheng Tong2025-08-29
| | | | | | | | | | | | | | | | | This PR enables slang-rhi and slangpy tests in the slang CI for MacOS. * exclude the slang-rhi `sampler-array` test for mac; issue tracked in https://github.com/shader-slang/slang/issues/8246 * update slang-rhi for fix of `nested-parameter-block-2` * for slangpy test, install the required python package in the github mac runner only each CI run. Closes: https://github.com/shader-slang/slang/issues/7330 --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Revert "Reduce the dependency to thread library (#8216)" (#8319)kaizhangNV2025-08-28
| | | | This cause the pthread not found issue on old glibc build. This reverts commit 113327194d4cf750af6265a560615850a8e7e6fb.
* Remove the embedded source to avoid self-matching in slang-test (#8305)Jay Kwak2025-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `SIMPLE` type test is used with `-g[1-3]` option, the filecheck pattern will most likely to match to the string itself on the embedded source code rather than match to the emitted spirv-asm code. This commit avoids the problem by removing the embedded source code. This commit also provides an option to keep the embedded source code, `-preserve-embedded-source`. The source code removal is happening in two steps: 1. iterate all output lines and find SPIRV-ASM in the following pattern: `%N = OpExtInst %void %M DebugSource %fileId %sourceId`. And then, store the "%sourceId" value to identify which SPIRV instructions are for the embedded source code. 2. iterate all output lines again to find the `%sourceId = OpString "...."` and replace the whole string with the following string, ``` %1 = OpString "// slang-test removed the embedded source // Use `-preserve-embedded-source` to keep it explicitly " ``` This change revealed problems in the existing tests: - tests/bugs/spirv-debug-info.slang : The expected text was missing and it had to be added. The file also had Carrage-Return character on all lines and the pre-commit git hook removed them. - tests/spirv/debug-info.slang : the expected keyword DebugValue had to change to DebugDeclare, because that's what we get with ToT. - tests/spirv/debug-value-dynamic-index.slang : This test is currently failing, and it will pass once DebugLocalVariable instruction missing for parameter of the entry point function #7693 is resolved. --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com>