<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang/slang-doc-markdown-writer.cpp, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2025-08-07T09:25:42+00:00</updated>
<entry>
<title>Add new _getName to get extension decl names for core module docs (#7985)</title>
<updated>2025-08-07T09:25:42+00:00</updated>
<author>
<name>aidanfnv</name>
<email>aidanf@nvidia.com</email>
</author>
<published>2025-08-07T09:25:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=67a96920674d628f615532a302504544a45e8187'/>
<id>urn:sha1:67a96920674d628f615532a302504544a45e8187</id>
<content type='text'>
Fixes #7479

This adds a new variant of `_getName(ExtensionDecl* decl)` to our
markdown doc writer that takes an ExtensionDecl* and returns the name in
the format `extension &lt;name&gt; : &lt;interface&gt;`.

This is required to display "extension T : ITexelElement" properly in
the core module docs, as the existing `_getName(Decl* decl)` returns an
empty string because the name does not come from the `decl` itself, but
rather its `targetType`.

The target type alone is not enough, as that would return `T`, which
will be erroneously interpreted as the name for the generic parameter,
and the doc system will link every mention of `T` to the extension's
page.

ReadTheDocs already displays the name correctly in the TOC of the docs
there, but that is because it falls back to the page title when the name
in the TOC is empty.

---------

Co-authored-by: slangbot &lt;ellieh+slangbot@nvidia.com&gt;
Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Mediate access to ContainerDecl members (#7242)</title>
<updated>2025-06-09T18:22:51+00:00</updated>
<author>
<name>Theresa Foley</name>
<email>10618364+tangent-vector@users.noreply.github.com</email>
</author>
<published>2025-06-09T18:22:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=bfae49d853e0f9b6f9de495b13bcd1642ca4a285'/>
<id>urn:sha1:bfae49d853e0f9b6f9de495b13bcd1642ca4a285</id>
<content type='text'>
Most of what this change does is straightforward: take all the places in the code that used to operate directly on `ContainerDecl::members` and related fields, and instead have them call into a smaller set of accessor methods defined on `ContainerDecl`.

The primary motivation for making this change is that in order to implement on-demand loading of members from serialized AST modules, we need a way to identify and intercept the "demand" for those members.

On-demand loading benefits from having all accesses to the members of a `ContainerDecl` be as narrow as possible.
If a part of the code only need a member at a specific index, it should say so.
If it only needs access to members with a specific name, or a given subclass of `Decl`, then it should say so.

A secondary motivation for this change is that there have recently been several changes that added complexity and special cases by introducing code that operated on (and *mutated*) the member list of a container decl in ways that the existing code had never done before.

Any code that mutates the member list of a `ContainerDecl` needs to be sure to not disrupt the invariants that the lookup acceleration structures currently rely on.
One of the recent changes added a declaration-to-index map to the set of acceleration structures (with different validation/invalidation behavior than the others...) while other recent changes would remove or insert declarations in ways that could change the indices of other declarations in the same container.
It is not clear if any of these pieces of code were aware of the others, and the invariants that might be expected or broken along the way.

This change bottlenecks the vast majority of accesses to the members of a `ContainerDecl` through the following operations:

* Getting a `List` of all of the direct member declarations of a container

* Get the number of direct member declarations, and accessing them by index.

* Looking up the list of direct member declarations with a given name.

* Adding a new direct member declaration to the end of the list.

Some other operations are layered on top of those (e.g., getting a list of all the direct member declarations of a given C++ class).
These layered operations are still centralized on the `ContainerDecl`, with the intention that we *can* change them to be non-layered implementations if we ever need to for performance (e.g., by building a lookup structure for finding member declarations by their type).

The exceptional cases of access/mutation on the direct members of a `ContainerDecl` have also been encapsulated, but rather than expose what would risk appearing like general-purpose accessors (e.g., `removeDecl(d)`, `setDecl(index)`, etc.), these operations have been explicitly named after the specific use case that they serve in the codebase today, to discourage others from using them for more kinds of operations we'd rather not support.
These operations have also been given parameter signatures that match their use cases, to make it so that even somebody determined to abuse them would have to invent suitable arguments out of thin air.

In the case of the declaration-to-index mapping, this change eliminates that acceleration structure, in favor or slightly more complicated (and possibly inefficient, yes) code at the use site.

Over time, it would be good to closely scrutinize each of the use cases that requires more complicated interaction with the members of a `ContainerDecl`, to see whether any of them can be reframed in terms of the more basic operations, or if there is some clean abstraction we can introduce to make operations that mutate the member list feel like... hacky.</content>
</entry>
<entry>
<title>Do not escape markdown between backticks (#7086)</title>
<updated>2025-05-14T18:30:35+00:00</updated>
<author>
<name>aidanfnv</name>
<email>aidanf@nvidia.com</email>
</author>
<published>2025-05-14T18:30:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=4a3872cd3bbc44036e8acec0ba57233e1eab51e8'/>
<id>urn:sha1:4a3872cd3bbc44036e8acec0ba57233e1eab51e8</id>
<content type='text'>
Fixes shader-slang/shader-slang.github.io#95

The current Standard Modules Reference markdown generator escapes characters in code in the Conditional Conformances sections, which is not necessary, as characters between backticks in markdown are already escaped. On GitHub, the redundant escape slashes are ignored, but on both ReadTheDocs and GitHub Pages the escape slashes are still visible.
This change removes the redundant escaping.</content>
</entry>
<entry>
<title>support specialization constant sized array (#6871)</title>
<updated>2025-05-14T17:11:53+00:00</updated>
<author>
<name>kaizhangNV</name>
<email>149626564+kaizhangNV@users.noreply.github.com</email>
</author>
<published>2025-05-14T17:11:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=375ecfe2903b09f07abeba2eafb88d9a564c1458'/>
<id>urn:sha1:375ecfe2903b09f07abeba2eafb88d9a564c1458</id>
<content type='text'>
Close #6859

Goal of this PR
We want to support an array whose size can be specialization constant for shared/global variable e.g.

layout (constant_id = 0) const uint BLOCK_SIZE = 64;
shared float buf_a[(BLOCK_SIZE + 5) * 4];
Overview of the solution:

During IndexExpr check, we will loose the restriction to allow SpecConst passing, but the size parameter will not be a constant value because it cannot be folded into a constant, so we will make it follow the same logic as generic parameter value, and the size will be represented by FuncCallIntVal/PolynomialIntVal/DeclRefIntVal.

During IR lowering, we will detect whether there is spec constant in the IntVal, and wrap the IRInst with a SpecConstRateType, and propagate the type though the lowering logic, such that the IntVal representing the array size will have SpecConstRateType.

During spirv emit stage, if we detect that a IRInst has SpecConstRateType, we will emit it as SpecConstantOp.

We have to implement new logic to emit OpSpecConstantOp, the existing emit logic doesn't support emitting OpSpecConstantOp, especially this op can embed arithmetic operation at global scope, where we can only emit arithmetic instruct at local. But there are only few instructs we need to support.

Overview of the solution:
This PR doesn't support generic, and we will create a separate PR to extend that, tracked in #6840.</content>
</entry>
<entry>
<title>Restore Properties section name in stdlib reference (#7042)</title>
<updated>2025-05-09T07:55:30+00:00</updated>
<author>
<name>aidanfnv</name>
<email>aidanf@nvidia.com</email>
</author>
<published>2025-05-09T07:55:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=8a542dfffca7633707cb4b5e6ac007c4523778f8'/>
<id>urn:sha1:8a542dfffca7633707cb4b5e6ac007c4523778f8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix broken links in Slang docs (#7039)</title>
<updated>2025-05-08T17:00:49+00:00</updated>
<author>
<name>aidanfnv</name>
<email>aidanf@nvidia.com</email>
</author>
<published>2025-05-08T17:00:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=2b8152110b9a41672dd4dd5f528aa23caa8e88a3'/>
<id>urn:sha1:2b8152110b9a41672dd4dd5f528aa23caa8e88a3</id>
<content type='text'>
This change fixes some broken links/anchors in the Slang docs that I found after running a link checker tool on the readthedocs site.
Some of these were broken on GitHub Pages as well, such as anchors with apostrophes or docs that were moved.

The doc writer change adds an explicit .html extension to Parameter links, so that Sphinx/RTD does not treat it as an anchor.</content>
</entry>
<entry>
<title>Modify markdown writing to produce readthedocs pages (#6904)</title>
<updated>2025-05-01T18:04:50+00:00</updated>
<author>
<name>aidanfnv</name>
<email>aidanf@nvidia.com</email>
</author>
<published>2025-05-01T18:04:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=4dc8a33ce2c4f02cbca451ae43570c1016606b97'/>
<id>urn:sha1:4dc8a33ce2c4f02cbca451ae43570c1016606b97</id>
<content type='text'>
This commit makes multple changes to the slang doc markdown writer to make the stdlib reference pages usable with readthedocs.
- Adds tables of contents at the bottom of every page with children. TOCs contain category landing pages where applicable and contain uncategorized child pages
- Changes links on the pages to use relative paths instead of absolute paths
- Changes anchor tags to use HTML syntax instead of markdown syntax

The overall TOC on readthedocs will look the same as the TOC seen on the existing docs website, and I have verfified that links and anchors will still work.

The tables of contents generated for use on readthedocs would be visible on the existing docs website.
This change wraps the TOCs in a comment block, so that it will be hidden from view.
The readthedocs build script can filter out the comments to unhide the TOC inside and still properly render it there with it remaining hidden when viewed elsewhere.

---------

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Move switch statement bodies to their own lines (#5493)</title>
<updated>2024-11-05T17:47:26+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2024-11-05T17:47:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=b118451e301d734e3e783b3acdf871f3f6ea851c'/>
<id>urn:sha1:b118451e301d734e3e783b3acdf871f3f6ea851c</id>
<content type='text'>
* Move switch statement bodies to their own lines

* format

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>format</title>
<updated>2024-10-29T06:49:26+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2024-10-29T06:49:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21'/>
<id>urn:sha1:f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21</id>
<content type='text'>
* format

* Minor test fixes

* enable checking cpp format in ci</content>
</entry>
<entry>
<title>Replace the word stdlib or standard-library with core-module for source code (#5415)</title>
<updated>2024-10-28T23:40:53+00:00</updated>
<author>
<name>Jay Kwak</name>
<email>82421531+jkwak-work@users.noreply.github.com</email>
</author>
<published>2024-10-28T23:40:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=b7a619b45b0745f166d2dcc5985b994fb1d85d13'/>
<id>urn:sha1:b7a619b45b0745f166d2dcc5985b994fb1d85d13</id>
<content type='text'>
This commit changes the word "stdlib" or "standard library" to "core module" in the source code.</content>
</entry>
</feed>
