summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2024-10-21Fix spirv codegen for pointer to empty structs. (#5355)Yong He
2024-10-20Properly check switch case. (#5341)Yong He
2024-10-19Remove use of Variable Pointer capability. (#5352)Yong He
* Remove use of Variable Pointer capability.
2024-10-17Cleanup definition of `printf`. (#5330)Yong He
* Cleanup definition of `printf`. * Fix. * Fix spirv generation. * Fix. * enhance test.
2024-10-17Cleanup atomic intrinsics. (#5324)Yong He
* Cleanup atomic intrinsics. * Fix. * Fix glsl. * Remove hacky intrinsic expansion logic for glsl image atomics. * Fix all tests. * Fix. * Add `InterlockedAddF16Emulated`. * Fix glsl intrinsic. * Fix.
2024-10-16Fix spirv debug info for pointer types. (#5319)Yong He
* Fix spirv debug info for pointer types. * fix comment.
2024-10-15Fix type checking on generic extensions. (#5316)Yong He
Add fcpw library to test suite.
2024-10-15Enable WebGPU tests in CI (#5239)Anders Leino
2024-10-11WGSL: Enable load & store from byte-addressible buffers (#5252)Anders Leino
2024-10-09Support constant folding for static array access. (#5248)Yong He
* Support constant folding for static array access. * Fix test.
2024-10-09Use user defined type name in glsl buffer declarations. (#5242)Yong He
2024-10-09Fix precompiled glsl modules (#5230)cheneym2
When precompiling modules defined with glsl, it's necessary to link in the glsl definition module. Reuse the public fillRequirements declaration
2024-10-09Metal: Texture write fix (#4952)Dynamitos
2024-10-09Fix spirv lowering logic around pointer to unsized array. (#5243)Yong He
* Fix spirv lowering logic around pointer to unsized array. * Fix. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-10-08Overhaul docgen tool and setup CI to generate stdlib reference. (#5232)Yong He
* Overhaul docgen tool and setup CI to generate stdlib reference. * Fix build error. * Write parsed doc for all decls. * fix. * fix callout. * Fix. * Fix comment. * Fix. * Delete obsolete doc tests. * Fix. * Categorize functions and types. * Fix CI. * Update comments.
2024-10-08Look through attributes and rates when determining by reference ↵Ellie Hermaszewska
initialization (#5023) * Look through attributes and rates when determining by reference initialization Closes #5022 * Make type of unwrapAttributedType more specific * loosen type of unwrapAttributedType * Discard changes to source/slang/slang-emit-spirv.cpp * Discard changes to source/slang/slang-ir-check-differentiability.cpp * Discard changes to source/slang/slang-ir.cpp * Discard changes to source/slang/slang-ir.h * Update slang-ir-use-uninitialized-values.cpp * Remove redundant cast --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-10-08WGSL emitter: Specify private address space for global non-handle variable ↵Anders Leino
declarations (#5236) Closes issue #5229.
2024-10-07Add WGSL support for slang-test (#5174)Anders Leino
* Use the assembly description as target when disassembling I believe this is a bugfix. It seems to have worked before because up until the WGSL case, the disassembler has been the same executable as the one producing the binary to be disassembled. * Add Tint as a downstream compiler This closes issue #5104. * Add downstream compiler for Tint. * Tint is wrapped in a shared library, 'slang-tint' available from [1]. * The header file for slang-tint.dll is added in external/slang-tint-headers. * Add some boilerplate for WGSL targets. * Add an entry point test for WGSL. [1] https://github.com/shader-slang/dawn/releases/tag/slang-tint-0 * Add WGSL_SPIRV as supported target for Glslang * Add WebGPU support to slang-test This helps to address issue #5051. * Disable lots of crashing compute tests for 'wgpu' This closes issue #5051. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-10-04Add interfaces for retrieving separate linkable downstream binaries (#5128)cheneym2
* Implement separate downstream library interface Create a new com interface to house the methods for precompiling slang modules to target code. Add methods to count dependent modules and scrape them for downstream target binaries such that the downstream target binaries are linkabe outside of slang, e.g. via spirv-link or dxc. Fixes #5147 * Rename to _Experimental Clearly identify this as an interface subject to change.
2024-10-03Support custom derivatives of member functions of differentiable types (#5124)Sai Praveen Bangaru
* Initial work to support custom derivatives for member methods of differentiable types * Support custom derivatives of member functions of differentiable types - Also adds support for declaring custom derivatives via extensions. * Fix * move defs * Update slang-check-decl.cpp * Create diff-member-func-custom-derivative.slang.expected.txt * Update slang-check-decl.cpp * Fix for static custom derivatives * Fix diagnostics for [PreferRecompute] * Add backward custom derivative tests
2024-10-01Fix crash when compiling associatedtypes with generic interface constraints. ↵Yong He
(#5200) * Fix crash when compiling associatedtypes with generic interface constraints. * delete hlsl.meta.slang.temp.h. * Fix.
2024-09-30Fix diagnostics for [PreferRecompute] (#5159)Sai Praveen Bangaru
* Fix diagnostics for [PreferRecompute] * Update dont-warn-on-simple-prefer-recompute.slang * Update slang-ir-autodiff.cpp * Update dont-warn-on-simple-prefer-recompute.slang * Update warn-on-prefer-recompute-side-effects.slang
2024-09-30Add COM API for querying metadata. (#5168)Yong He
* Add COM API for querying metadata. * Fix tests. * fix test.
2024-09-27Fix bug in `translateGlslGlobalVar()`. (#5181)Yong He
2024-09-27Fix hull shader spirv legalization bug. (#5180)Yong He
2024-09-27Fix l-value computation for subscript call. (#5177)Yong He
2024-09-26Implement texture_storage_Xd in WGSL (#5158)Jay Kwak
* Implement texture_storage_Xd in WGSL This commit implements `texture_storage_Xd` in WGSL, which is similar to RWTextureXD in HLSL. It is intresting that `texture_storage_Xd` doesn't take the shader type as its input argument at all. Instead, it takes "texel format" enum value as its first template parameter, which can be found here: https://www.w3.org/TR/WGSL/#storage-texel-formats As an example, `texture_storage_2d<rg32uint, read_write>` expects vec4<u32> as a value type for `Load` and `Store`, where Z-component will be ignored and treated as zero and W-component will be treated always as 1. The type `u32` is inferred from the enum value `rg32uint`. Note that the number of component is always fixed to 4 regardless how many components are actually stored.
2024-09-26Always run AD cleanup pass. (#5157)Sai Praveen Bangaru
2024-09-25WGSL texture support for depth and multisampled (#5152)Jay Kwak
* WGSL texture support for depth and multisampled This commit fixes a few issues with WGSL texture intrinsics. - static_assert-s are corrected. - Gather functions work properly with depth textures - Load functions work properly with depth textures and multisampled textures
2024-09-25Fixing bug when writing primitives in metal mesh shaders (#5069)Dynamitos
2024-09-23Feature/wgsl intrinsic texture gather (#5141)Jay Kwak
This PR implements the texture gather functions for WGSL. The pattern was very similar to how Metal was implemented. Before copy and paste from the Metal implementation, I had to clean up the Metal implementation to make it more readable and maintainable. Gather functions are available only for 2D and 3D textures. Their `array` and `depth` variants may or may not be supported depending on the target. `static_assert` ensures that Gather functions are available only for 2D and 3D textures. Removed incorrect use of "$p" argument for targeting GLSL.
2024-09-23Implemented Combined-texture for WGSL (#5130)Jay Kwak
* Implemented Combined-texture for WGSL * Remove unnecessary comment * Limit to std430 layout * Fix compiler warning for unused variable --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-09-20Fix handling of pointer logic in wgsl backend. (#5129)Yong He
2024-09-20WGSL implement texture intrinsics except gather and sampler-less (#5123)Jay Kwak
This commit implements all of the texture intrinsics for WGSL except "Gather" and sampler-less. They will be implemented in a separate PR. A few things to note: - texture sampling functions are available only for the fragment shader stage; not for compute - WGSL doesn't have any functions similar to CalculateLevelOfDetail or CalculateLevelOfDetailUnclamped. - WGSL doesn't have a function overlaoding for textureSample with "clamp" or "status" arguments. - WGSL doesn't support Load operation with offset for texture_multisampled_XX and texture_storage_XX. - WGSL supports only four types of depth textures: 2D, 2D_array, cube and cube_array. - WGSL doesn't support "offset" variants for cube and cube_array.
2024-09-20Initial `Atomic<T>` type implementation. (#5125)Yong He
* Initial Atomic<T> type implementation. * Update design doc. * Fix. * Add test. * Fixes and add tests. * Fix WGSL. * Fix glsl. * Fix metal. * experiemnt with github metal. * experiment github metal 2 * github metal experiment 3 * experiment with github metal 4. * experiment with metal 5. * experiment 7. * metal experiment 8. * Fix metal tests. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2024-09-19Add diagnostic to verify the left hand side of a generic constraint. (#5112)Yong He
* Add diagnostic to verify the left hand side of a generic constraint. * Fix comment.
2024-09-19Synthesize conformance for generic requirements. (#5111)Yong He
* Synthesize conformance for generic requirements. * Fix. * Fix build error. * address code review.
2024-09-19Update spirv-tools version (#5089)cheneym2
* Update spirv-headers and spirv-tools versions * Fix compute-derivative regressions with upgraded spirv headers Extension was promoted from NV to KHR while retaining same enums. Fixes #5106 * Prevent DCE on ray trace position fetch Adds dummy usage to the intersection positions fetched from HitTriangleVertexPositions to prevent DCE from removing their usage. Fixes #5105 * Update spirv-tools-generated * More DerivativeGroup*KHR test fixes Add fixes for a missing test intrinsic-derivative-function-in-compute.slang Use the {{NV|KHR}} syntax to tolerate either enum. Fixes #5106 * Squash tabs in closesthit test * HACK test CI * Avoid multiple IncomingRayPayloadKHR storage params * Revert "HACK test CI" This reverts commit c2556ea2baef0bd48e4c86f90cf17dfab80015c1. * Avoid multiple IncomingRayPayloadKHR storage params in anyhit
2024-09-19Support `IDifferentiablePtrType` (#5031)Sai Praveen Bangaru
* initial diff-ref-type interface * Initial support for `IDifferentiablePtrType` * Fix unused vars * More tests + fix switch case fallthrough. * Update slang-ir-autodiff.cpp * Update diff-ptr-type-loop.slang * Add optimization to allow more complex pair types * Update slang-ir-autodiff-primal-hoist.cpp * Update diff-ptr-type-loop.slang * Update slang-ir-autodiff-primal-hoist.cpp * More fixes to address reviews * Update slang-check-expr.cpp * Optimizations + rename `differentiableRefInterfaceType` -> `differentiablePtrInterfaceType` * Move pair logic to ir-builder, unify the type dictionaries. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-09-18Report AD checkpoint contexts (#5058)venkataram-nv
* Transferring source locations when creating phi instructions * Tracking for simple variables * Deriving source locations for loop counters * Printing checkpoint structure breakdown * More readable output format * Special behavior for loop counters * Writing report to file * Add slangc option to enable checkpoint reports * Display types of checkpointed fields * Message in case there are no checkpointing contexts * Catch source locations for function calls * Source cleanup * Fix compilation warnings * Remove stray dump() * Provide the report through diagnostic notes * Add missing path for sourceLoc during unzip pass * Add tests for reporting intermediates * Include more transfer cases for source locations * Fix ordering in address elimination * Fill in more holes with source location transfer * Remove debugging line * Reverting changes to diagnostic sink * Simplify address elimination using source location RAII contexts * Eliminating manual source loc transfers in forward transcription * Fix local var adaptation to use RAII location setter * Simplify primal hoisting logic for source location transfer * Simplify unzipping with RAII location scopes * Simplify transpose logic * Cleaning up for rev.cpp * Reverting spacing changes * Fix mistake with source loc RAII instantiation * Fix formatting issues
2024-09-18Lower the priority of looking up the rank of scope (#5065)kaizhangNV
* Lower the priority of looking up the rank of scope In the previous change of #5060, we propose a way to resolve the ambiguous call when considering the scope of a function. But this rule should be considered as a low priority than "specialized candidate", aka. we should consider more "specialized candiate" first. * Count distance between reference site to declaration site Compare the candidate by calculating distance from reference site to declaration site via nearest common prefix in the scope tree. This will involve finding the common parent node of two child nodes and how sum the distance from the common parent to the two child nodes. * Change the priority higher than 'getOverloadRank' * Don't evaluate the scope rank algorithm on generic If the candidate is generic function, the function parameters won't be checked before 'CompareOverloadCandidates', so it will results in that the candidates this function could be invalid. We should not evaluate the distance algorithm in this case, instead we will evaluate later when the candidate is in flavor of Func or Expr since then all the type checks for the function will be done.
2024-09-18Add `IRWArray` interface, and make StructuredBuffer conform to them. (#5097)Yong He
* Add `IRWArray` interface, and make StructuredBuffer conform to them. * Update user guide. * Fix. * Fixes.
2024-09-17Implement math intrinsics for WGSL (#5078)Jay Kwak
* Implement math intrinsics for WGSL This commit implements math related intrinsics and a few others for WGSL. The implementation is based on the following doc, https://www.w3.org/TR/WGSL slang-test was looking for the downstream compiler for WGSL even though it is not used. This commit adds a minimal change to avoid the crash.
2024-09-11Fix the issue in resolving the overload functions (#5060)kaizhangNV
2024-09-10Disambiguate subscript decls by preferring the one with more accessors. (#5046)Yong He
2024-09-10Specialize existential return types when possible. (#5044)Yong He
* Fix inccorect dropping of declref during Unification of DeclaredSubtypeWitness. * Add extension test. * Specialize existential return types when possible. * Fix. * Fix. * Fix falcor issue.
2024-09-10Fix inccorect dropping of declref during Unification of ↵Yong He
DeclaredSubtypeWitness. (#5041) * Fix inccorect dropping of declref during Unification of DeclaredSubtypeWitness. * Add extension test.
2024-09-09Add load paths to return value check (#5042)venkataram-nv
2024-09-09Fix generic IInteger `mod` implementation. (#5037)Yong He
2024-09-05Initial -embed-spirv support (#4974)cheneym2
* Initial -embed-spirv support Add support for SPIR-V precompilation using the framework established for DXIL. Work on #4883 * SLANG_UNUSED * Add linkage attributes to exported spirv functions * Combine DXIL and SPIRV paths * Whitespace fix * Merge remaining precompiled spirv/dxil paths * Change inst accessors to return codegentarget * Add unit test for precompiled spirv --------- Co-authored-by: Yong He <yonghe@outlook.com>