summaryrefslogtreecommitdiffstats
path: root/docs/user-guide/03-convenience-features.md
Commit message (Collapse)AuthorAge
* Add legalization for 0-sized arrays. (#7327)Yong He2025-06-04
| | | | | | | | | | | | | | | * Add legalization for 0-sized arrays. * Allow 0-sized arrays in the front-end. * More tests. * Add `Conditional<T, hasValue>` type to core module. * Update toc. * Fix wording. * Update test.
* fix doc's website table & grammer (#7268)ArielG-NV2025-05-28
| | | | github pages reqire new-line to render table correctly. Grammer problem.
* Change default descriptor binding to be VkMutable (#7224)ArielG-NV2025-05-28
| | | * change default descriptor binding to be VkMutable
* Implement throw & catch statements (#6916)Julius Ikkala2025-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement throw statement It already existed in the IR, so only parsing, checking and lowering was missing. * Initial catch implementation Likely very broken. * Error out when catch() isn't last in scope * Prevent accessing variables from scope preceding catch As those may actually not be available at that point. * Add IError and use it in Result type lowering * Add diagnostic tests * Allow caught throws in non-throw functions * Fix catch propagating between functions & SPIR-V merge issue * Add test for non-trivial error types * Fix MSVC build * Fix invalid value type from Result lowering * Also lower error handling in templates * Lower result types only after specialization * Attempt to disambiguate error enums by witness table * Revert matching by witness, types should be distinct too * Don't assert valueField when getting Result's error value It may not exist if the function returns void, but getting the error value is still legitimate. * Update tests for new error numbers & get rid of expected.txt * Change catch lowering to resemble breaking a loop ... To make SPIR-V happy. * Fix dead catch blocks and invalid cached dominator tree * More SPIR-V adjustment * Lower catch as two nested loops * Add defer interaction test and revert broken defer changes * Fix enum type when throwing literals * Cleanup and bikeshedding * Document error handling mechanism * Fix table of contents * Use boolean tag in Result<T, E> * Use anyValue storage for Result<T,E> * Remove IError * Fix formatting * Eradicate success values from docs and tests * Use parseModernParamDecl for catch parameter * Implement do-catch syntax * Implement catch-all * Fix formatting * Fix marshalling native calls that throw --------- Co-authored-by: Yong He <yonghe@outlook.com>
* adjust docs as per review (#7168)ArielG-NV2025-05-22
|
* Fix correct bindings for bindless resource model [SPIRV and GLSL] (#7131)ArielG-NV2025-05-16
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix correct bindings for bindless resource model [spirv and glsl] fixes: #6952 Problem: * Currently all bindless objects are placed in the same set (fine) and same binding (incorrect behavior for vulkan). This is incorrect since as per [spec](https://registry.khronos.org/vulkan/specs/latest/man/html/VkDescriptorType.html), only 1 resource type may be written to each index inside a set (these rules are loosened with VK_EXT_mutable_descriptor_type) * This means currently generated bindings do not work in practice if we (for example) use `Sampler2D.Handle` and `Texture1D.Handle` in a shader since we would place 2 incompatible objects in the same binding-index and set. Solution: * `__getDynamicResourceHeap` was modified to allow bindings to chosen dynamically for a descriptor * use `IOpaqueDescriptor` to check compile-time information of resource types so that we can identify different resources * Using this information of `IOpaqueDescriptor`, we modify `defaultGetDescriptorFromHandle` to provide a binding model (1 resource per binding-index) which produces legal spirv/glsl. * To support `VK_EXT_mutable_descriptor_type` the function `defaultGetDescriptorFromHandle` has a set of options (`BindlessDescriptorOptions`) for a user to pick-from to support their binding model. Capabilities are not used here for flexibility purposes (specifically old shaders mixed with modern vulkan extensions). Other changes: * Added `TexelBuffer` DescriptorKind to aid in generating correct bindings * format code * Add to docs bindless changes, make AccelerationStructure use its handle directly, adjust tests accordingly --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
* Add `IOpaqueDescriptor::descriptorAccess`. (#6967)Yong He2025-04-30
| | | | | | | * Add `IOpaqueHandle::descriptorAccess`. * Update doc. * fix.
* Fix user-guide typos (#6789)Gangzheng Tong2025-04-11
| | | | | | | | | | * Fix user-guide typos Use LLM to scan each of the markdown files to fix typos. Try not to change anything but the typos in this CL. * typo not caught by LLM * add output of ./build_toc.ps1
* Fix inaccurate documentation in member function mutability. (#6065)Entropy Lost2025-01-14
| | | | | | | | | * Fix inaccurate documentation in member function mutability. * Change throw to result in for specificity. --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Initial implementation of SP#015 `DescriptorHandle<T>`. (#6028)Yong He2025-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* docs: Reduce typo count (#5671)Bruce Mitchener2024-11-29
| | | Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
* [Docs] Optional<T> - fix small typo on example (#5637)Ica2024-11-21
| | | Co-authored-by: Yong He <yonghe@outlook.com>
* [Docs] Extensions - better wording for c# equivalent (#5636)Ica2024-11-21
| | | | | slang extensions look pretty same c# extension methods, not partial classes. Partial classes allow extending types to introduce more variables unlike slang extensions. Also c# users that use extension methods much more than partial types, probably. Co-authored-by: Yong He <yonghe@outlook.com>
* Remove text on inheritance support in user-guide. (#5154)Yong He2024-09-25
|
* Add functor syntax support. (#4926)Yong He2024-08-27
|
* Tuple swizzling, concat, comparison and `countof`. (#4856)Yong He2024-08-19
| | | | | | | | | | | * Tuple swizzling and element access. * Update proposal status. * Cleanup. * Fix merrge error. * Address review.
* Move if_let syntax to convenience-features section (#4628)kaizhangNV2024-07-15
| | | | | | | | | | | * Move if_let syntax to convenience-features section * Fix the syntax for setting up an anchor * update the comment on sample code * Add example for if_let syntax * Address the comments
* Add user guide section on user-defined attributes. (#4557)Yong He2024-07-10
| | | | | * Add user guide section on user-defined attributes. * Update toc
* Update document regarding pointer (#4248)Jay Kwak2024-05-30
| | | And also add an actual test case from the User Guide example.
* Fix pointer example (#4224)cheneym22024-05-24
| | | | | | | * Fix pointer example Make the example shown for pointers something that would compile. Don't redefine pNext and do define MyType. * Fix formatting of struct in pointer example
* Update 03-convenience-features.md (#4179)ArielG-NV2024-05-16
| | | add member init expr and constructor logic to the docs
* Slang: update pointer related documentation (#4088)cheneym22024-05-02
| | | | | | | | | Slang does have some support for pointers. Remove an outdated comment stating the contratry, and update the section that describes pointer support to also list some relevant limitations. Fixes #3970 Co-authored-by: Yong He <yonghe@outlook.com>
* Documentation: fix typos and grammar (#3945)bprb2024-04-13
|
* Support arrow operator `->` on pointers. (#3812)Yong He2024-03-21
|
* Add user-guide section on pointers. (#3670)Yong He2024-03-04
|
* Add documentation on capability system. (#3549)Yong He2024-02-05
| | | Fixes #3454.
* Add doc for special scoping syntax. (#3416)Yong He2023-12-15
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Polish language server and documentation. (#3410)Yong He2023-12-13
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Diagnose for invalid decl nesting + namespace lookup fixes. (#3397)Yong He2023-12-11
| | | | | | | | | | | | | | | | | | | | | | | * Diagnose for invalid decl nesting. * Fix. * Fix. * Fix. * Fix `namespace` lookup and `using` resolution. * fix project files. * revert project files. * Enhance namespace syntax, docs. * Fixes. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Change default visibility of interface members and update docs. (#3381)Yong He2023-12-06
| | | | | | | | | * Update behavior around interfaces and docs. * Update toc --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Fix typo of `i` in default initialization in docs.jsmall-nvidia2023-06-23
|
* Update 03-convenience-features.mdjsmall-nvidia2023-06-23
|
* Update 03-convenience-features.mdYong He2023-05-04
|
* Update documentation on new features (#2508)Yong He2022-11-10
| | | | | | | * Update documentation on new features * Fix. Co-authored-by: Yong He <yhe@nvidia.com>
* Hotfix/doc typo5 (#2070)jsmall-nvidia2021-12-22
| | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * Fix typos in introduction and conventional features. * Struct inheritance is allowed. Fix some typos.
* Update gfx getting started doc (#1832)Yong He2021-05-04
|
* Add layout front matter specifier for user-guide docs (#1770)Yong He2021-03-30
|
* Fix typo in user guide.Yong He2021-02-17
|
* Further documentation on Slang specific features (#1716)Yong He2021-02-17
| | | Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
* Add associated type and generic value parameter doc section (#1706)Yong He2021-02-12
| | | | | * Add associated type and generic value parameter doc section * Typos and corrections.
* Further documentation work (#1703)Tim Foley2021-02-12
* Move around the conventional/convenience features chapters * Add a first draft of a section on compilation using `slangc` and the COM-lite API Co-authored-by: Yong He <yonghe@outlook.com>