<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/docs/user-guide, 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-10-16T18:23:13+00:00</updated>
<entry>
<title>Fix use of variadic generics with [Differentiable]. (#8736)</title>
<updated>2025-10-16T18:23:13+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-10-16T18:23:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=bedc3421c9e1e0837fa69e30396a27a60f0fee53'/>
<id>urn:sha1:bedc3421c9e1e0837fa69e30396a27a60f0fee53</id>
<content type='text'>
There was a bug that causes the compiler failing to treat a `no_diff
TypePack` as a type pack, and thus diagnose an error when resolving the
following call.

The fix is to unwrap any ModifiedType wrappers in `IsTypePack()` check.</content>
</entry>
<entry>
<title>Use loadModuleFromSourceString in specialization example snippet (#8616)</title>
<updated>2025-10-07T00:29:05+00:00</updated>
<author>
<name>aidanfnv</name>
<email>aidanf@nvidia.com</email>
</author>
<published>2025-10-07T00:29:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=9f9d28c1f496132dc71b80252b0eeddfa28cc8bc'/>
<id>urn:sha1:9f9d28c1f496132dc71b80252b0eeddfa28cc8bc</id>
<content type='text'>
Fixes #8221

This modifies the code snippet used to demonstrate link-time
specialization to use the public `loadModuleFromSourceString` API
instead of the internal `UnownedRawBlob::create`.
It also corrects a couple variable names in the snippet as well.</content>
</entry>
<entry>
<title>Minor Documentation Update to Remove Outdated Section (#8606)</title>
<updated>2025-10-07T00:25:43+00:00</updated>
<author>
<name>Xiang Hong</name>
<email>hx.hongxiang@gmail.com</email>
</author>
<published>2025-10-07T00:25:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e23b5fa997c9032ee21d58da8c7023fc16795286'/>
<id>urn:sha1:e23b5fa997c9032ee21d58da8c7023fc16795286</id>
<content type='text'>
As mentioned in #8316 , there is a small duplicated and outdated section
in WGSL-Specific Functionalities documentation about specialization
constants support,
remove the outdated duplicated one
&lt;img width="893" height="146" alt="image"
src="https://github.com/user-attachments/assets/abcd7521-645b-4bd6-b926-ce2d978775bd"
/&gt;
as there is a new section in the page
&lt;img width="851" height="319" alt="image"
src="https://github.com/user-attachments/assets/f52e5230-812b-4b29-88f4-bfff890f37ed"
/&gt;

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Use symbol alias instead of wrapper synthesis to implement link-time types. (#8603)</title>
<updated>2025-10-07T00:21:37+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-10-07T00:21:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=6af3381f47e3c22e1657c0e0064fa466e8bde0f6'/>
<id>urn:sha1:6af3381f47e3c22e1657c0e0064fa466e8bde0f6</id>
<content type='text'>
This change achieves link-time type resolution with a different
mechanism.

For `extern struct Foo : IFoo = FooImpl;`,
instead of synthesizing a wrapper type `Foo` that has a `FooImpl inner`
field and dispatches all interface method calls to `inner.method()`,
this PR completely removes this synthesis step, and instead just lower
such `extern`/`export` types as `IRSymbolAlias` instructions that is
just a reference to the type being wrapped.

Then we extend the linker logic to clone the referenced symbol instead
of the SymbolAlias insts itself during linking.

By doing so, we greatly simply the logic need to support link-time
types, and achieves higher robustness by not having to deal with many
AST synthesis scenarios.

Closes #8554.

---------

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Enhance buffer load specialization pass to specialize past field extracts. (#8547)</title>
<updated>2025-10-01T02:08:23+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-10-01T02:08:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e4611e2e30a3e5969d402f5ed7e72706a0e3b024'/>
<id>urn:sha1:e4611e2e30a3e5969d402f5ed7e72706a0e3b024</id>
<content type='text'>
This allows us to specialize functions whose argument is a sub element
of a constant buffer, instead of being only applicable to entire buffer
element. Closes #8421.

This change also implements a proper heuristic to determine when to
specialize the calls and defer the buffer loads.

This PR addresses a pathological case exposed in
`slangpy\slangpy\benchmarks\test_benchmark_tensor.py`, which used to
take 27ms to finish, and now takes 1.25ms.


For example, given:
```
struct Bottom
{
    float bigArray[1024];

    [mutating]
    void setVal(int index, float value) { bigArray[index] = value; }
}

struct Root
{
    Bottom top[2];
    [mutating]
    void setTopVal(int x, int y, float value)
    {
        top[x].setVal(y, value);
    }
}

RWStructuredBuffer&lt;Root&gt; sb;

[shader("compute")]
[numthreads(1, 1, 1)]
void compute_main(uint3 tid: SV_DispatchThreadID)
{
    sb[0].setTopVal(1, 2, 100.0f);
}
```

We are now able to specialize the call to `setTopVal` into:
```
void compute_main(uint3 tid: SV_DispatchThreadID)
{
    setTopVal_specialized(0, 1, 2, 100.0f);
}

void setTopVal_specialized(int sbIdx, int x, int y, float value)
{
      Bottom_setVal_specialized(sbIdx, x, y, value);
}

void Bottom_setVal_specialized(int sbIdx, int x, int y, float value)
{
     sb[sbIdx].top[x].bigArray[y] = value;
}
```

And get rid of all unnecessary loads. Achieving this requires a
combination of function call specialization and buffer-load-defer pass.
The buffer-load-defer pass has been completely rewritten to be more
correct and avoid introducing redundant loads.

This PR also adds tests to make sure pointers, bindless handles, and
loads from structured buffer or constant buffers works as expected.</content>
</entry>
<entry>
<title>Relax restriction on using link-time types for shader parameters. (#8387)</title>
<updated>2025-09-06T05:37:34+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-09-06T05:37:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=bc6b82666fa4deda932c36cea93ee2059e0992b2'/>
<id>urn:sha1:bc6b82666fa4deda932c36cea93ee2059e0992b2</id>
<content type='text'>
This change relaxes a previous restriction on link-time types and
constants, so that we now allow them to be used to define shader
parameters.

Doing so will result in a parameter layout that is incomplete prior to
linking. The PR added a test to call the reflection API on a fully
linked program and ensure that we can report correct binding info.</content>
</entry>
<entry>
<title>Remove ForceUnroll attribute from link-time specialization documentation (#8225)</title>
<updated>2025-09-01T06:51:31+00:00</updated>
<author>
<name>Copilot</name>
<email>198982749+Copilot@users.noreply.github.com</email>
</author>
<published>2025-09-01T06:51:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=b46f46c5e8603fdafca258028227adf25f95807f'/>
<id>urn:sha1:b46f46c5e8603fdafca258028227adf25f95807f</id>
<content type='text'>
The link-time specialization documentation contained an incorrect
example that used `[ForceUnroll]` with a link-time type method call,
which would cause a compilation error. The issue was that
`[ForceUnroll]` requires loop bounds to be known at compile time, but
`sampler.getSampleCount()` is a method call that returns a value at
runtime.

**Problem:**
The documentation example showed:
```csharp
Sampler sampler;
[ForceUnroll]
for (int i = 0; i &lt; sampler.getSampleCount(); i++)
    output[tid] += sampler.sample(i);
```

This would fail with error: `loop does not terminate within the limited
number of iterations, unrolling is aborted.`

**Solution:**
Removed the `[ForceUnroll]` attribute entirely, leaving a simple loop:
```csharp
Sampler sampler;
for (int i = 0; i &lt; sampler.getSampleCount(); i++)
    output[tid] += sampler.sample(i);
```

Since the loop bounds come from a runtime method call, there's no way
for the loop to be unrolled regardless of the directive used, so the
simplest solution is to remove the unroll attribute completely.

- [x] Remove ForceUnroll attribute from documentation example
- [x] Remove explanatory note about unroll vs ForceUnroll
- [x] Remove test cases for the removed functionality
- [x] Fix missing closing backticks in code block

Fixes #8161.

&lt;!-- START COPILOT CODING AGENT TIPS --&gt;
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] &lt;198982749+Copilot@users.noreply.github.com&gt;
Co-authored-by: bmillsNV &lt;163073245+bmillsNV@users.noreply.github.com&gt;
Co-authored-by: expipiplus1 &lt;857308+expipiplus1@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Introduce CDataLayout &amp; -fvk-use-c-layout (#8136)</title>
<updated>2025-08-21T05:47:18+00:00</updated>
<author>
<name>Julius Ikkala</name>
<email>julius.ikkala@gmail.com</email>
</author>
<published>2025-08-21T05:47:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=35f8e092f2aa3ed5e3cf03387e712f798ff4850e'/>
<id>urn:sha1:35f8e092f2aa3ed5e3cf03387e712f798ff4850e</id>
<content type='text'>
Closes #8112. ~~The issue asks for a "C layout", but in this PR I use
the term "CPU layout" because this naming was pre-existing in the
codebase as `kCPULayoutRulesImpl_`. The primary purpose of this layout
is to match CPU-side struct definitions with the shader side. I'm open
to better naming suggestions, though.~~

Edit: switched back to using `CDataLayout` &amp; `-fvk-use-c-layout`, as the
CPU target depends on the object layout rules of existing CPU layout
rules, but they're incompatible with actual shaders. So a new
`kCLayoutRulesImpl_` was needed anyway.

---------

Co-authored-by: Ellie Hermaszewska &lt;ellieh@nvidia.com&gt;</content>
</entry>
<entry>
<title>Implement SV_VulkanSamplePosition (#8236)</title>
<updated>2025-08-21T00:30:44+00:00</updated>
<author>
<name>davli-nv</name>
<email>davli@nvidia.com</email>
</author>
<published>2025-08-21T00:30:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=05f0f5603561daed2c134e13bc64649362759968'/>
<id>urn:sha1:05f0f5603561daed2c134e13bc64649362759968</id>
<content type='text'>
-Adds semantic SV_VulkanSamplePosition that emits corresponding
gl_SamplePosition and SpvBuiltinSamplePosition
-Adds gl_SamplePosition property to glsl.meta.slang
-Adds SPIRV and GLSL tests for the semantic and property
-Plan is to later implement SV_SamplePosition that follows HLSL range of
-0.5 to +0.5,
and emits GetRenderTargetSamplePosition(SV_SampleIndex) which needs more
complicated IR manipulation for HLSL and Metal

Fixes #7906

---------

Co-authored-by: ArielG-NV &lt;159081215+ArielG-NV@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Add multiple slang installations note to doc (#8231)</title>
<updated>2025-08-19T22:52:14+00:00</updated>
<author>
<name>Gangzheng Tong</name>
<email>tonggangzheng@gmail.com</email>
</author>
<published>2025-08-19T22:52:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=785548a49538a8dfc1ee5d7e650b27c5607e43c1'/>
<id>urn:sha1:785548a49538a8dfc1ee5d7e650b27c5607e43c1</id>
<content type='text'>
Added a note section under the Installation section that warns users
about potential conflicts when multiple Slang installations are present
on the system. The note specifically addresses:
* The scenario where Slang from Vulkan SDK might conflict with a
standalone installation
* How LD_LIBRARY_PATH on Linux overrides the RUNPATH in the slangc
executable

Closes https://github.com/shader-slang/slang/issues/7405</content>
</entry>
</feed>
