summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAge
* Allow LHS of `where` to be any type. (#6333)Yong He2025-02-12
| | | | | | | | | | | | | * Allow LHS of `where` to be any type. * Register free-form extensions when loading precompiled module. * Fix test. * Fix. * Fix `as<IRType>`. * try fix precompiled module test.
* Fix crash when handling uninitialized resource type (#6338)kaizhangNV2025-02-12
| | | | | | | | | | | | * Fix crash when handling uninitialized resource type close #6328. When declare a var with struct type, if the struct has a resource type field and it doesn't provide explicit constructor, because slang won't implicit construct such variable at declare site if user doesn't explicitly call the initializer list, we should report the resource type field uninitialized as an error to prevent future possible crash when legalize any use of such variable.
* Add checking for differentiability of the primal substitute function. (#6277)Sai Praveen Bangaru2025-02-11
| | | | Co-authored-by: Yong He <yonghe@outlook.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
* Add raypayload decoration to ray payload structs (#6164)Ellie Hermaszewska2025-02-11
| | | | | | | | | * Add raypayload decoration to ray payload structs Closes https://github.com/shader-slang/slang/issues/6104 * Disable PAQs when compiling with DXC See https://github.com/shader-slang/slang/issues/3448
* Emit missing atomic64 capability, fix int-typed builtin used in both vs and ↵Yong He2025-02-11
| | | | | fs. (#6314) Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
* Add support for Metal subgroup/simd operations (#6247)Darren Wihandi2025-02-10
| | | | | | | | | | | | | | | | | | | | | * initial work for metal subgroups * add glsl intrinsics * enable wave tests * enable glsl subgroup tests, glsl barrier fixes * minor fixes * fix incorrect test target * disable some glsl functional tests * disable failing glsl test --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Add WGSL to list of formats supporting multiple entry points (#6324)David A Roberts2025-02-10
| | | | | * Add WGSL to list of formats supporting multiple entry points * Add a test for generating multiple WGSL entrypoints
* Use and() and or() functions for logical-AND and OR (#6310)Jay Kwak2025-02-07
| | | | | | | | | | | | * Use and() and or() functions for logical-AND and OR With this commit, Slang will emit function calls to `and()` and `or()` for the logical-AND and logical-OR when the operands are non-scalar and the target profile is SM6.0 and above. This is required change from SM6.0. For WGSL, there is no operator overloadings of `&&` and `||` when the operands are non-scalar. Unlike HLSL, WGSL also don't have `and()` nor `or()`. Alternatively, we can use `select()`.
* Uncomment a previously failing test case (#6303)Anders Leino2025-02-06
| | | | | | This case now parses after the following PR was merged. https://github.com/shader-slang/slang/pull/6281 Co-authored-by: Yong He <yonghe@outlook.com>
* Support stage_switch. (#6311)Yong He2025-02-06
| | | | | | | | | * Support stage_switch. * Update proposal status. * Fix gl_InstanceID. * Fix.
* Allow tuples to work with initializer list. (#6301)Yong He2025-02-05
| | | | | * Allow tuples to work with initiailizer list. * Update definition of C-Style types.
* maxtessfactor attribute should take a floating point value (#6289)Jay Kwak2025-02-05
| | | | | * maxtessfactor attribute should take a floating point value * Support integer value on maxtessfactor
* Fix DCE for calls to functions that have associations (#6272)Sai Praveen Bangaru2025-02-05
| | | | | | | * Fix DCE for calls to functions that have associations * Update slang-ir-util.cpp * Update slang-ir-util.cpp
* Use two-stage parsing to disambiguate generic app and comparison. (#6281)Yong He2025-02-05
| | | | | | | * Use two-stage parsing to disambiguate generic app and comparison. * Typo fix. * Update doc.
* Feature/initialize list side branch (#6058)kaizhangNV2025-02-05
| | | | | | | | | | | | | | | | | | | | | | * SP004: implement initialize list translation to ctor - We synthesize a member-wise constructor for each struct follow the rules described in SP004. - Add logic to translate the initialize list to constructor invoke - Add cuda-host decoration for the synthesized constructor - Remove the default constructor when we have a valid member init constructor - Disable -zero-initialize option, will re-implement it in followup (#6109). - Fix the overload lookup issue When creating invoke expression for ctor, we need to call ResolveInvoke() to find us the best candidates, however the existing lookup logic could find us the base constructor for child struct, we should eliminate this case by providing the LookupOptions::IgnoreInheritance to lookup, this requires us to create a subcontext on SemanticsVisitor to indicate that we only want to use this option on looking the constructor. - Do not implicit initialize a struct that doesn't have explicit default constructor. Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Fix non-square matrix derivatives (#6282)Sai Praveen Bangaru2025-02-04
|
* Fix warning about push constants, shaderRecordEXT (#6269)cheneym22025-02-04
| | | | | | | | | | | * Fix warning about push constants, shaderRecordEXT These resources should not warn about missing vk::binding. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Fix parsing of nested generic app. (#6259)Yong He2025-02-03
|
* Auto enable `-fvk-use-entrypoint-name` when there is more than one ↵Yong He2025-02-03
| | | | | | | entrypoint. (#6260) * Auto enable `-fvk-use-entrypoint-name` when there is more than one entrypoint. * Fix.
* Add support for WGSL subgroup operations (#6213)Darren Wihandi2025-02-02
| | | | | | | | | | | | | | | | | | | | | * initial work * more work * more work on glsl intrinsics * add subgroup broadcast for glsl * wip add wgsl extension tracking * enable tests, enable extensions and added some todos * format and warning fixes * fix wgsl extension tracker --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Declare `VariablePointers` capability when needed. (#6231)Yong He2025-01-30
|
* Support cooperative vector including Vulkan-Header (#6228)Jay Kwak2025-01-30
| | | | | * Support cooperative vector including Vulkan-Header Adding a Slang support for cooperative vector with vulkan-header update.
* Support cooperative vector (#6223)Jay Kwak2025-01-30
| | | | | | | * Support cooperative vector without Vulkan-header update Adding a Slang support for cooperative vector. But this commit doesn't have Vulkan-header update.
* Fix ConstantIntVal::toText when the val is a enum. (#6224)Yong He2025-01-29
| | | | | * Fix ConstantIntVal::toText when the val is a enum. * Fix comment.
* Update SPIRV submodules and fix tests (#6222)Jay Kwak2025-01-29
|
* Fix combined sampler documentation and warning (#6207)cheneym22025-01-29
| | | | | | | | | | | * Fix combined sampler documentation and warning * Update comment, show detailed '-fvk-t-shift' message in warning instead of generic '-fvk-xxx-shift' * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Fix the type coerce issue (#6215)kaizhangNV2025-01-29
| | | | | | | | * Fix the type coerce issue When synthesize the default ctor, if there is a base type we will synthesize an InvokeExpr to call base type's default ctor as well. But we should use the type of the inheritanceDecl instead of base struct decl.
* Implement WaveMultiPrefix* for SPIRV and GLSL (#6182)Darren Wihandi2025-01-29
|
* Fix exact-match witness synthesis for static functions (#6204)Darren Wihandi2025-01-29
| | | | | | | | | | | | | * fix non-static methods when trying to synthesize method requirement witness * add tests * update test * improve test --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Fix UIntSet calcSubtract to handle mismatched buffer sizes (#6205)Darren Wihandi2025-01-28
| | | | | | | | | * fix calcSubtract on UIntSet * add test --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Allow requiring glsl language extensions on structs (#6173)Ellie Hermaszewska2025-01-28
| | | | | | | | | | * Allow requiring glsl language extensions on structs * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
* Delete invalid ASSERT in `isTypeOperandEqual`. (#6196)Yong He2025-01-28
|
* Properly plumbing layout for global varyings. (#6198)Yong He2025-01-27
| | | | | * Properly plumbing layout for global varyings. * Fix test.
* Fix depth texture sampling on Metal. (#6168)Yong He2025-01-24
|
* Add bgra8 format (#6163)Darren Wihandi2025-01-24
| | | | | | | | | | | | | | | | | * 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 <yonghe@outlook.com>
* improve error message on generic value decls (#6169)Darren Wihandi2025-01-24
| | | Co-authored-by: Yong He <yonghe@outlook.com>
* Fix incorrect resolve of specialization instance (#6162)Jay Kwak2025-01-23
| | | | | | | | | | | | | | | | | | * 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.
* Add validation for destination of atomic operations (#6093)Anders Leino2025-01-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
* Use SPIRV integer vector dot product instructions (#6141)Darren Wihandi2025-01-22
| | | | | | | | | * Use SPIRV integer vector dot product instructions * fix test --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Remove unnecessary parameters from Metal entry point signature (#6131)Darren Wihandi2025-01-22
| | | | | | | | | | | | | | | | | * 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 <yonghe@outlook.com>
* Fix def-use issue from multi-level break elimination (#6134)Sai Praveen Bangaru2025-01-20
|
* Implement Quad Control intrinsics (#5981)Darren Wihandi2025-01-17
|
* test-server should use d3d12core.dll from bin directory (#6095)Jay Kwak2025-01-17
|
* Fix circularity issue when checking multiple generic interface constraints. ↵Sai Praveen Bangaru2025-01-17
| | | | | | | | | | | | | | | (#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 <yonghe@outlook.com>
* Add diagnostic for function body followed by a `;`;. (#6122)Yong He2025-01-17
|
* Add groupshared atomic array test. (#6107)Yong He2025-01-17
| | | | | * Add groupshared atomic array test. * Fix test.
* Allow __subscript<T> syntax. (#6124)Yong He2025-01-17
| | | | | * Allow __subscript<T> syntax. * Fix.
* Refactor _Texture to constrain on texel types. (#6115)Yong He2025-01-17
| | | | | | | | | * Refactor _Texture to constrain on texel types. * Fix tests. * Fix. * Disable glsl texture test because rhi can't run it correctly.
* Fix interface requirement lowering for generic accessors (#6123)Sai Praveen Bangaru2025-01-17
|
* hoist entry point params for wgsl (#6116)Darren Wihandi2025-01-17
| | | Co-authored-by: Yong He <yonghe@outlook.com>