<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang/slang-ir-byte-address-legalize.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-09-30T21:13:53+00:00</updated>
<entry>
<title>Handle getEquivalentStructuredBuffer(castDynamicResource) in byte address legalization pass. (#8567)</title>
<updated>2025-09-30T21:13:53+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-09-30T21:13:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=b6422e50cb19f7f790f29678ba22f31b0b305511'/>
<id>urn:sha1:b6422e50cb19f7f790f29678ba22f31b0b305511</id>
<content type='text'>
This is crash that be triggered by providing custom
`getDescriptorFromHandle` and use it to return access a
ByteAddressBuffer from a bindless handle.

Closes #8355.</content>
</entry>
<entry>
<title>Fix Metal invalid as_type cast for 64-bit RWByteAddressBuffer.Store values (#7843)</title>
<updated>2025-07-29T19:12:40+00:00</updated>
<author>
<name>Gangzheng Tong</name>
<email>tonggangzheng@gmail.com</email>
</author>
<published>2025-07-29T19:12:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=48efc60380aa79e8c4aba13976cc2015f38a659e'/>
<id>urn:sha1:48efc60380aa79e8c4aba13976cc2015f38a659e</id>
<content type='text'>
* Fix 64-bit val lowering for metal

* Add ByteAddressBuffer load/store 64-bit tests

* Handle Store/Load ptr types

* Use bitcast for non-pointer typers

* format code (#7966)

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;

---------

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>Add Slang-specific intrinsics for integer pack/unpack (#6459)</title>
<updated>2025-02-28T21:23:29+00:00</updated>
<author>
<name>Darren Wihandi</name>
<email>65404740+fairywreath@users.noreply.github.com</email>
</author>
<published>2025-02-28T21:23:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=efbfa7832afff7e6285713086259abda2456ed55'/>
<id>urn:sha1:efbfa7832afff7e6285713086259abda2456ed55</id>
<content type='text'>
* update hlsl meta

* update test

* use slang syntax in meta file

* improve meta file

* fix pack clamp u8

* remove builtin packed types, use typealias instead

* fix wgsl pack clamp

* fix formatting

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Add packed 8bit builtin types (#5939)</title>
<updated>2024-12-27T07:52:49+00:00</updated>
<author>
<name>Darren Wihandi</name>
<email>65404740+fairywreath@users.noreply.github.com</email>
</author>
<published>2024-12-27T07:52:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=7cecc518e753a90d9b638e8dd1140730ab010ca7'/>
<id>urn:sha1:7cecc518e753a90d9b638e8dd1140730ab010ca7</id>
<content type='text'>
* Add packed bytes builtin type

* fix test</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>Metal: `Interlocked` (atomic) member function support for buffers (#4655)</title>
<updated>2024-07-19T06:05:33+00:00</updated>
<author>
<name>ArielG-NV</name>
<email>159081215+ArielG-NV@users.noreply.github.com</email>
</author>
<published>2024-07-19T06:05:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=a00d603519d395d41b2f68c5874e8a708335a31a'/>
<id>urn:sha1:a00d603519d395d41b2f68c5874e8a708335a31a</id>
<content type='text'>
* Metal: `Interlocked` (atomic) member function support for buffers

fixes: #4654
fixes: #4481

1. Add `Interlocked` (atomic) member function support for buffers to Metal
2. Fix `__getEquivalentStructuredBuffer` so it works with CPP/Metal targets

* add `CompareStore` support

* legalize RWByteAddressBuffer to fully replace StructuredBuffer

* destroy replaced byte-addr buffer

* cleanup as per review and add comment to explain why certain code exists

* fix flow of byte-address-buffer replacement

* toggle on option to translate byteAddrBuffer to StructuredBuffer

* cleanup unused buffers

* add treatGetEquivalentStructuredBufferAsGetThis flag to treat getEquivStructuredBuffer as a byteAddressBuffer

* comment to explain `treatGetEquivalentStructuredBufferAsGetThis`

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Metal: misc fixes and enable more tests. (#4374)</title>
<updated>2024-06-13T23:29:58+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2024-06-13T23:29:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=cfef0c6f66c9d36ae2899c8c2790c3fe422a7700'/>
<id>urn:sha1:cfef0c6f66c9d36ae2899c8c2790c3fe422a7700</id>
<content type='text'>
* Fix and enable tests for metal.

* Fix.

* Fix.

* Fix tests.

* Fix warnings.

* Fix.

---------

Co-authored-by: Yong He &lt;yonghe@Yongs-Mac-mini.local&gt;</content>
</entry>
<entry>
<title>RasterizerOrder resource for spirv and metal. (#4175)</title>
<updated>2024-05-16T17:43:49+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2024-05-16T17:43:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=725735a87b9d223c2afc83bbd049055b1e44a976'/>
<id>urn:sha1:725735a87b9d223c2afc83bbd049055b1e44a976</id>
<content type='text'>
* RasterizerOrder resource for spirv and metal.

Also fixes the byte address buffer logic for metal.

* Fix.

* Delete commented lines.

---------

Co-authored-by: Jay Kwak &lt;82421531+jkwak-work@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Add LoadAligned and StoreAligned methods to ByteAddressBuffers (#4066)</title>
<updated>2024-05-14T06:57:57+00:00</updated>
<author>
<name>Sriram Murali</name>
<email>85252063+sriramm-nv@users.noreply.github.com</email>
</author>
<published>2024-05-14T06:57:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=487ae034e2b03ddd67945132c8fecbd937952705'/>
<id>urn:sha1:487ae034e2b03ddd67945132c8fecbd937952705</id>
<content type='text'>
Fixes #4062

This change enables wide load/stores for byte-address-buffer backed
resources, when the data is accessed at an offset that is aligned.

**Goals**
- Improve performance by issuing wider instructions instead of sequence
  of scalar instructions, for load and stores of byte-address buffers.
- Reduce code-size and readability of the generated shaders.
- Help naive users as well as ninja programmers, generate optimal code.

**Non Goals**
- Help with Structured buffers, or other resources.
- Target compilation time improvements.

**Key changes**
Adds 2 new overloads for Load and Store operations on ByteAddress Buffers.
1. Load / Store with an extra alignment parameter
```
    resource.Load&lt;T&gt;(offset, alignment);
    resource.Store&lt;T&gt;(offset, value, alignment);
```
2. LoadAligned / StoreAligned with no extra parameter, 
   with the same signature as orignial Load / Store.
```
    resource.LoadAligned&lt;T&gt;(offset);
    resource.StoreAligned&lt;T&gt;(offset, value);
```
    - This overload will implicitly identify the alignment value,
    from the base type T of the elementary unit of the resource.

**Supported resources**
1. Vectors
   This can be upto 4 elements, i.e. float -- float4.
2. Arrays
   This does not have a limit on number of elements, but on a
   conservative estimate, we can limit to few hundreds.
3. Structures
   This is used to group a resource of a single type. 
```
 struct {
    float4 x;
 }
```
**Code updates**
- Modified byte-address-ir legalize to handle struct, array and vector
  kinds of load or store access
- Added custom hlsl stdlib functions to implement all the overloads for Load,
  Store etc.
- Added C-like emitter, SPIR-V emitter for handling ByteAddressBuffers.
- Added a new core stdlib function intrinsic to wrap around alignOf&lt;T&gt;().
- Added a new peephole optimization entry to identify the equivalent
  IntLiteral value from the alignOf&lt;T&gt;() inst.
- Added tests to check explicit, and implicit aligned Load and Store
  operations.
</content>
</entry>
</feed>
