summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2025-01-27Fix an incorrect iteration with a workList (#6177)Jay Kwak
* Fix an incorrect iteration with a workList We cannot modify workList while iterating it, because its type `List` is actually an array container. * Change based on the feedback * Use `Index` instead of `int` for for-loop index --------- Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-24Fix depth texture sampling on Metal. (#6168)Yong He
2025-01-24Add intptr_t abs/min/max operations for CPU & CUDA targets (#6160)Julius Ikkala
* Add intptr_t abs/min/max operations for CPU & CUDA targets * Define intptr_t and uintptr_t with CUDACC_RTC --------- Co-authored-by: Yong He <yonghe@outlook.com>
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-24Fix static build and install (#6158)Dario Mylonopoulos
* Add SLANG_ENABLE_RELEASE_LTO cmake option * Fix cmake static build * Disable install SlangTargets to avoid static build failing
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-22Cache and reuse glsl module. (#6152)Yong He
* Cache and reuse glsl module. * Fix. * Implement record/replay for the new api. * Fix record replay. * Fix test.
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-22Catch all exceptions from loadModule* and link API calls. (#6143)Anders Leino
This closes #5950.
2025-01-21Fix bug: IgnoreInheritance in lookup (#6146)kaizhangNV
* Fix bug: IgnoreInheritance in lookup When specifying IgnoreInheritance in lookup, it will ignore all members in the self extension for generic, the reason is that it doesn't specialize the target type of the extension decl when comparing with self type, so it will result that every type is unequal to the target type.
2025-01-21Fix gcc downstream compiler optimization level corresponding to ↵spking11
OptimizationLevel::Maximal (#6137)
2025-01-21Generate IDs for every witness table (#6129)Julius Ikkala
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-18Fix upper 32 bits of 64-bit AnyValue packing (#6127)Julius Ikkala
2025-01-17Make -depfile work for binary modules output too (#6126)Julius Ikkala
2025-01-17Implement Quad Control intrinsics (#5981)Darren Wihandi
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-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-17Fix nullptr in generic specialization (#6066)Julius Ikkala
* Fix nullptr in generic specialization * Fix formatting * Revert "Fix nullptr in generic specialization" and add emitPtrLit instead * Add type parameter to getPtrValue() --------- Co-authored-by: Yong He <yonghe@outlook.com>
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 resource specialization issue where store insts from inlined calls are ↵Sai Praveen Bangaru
not considered properly. (#6099) * Fix resource specialization issue where stores from inlined calls are not considered. * Format
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-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