summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-01-14Fix issue with specialization using arithmetic expressions (#6084)Sai Praveen Bangaru
2025-01-14Fix documentation on DescriptorHandle. (#6062)Yong He
* Fix documentation on DescriptorHandle. * Fix. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2025-01-14Implement specialization constant support in numthreads / local_size (#5963)Julius Ikkala
* 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 <yonghe@outlook.com>
2025-01-14Fix #5354, change diagnostic definition error message and expect output in ↵wij
test (#6067) Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-14update slang-rhi + fix nvrtc options (#6080)Simon Kallweit
* 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 <yonghe@outlook.com>
2025-01-14Fix inaccurate documentation in member function mutability. (#6065)Entropy Lost
* Fix inaccurate documentation in member function mutability. * Change throw to result in for specificity. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-14Fix simplify if-else (#6077)cheneym2
* 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 <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-13Don't initialize temp var for out parameters. (#6076)Sai Praveen Bangaru
2025-01-13Find OptiX headers (#6071)Simon Kallweit
* add support for finding OptiX headers * add documentation * fix linux path
2025-01-10Fix CUDA reflection for acceleration structure handle size. (#6055)Yong He
2025-01-10Fix `markNonContextParamsAsSideEffectFree`. (#6054)Yong He
2025-01-10Add overload for select to handle Optional<T> (#6022)mTvare
Fixes #6020 Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-10WGSL: Convert signed vector shift amounts to unsigned (#6023)Anders Leino
* 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 <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-10Fix potential test failures due to SPIRV validation failure (#6047)Jay Kwak
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 <yonghe@outlook.com>
2025-01-10Fix Metal type layout reflection for nested parameter blocks. (#6042)Yong He
2025-01-10Initial implementation of SP#015 `DescriptorHandle<T>`. (#6028)Yong He
* 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 <186143334+slangbot@users.noreply.github.com>
2025-01-10Add exhaustive associativity test for WGSL (#6056)Anders Leino
This closes #6005.
2025-01-09Add CalculateLevelOfDetail* overloads for comparison samplers (#6018)Darren Wihandi
* add CalculateLevelOfDetail* intrinsics for comparison samplers * fix dx12 test * fix metallib test * fix merge conflict --------- Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-09Support a storage class, NodePayloadAMDX, for SPIRV work-graphs (#6052)Jay Kwak
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 <yonghe@outlook.com>
2025-01-09`[[shader_record]] / [[push_constant]]` Param Annotations Proposal (#6053)Nathan V. Morrical
* 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
2025-01-10Fix implicit string conversion breaking NativeStrings (#6035)Julius Ikkala
* 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 <yonghe@outlook.com>
2025-01-09Upgrade actions/upload-artifact from v3 to v4 (#6051)Jay Kwak
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
2025-01-09[Auto-diff] Overhaul auto-diff type tracking + Overhaul dynamic dispatch for ↵Sai Praveen Bangaru
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 <yonghe@outlook.com>
2025-01-09update slang-rhi (#6045)Simon Kallweit
2025-01-08Pass compiler specific args to GCC and Visual Studio too (#6019)Julius Ikkala
Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-08Add parentheses to make precedence explicit (#6030)Anders Leino
* 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 <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-08Add SampleCmpLevel intrinsics (#6004)Darren Wihandi
* 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 <yonghe@outlook.com>
2025-01-08slang-test: Ensure runtime is consistent (#6021)Anders Leino
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.
2025-01-07Add backtraces to examples (#5973)Anders Leino
* 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 <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-07Lower varying parameters as pointers instead of SSA values. (#5919)Yong He
* 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.
2025-01-07 Check whether array element is fully specialized (#6000)kaizhangNV
* 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 <zhangkai@zhangkais-MacBook-Pro.local> Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-07Add example showing how to use Slang/WASM (#5996)Anders Leino
This closes #5656.
2025-01-07Fix some robustness issues in the examples (#5984)Anders Leino
* 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
2025-01-07Use disassemble API from SPIRV-Tools (#6001)Jay Kwak
* 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.
2025-01-06Properly set D3D12SDKPath (#5993)Jay Kwak
* 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.
2025-01-06Add `Bindless<T>` proposal. (#6002)Yong He
* Add `Bindless<T>` proposal. * Clarify on what happesn if native bindless T has different size/alignment. * Add discussion on alternatives. * Update reviewer.
2025-01-06Add support for textureLod with sampler2DArrayShadow (#6009)Julius Ikkala
2025-01-05Fix GLSL mix(T,T,bool) SPIR-V output (#6006)Julius Ikkala
2025-01-05CI: Build the full slang-wasm.[js|wasm] targets instead of just the slang ↵Anders Leino
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.
2025-01-04Make 'shared' keyword map to 'groupshared' in GLSL mode (#6003)Julius Ikkala
2025-01-03Create DirectDeclRef when creating Decl to prevent invalid dedup. (#5945)Yong He
* Create DirectDeclRef when creating Decl to prevent invalid dedup. * Fix test. * fix * update slang-rhi
2025-01-03Fix parameter location reflection for pure data paramblocks. (#5956)Yong He
2025-01-02Correct IR generation for no-diff pointer type (#5976)kaizhangNV
* 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.
2025-01-01Allow explicit test root (#5980)bspeice
2025-01-01Fixed incorrect condition in Session::queryInterface. (#5978)Pétur Darri Pétursson
An AND operator was used where an OR should have been used.
2024-12-31add missing IR_LEAF_ISA for MetalMeshType (#5975)Darren Wihandi
Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-01Fix reflection for metal vector [[id]] location. (#5943)Yong He
2024-12-31Add terminateRayEXT & ignoreIntersectionEXT (#5974)Julius Ikkala
2024-12-31Fix `getInheritanceInfo` for `ExtractExistentialType`. (#5971)Yong He
2024-12-30Check for undefined %id in spirv_asm block. (#5966)Yong He