summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2025-01-30Declare `VariablePointers` capability when needed. (#6231)Yong He
2025-01-30Support cooperative vector including Vulkan-Header (#6228)Jay Kwak
* Support cooperative vector including Vulkan-Header Adding a Slang support for cooperative vector with vulkan-header update.
2025-01-30Support cooperative vector (#6223)Jay Kwak
* Support cooperative vector without Vulkan-header update Adding a Slang support for cooperative vector. But this commit doesn't have Vulkan-header update.
2025-01-29Fix ConstantIntVal::toText when the val is a enum. (#6224)Yong He
* Fix ConstantIntVal::toText when the val is a enum. * Fix comment.
2025-01-29Update SPIRV submodules and fix tests (#6222)Jay Kwak
2025-01-29Fix combined sampler documentation and warning (#6207)cheneym2
* 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>
2025-01-29Fix the type coerce issue (#6215)kaizhangNV
* 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.
2025-01-29Implement WaveMultiPrefix* for SPIRV and GLSL (#6182)Darren Wihandi
2025-01-29Fix exact-match witness synthesis for static functions (#6204)Darren Wihandi
* 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>
2025-01-28Fix UIntSet calcSubtract to handle mismatched buffer sizes (#6205)Darren Wihandi
* fix calcSubtract on UIntSet * add test --------- Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-28Allow requiring glsl language extensions on structs (#6173)Ellie Hermaszewska
* 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>
2025-01-28Delete invalid ASSERT in `isTypeOperandEqual`. (#6196)Yong He
2025-01-27Properly plumbing layout for global varyings. (#6198)Yong He
* Properly plumbing layout for global varyings. * Fix test.
2025-01-24Fix depth texture sampling on Metal. (#6168)Yong He
2025-01-24Add bgra8 format (#6163)Darren Wihandi
* 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>
2025-01-24improve error message on generic value decls (#6169)Darren Wihandi
Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-23Fix incorrect resolve of specialization instance (#6162)Jay Kwak
* 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.
2025-01-22Add validation for destination of atomic operations (#6093)Anders Leino
* 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>
2025-01-22Use SPIRV integer vector dot product instructions (#6141)Darren Wihandi
* Use SPIRV integer vector dot product instructions * fix test --------- Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-22Remove unnecessary parameters from Metal entry point signature (#6131)Darren Wihandi
* 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>
2025-01-20Fix def-use issue from multi-level break elimination (#6134)Sai Praveen Bangaru
2025-01-17Implement Quad Control intrinsics (#5981)Darren Wihandi
2025-01-17test-server should use d3d12core.dll from bin directory (#6095)Jay Kwak
2025-01-17Fix circularity issue when checking multiple generic interface constraints. ↵Sai Praveen Bangaru
(#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>
2025-01-17Add diagnostic for function body followed by a `;`;. (#6122)Yong He
2025-01-17Add groupshared atomic array test. (#6107)Yong He
* Add groupshared atomic array test. * Fix test.
2025-01-17Allow __subscript<T> syntax. (#6124)Yong He
* Allow __subscript<T> syntax. * Fix.
2025-01-17Refactor _Texture to constrain on texel types. (#6115)Yong He
* Refactor _Texture to constrain on texel types. * Fix tests. * Fix. * Disable glsl texture test because rhi can't run it correctly.
2025-01-17Fix interface requirement lowering for generic accessors (#6123)Sai Praveen Bangaru
2025-01-17hoist entry point params for wgsl (#6116)Darren Wihandi
Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-17Fix `-capability` arg in SPIRV debug command line output. (#6114)Yong He
2025-01-17Fix prebound parameter pack - argument list matching logic. (#6111)Yong He
* Fix prebound parameter pack - argument list matching logic. * Move tests. * Fix.
2025-01-16Move global variable initialization into entry points for WGSL (#6106)Anders Leino
* Add test that reproduces the issue in #5986 * Call moveGlobalVarInitializationToEntryPoints for WGSL as well This closes #5986. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-17Fix cyclic lookups with UnscopedEnums (#6110)Julius Ikkala
* Fix cyclic lookups with UnscopedEnums * Add test with multiple unscoped enums with explicit types --------- Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-16C-like emitter: Add parenthesis when combining relational and bitwise… (#6070)Anders Leino
* C-like emitter: Add redundant parentheses in several cases This is required since the Dawn WGSL compiler requires parentheses even though precedence rules could resolve order of operations. This closes #6005. * Fix tests/metal/byte-address-buffer The output now includes parentheses around shift expressions appearing as operands in bitwise expressions, so update the test accordingly. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-16Implement Packed Dot Product intrinsics (#6068)Darren Wihandi
* implement dot acc intrinsics * fix sm version * fix test * improve comment --------- Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-16support SV_ViewIndex for Metal (#6103)Darren Wihandi
Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-15Inline global constants that contains opaque handles for legalization. (#6098)Yong He
* Inline global constants that contains opaque handles for legalization. * Add diagnostics on opaque type global variables. * Fix. * Fix test.
2025-01-15Implement AnyValue marshalling for 8-bit integers (#6059)Julius Ikkala
* Implement anyvalue marshalling for 8-bit integers * Fix missing offset from int8/uint8 case * Disable anyvalue 8-bit test for DXIL Because it doesn't support 8-bit values anyway. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-15Fix optix varying legalization. (#6089)Yong He
* Fix optix varying legalization. * Add test.
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-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-10Fix CUDA reflection for acceleration structure handle size. (#6055)Yong He
2025-01-10Fix `markNonContextParamsAsSideEffectFree`. (#6054)Yong He
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>