<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/compute/byte-address-buffer-align-error.slang, 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-05T12:34:18+00:00</updated>
<entry>
<title>Enable compute/ dir which passes (#7991)</title>
<updated>2025-08-05T12:34:18+00:00</updated>
<author>
<name>Harsh Aggarwal (NVIDIA)</name>
<email>haaggarwal@nvidia.com</email>
</author>
<published>2025-08-05T12:34:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=9a16700e858fc0379e551ab72188eb63a54ad3f1'/>
<id>urn:sha1:9a16700e858fc0379e551ab72188eb63a54ad3f1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix HLSL ByteAddressBuffer Load* parameter integer type (#7117)</title>
<updated>2025-05-16T17:42:59+00:00</updated>
<author>
<name>Darren Wihandi</name>
<email>65404740+fairywreath@users.noreply.github.com</email>
</author>
<published>2025-05-16T17:42:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=8683b85c0494db99feb08b6efcdc26dfe006729f'/>
<id>urn:sha1:8683b85c0494db99feb08b6efcdc26dfe006729f</id>
<content type='text'>
* Fix HLSL ByteAddressBuffer Load* parameter integer type

* Fix tests

* Fix load with alignment function signature clash

* Fix LoadAligned tests</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>
