summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-decl.cpp
AgeCommit message (Collapse)Author
2025-02-12Allow LHS of `where` to be any type. (#6333)Yong He
* Allow LHS of `where` to be any type. * Register free-form extensions when loading precompiled module. * Fix test. * Fix. * Fix `as<IRType>`. * try fix precompiled module test.
2025-02-11Add checking for differentiability of the primal substitute function. (#6277)Sai Praveen Bangaru
Co-authored-by: Yong He <yonghe@outlook.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2025-02-10Remove the docs/proposals directory (#6313)Anders Leino
* Remove the docs/proposals directory This directory will get added to the spec repository in the following PR: https://github.com/shader-slang/spec/pull/6 This closes #6155. * Remove entry from .github/CODEOWNERS file * Redirect some proposal references --------- Co-authored-by: Yong He <yonghe@outlook.com>
2025-02-06Support stage_switch. (#6311)Yong He
* Support stage_switch. * Update proposal status. * Fix gl_InstanceID. * Fix.
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-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-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 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-27Properly plumbing layout for global varyings. (#6198)Yong He
* Properly plumbing layout for global varyings. * Fix test.
2025-01-24improve error message on generic value decls (#6169)Darren Wihandi
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-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-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-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.
2024-12-30LanguageServer: fix highlighting of wrapper type. (#5968)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-26Add packed 8bit builtin types (#5939)Darren Wihandi
* Add packed bytes builtin type * fix test
2024-12-20Check subscript/property accessor for differentiability. (#5922)Yong He
2024-12-17Add verification logic on push and specialization constants. (#5887)Yong He
* Add verification logic on push and specialization constants. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-12-11Fix language server check skipping when explicit module decl exists. (#5845)Yong He
2024-12-10Create scope for synthesized property decl. (#5817)Yong He
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-10Don't emit a warning when implicit casting from known in-range int lit to ↵Yong He
half. (#5814) Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-09Allow pointers to existential values. (#5793)Yong He
* Fix pointer offset logic and add executable tests. * Fix. * Fix test. * Add existential ptr test. * Allow pointers to existential values. * Fix. * Fix. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-12-03Fix `SpvExecutionModeOutputLinesEXT`. (#5740)Yong He
2024-11-22[AD] Add support for resolving custom derivatives where generic parameters ↵Sai Praveen Bangaru
can't be automatically inferred (#5630) * [AD] Add support for resolving custom derivatives where generic parameters can't be automatically inferred * Fix failing tests * Update custom-derivative-generic.slang
2024-11-21Add datalayout for constant buffers. (#5608)Yong He
* Add datalayout for constant buffers. * Fixes. * Fix test. * Fix glsl codegen. * Update spirv-specific doc. * Fix test. * Fix binding in the presense of specialization constants. * address comments. * Add a test for constant buffer layout.
2024-11-19Fix specialization constant miscompile in glsl mode. (#5568)Yong He
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
2024-11-15Embed core module in wasm build. (#5569)Yong He
* Embed core module in wasm build. * format code * add uintptr_t case. --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
2024-11-05Move switch statement bodies to their own lines (#5493)Ellie Hermaszewska
* Move switch statement bodies to their own lines * format --------- Co-authored-by: Yong He <yonghe@outlook.com>
2024-11-02Allow enum cases to be used in attribute arguments. (#5478)Yong He
2024-10-31Add function of getting hash string to wasm binding (#5468)kaizhangNV
* [wasm]: Add function to get string from hash * Fix bug on the visibility issue * Formatting
2024-10-29formatEllie Hermaszewska
* format * Minor test fixes * enable checking cpp format in ci
2024-10-28Replace the word stdlib or standard-library with core-module for source code ↵Jay Kwak
(#5415) This commit changes the word "stdlib" or "standard library" to "core module" in the source code.
2024-10-24Fix language server crash. (#5395)Yong He
2024-10-14Misc build fixes. (#5271)Yong He
* Don't use __assume for SLANG_ASSERT + build fixes. * Fix. * build slang-wasm conditionally * Fix. * revert retry open file * revert include. * another attempt of silencing compiler warnings. * revert assume change.
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-06Refactor the code for synthesizing the body of constructor (#5231)kaizhangNV
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-09-26Move texture format inference to frontend and add reflection api for it. (#5155)Yong He
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-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-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-05Support `where` clause and type equality constraint. (#4986)Yong He
* Support `where` clause. * Fix. * Fix parser. * Enhance test to cover traditional __generic syntax. * Update user-guide. * Support `where` clause on associatedtype. * Fix. * Put in more comments.
2024-09-05Respect matrix layout in uniform and in/out parameters for HLSL target. (#5013)Yong He
* Respect matrix layout in uniform and in/out parameters for HLSL target. * Update test. * Fix test. * fix test. * Fix metal layout calculation. * Fix compile error. * Fix compiler error. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2024-09-04Preserve name in DeclRefExpr for correct highlighitng of `This`. (#4980)Yong He
* Preserve name in DeclRefExpr for correct highlighitng of `This`. * Fix test.
2024-09-04Open existential on arguments after overload resolution. (#4982)Yong He
* Open existential on arguments after overload resolution. * Fix. * Update source/slang/slang-check-overload.cpp Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> --------- Co-authored-by: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com>
2024-09-04Fix extension override behavior, and disallow extension on interface types. ↵Yong He
(#4977) * Add a test to ensure extension does not override existing conformance. * Fix doc. * Update documentation. * Fix doc. * Add diagnostic test.