summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2025-02-06Support stage_switch. (#6311)Yong He
* Support stage_switch. * Update proposal status. * Fix gl_InstanceID. * Fix.
2025-02-06Don't overwrite existing module decl scopes when parsing new source files ↵Anders Leino
(#6292) When a module consists of multiple source files, the module scope gets over-written for each source file that's parsed into the module. The result is that if you do something like the following, where source1.slang contains an import statement, then the imported module will get imported into the module scope corresponding to source2.slang, but won't be found from the scope of source1.slang. slangc source1.slang source2.slang # 1 module from 2 source files This patch fixes this problem by not over-writing existing container decl scope when parsing new source files into the container. This closes $6221.
2025-02-05Allow tuples to work with initializer list. (#6301)Yong He
* Allow tuples to work with initiailizer list. * Update definition of C-Style types.
2025-02-05maxtessfactor attribute should take a floating point value (#6289)Jay Kwak
* maxtessfactor attribute should take a floating point value * Support integer value on maxtessfactor
2025-02-05Fix DCE for calls to functions that have associations (#6272)Sai Praveen Bangaru
* Fix DCE for calls to functions that have associations * Update slang-ir-util.cpp * Update slang-ir-util.cpp
2025-02-05Use two-stage parsing to disambiguate generic app and comparison. (#6281)Yong He
* Use two-stage parsing to disambiguate generic app and comparison. * Typo fix. * Update doc.
2025-02-05Feature/initialize list side branch (#6058)kaizhangNV
* 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>
2025-02-05Fix autodiff issue for vector<T, N> (#6275)kaizhangNV
* Fix autodiff issue for vector<T, N> Close #6154 We didn't implement correctly for vector<T, N> regarding the differentiablity. As we check differentiable before specialization, however according to the definition of vector, it has to be specialized to IFloat to know it's conformed to IDifferential type. Therefore for parameter type vector<T, N> will become no_diff. Therefore, we change the implementation a to make it explicit conform to IDifferential type. * fix typo
2025-02-04Fix non-square matrix derivatives (#6282)Sai Praveen Bangaru
2025-02-04Fix warning about push constants, shaderRecordEXT (#6269)cheneym2
* 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>
2025-02-03Auto enable `-fvk-use-entrypoint-name` when there is more than one ↵Yong He
entrypoint. (#6260) * Auto enable `-fvk-use-entrypoint-name` when there is more than one entrypoint. * Fix.
2025-02-02Add support for WGSL subgroup operations (#6213)Darren Wihandi
* 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>
2025-01-31Fix build issue when SLANG_EMBED_CORE_MODULE is OFF. (#6243)Yong He
2025-01-31Respect per-target debug options (#6193)Anders Leino
* Base compiler options for targets on target-specific compiler options Before this change, the target compiler options were based on the linkage-wide compiler options, which where later again inherited from (basically a no-op). With this change, the target-specific compiler options are added first, and then the linkage-wide comnpiler options are inherited from. * Remove debug instructions if target-specific setting is NONE This helps to address #6092. * Make sure the linkage debug info level is sufficient for each target This closes #6092.
2025-01-31Distribute slang-glsl-module.bin in release packages. (#6233)Yong He
* Distribute slang-glsl-module.bin in release packages. * Fix. * fix2. * Build glsl modlue into a dll.
2025-01-30[Docs] Auto-diff documentation overhaul (#6202)Sai Praveen Bangaru
* AD: Docs Update * More documentation * More documentation * More docs fixes * Cleanup documentation * More docs polish. Add docs for the [Differentiable] attributes * Fixup code sections * Fixup * Address review comments * regenerate documentation Table of Contents * Update docs with more playground links --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
2025-01-30Declare `VariablePointers` capability when needed. (#6231)Yong He
2025-01-30Add coop-vec insts to non-differentiable insts list (#6227)Sai Praveen Bangaru
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-29Fix loophole in hoisting where an `OpVar`'s uses might not be properly ↵Sai Praveen Bangaru
registered for replacement (#6212) * ix loophole in hoisting where an IRVar's uses might not be properly registered for replacement * fix formatting
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-28Fix geometry shader related modifier lowering. (#6197)Yong He
* Fix geometry shader related modifier lowering. * Cleanup. * Delete obselete test. * Enable geometryShader test on windows only. * Fix test.
2025-01-28Add a unit test to cover type-conformance compilation API. (#6178)Yong He
Co-authored-by: Anders Leino <aleino@nvidia.com>
2025-01-27Properly plumbing layout for global varyings. (#6198)Yong He
* Properly plumbing layout for global varyings. * Fix test.
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