summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2025-01-15Fix argument buffer tier2 layout computation. (#6101)Yong He
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-15Emit errors when seeing a matrix with row/col count of 1 (#6044)Anders Leino
Such matrices aren't well supported except by D3D targets. Therefore, generate an error rather than outputting invalid code for non-D3D targets. This closes #5987. Co-authored-by: Yong He <yonghe@outlook.com>
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-15Reuse code for Metal and WGSL entry point legalization (#6063)Darren Wihandi
* Refactor to reuse common for metal and wgsl entry point legalization * refactor system val work item * refactor simplify user names * clean up fix semantic field of struct * improve code layout * split wgsl/metal to seperate classes and cleanup * remove extra includes * remove dead code comments * minor cleanup * squash merge from master and resolve conflict * apply metal spec const thread count changes * Revert "apply metal spec const thread count changes" This reverts commit c42d707fd25ee0328598650d3235cd2322810ccc. * Revert "squash merge from master and resolve conflict" This reverts commit 06db88ef7001bdfe93fb23af35af0d026b255dee. * Merge remote-tracking branch 'origin/master' * apply metal spec const thread count changes * Revert "apply metal spec const thread count changes" This reverts commit 3b9e6f53cee2e6076ac2b7a0d015a1ed2cbbd627. * Revert "Merge remote-tracking branch 'origin/master'" This reverts commit 99869d573a46dadeb24445405f5a1e37a8e03d0d. * apply metal spec const thread count changes --------- 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-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 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 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-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-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-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-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-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-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-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
2024-12-30LanguageServer: fix highlighting of wrapper type. (#5968)Yong He
2024-12-30Add `RaytracingAccelerationStructure::__init(uint64_t)`. (#5967)Yong He
2024-12-30Check mismatching method parameter direction against interface declaration. ↵Yong He
(#5964)
2024-12-30Fix requirement candidate lookup to prefer decls in the same paraent as the ↵Yong He
inheritance decl. (#5965)
2024-12-30Skip uninitialized-use warning on hitAttributeEXT-decorated globals (#5952)Julius Ikkala
2024-12-29Prevent constant folding for specialization constants (#5953)Julius Ikkala