<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/metal/byte-address-buffer.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-09-30T18:21:27+00:00</updated>
<entry>
<title>Enable metal tests (#8446)</title>
<updated>2025-09-30T18:21:27+00:00</updated>
<author>
<name>James Helferty (NVIDIA)</name>
<email>jhelferty@nvidia.com</email>
</author>
<published>2025-09-30T18:21:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=8086adc90b69f3199767c0617e2c429ce6b27f67'/>
<id>urn:sha1:8086adc90b69f3199767c0617e2c429ce6b27f67</id>
<content type='text'>
Enables all tests/metal/ tests that can be easily enabled.

These tests were not originally designed as render tests; they are
generally being enabled for pipecleaning purposes, and will not be
rigorously testing the corresponding funcitonality.

Where they cannot be enabled as render tests, and a metallib test wasn't
already enabled, a metallib test was enabled instead (where possible).

Fixes #7892</content>
</entry>
<entry>
<title>Fix Metal 8-bit vector type names: emit char/uchar instead of int8_t/uint8_t (#8223)</title>
<updated>2025-08-26T18:58:44+00:00</updated>
<author>
<name>Copilot</name>
<email>198982749+Copilot@users.noreply.github.com</email>
</author>
<published>2025-08-26T18:58:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=4e9ee1dc80ce353640c1e2134249a1f93da9229a'/>
<id>urn:sha1:4e9ee1dc80ce353640c1e2134249a1f93da9229a</id>
<content type='text'>
The Metal backend was generating incorrect type names for 8-bit vector
types, causing compilation failures when targeting Metal. According to
the Metal specification, 8-bit vector types should be named `charN` and
`ucharN` (e.g., `char2`, `uchar3`) rather than `int8_tN` and `uint8_tN`.

## Problem

When compiling Slang code with 8-bit vector types for Metal, the
compiler would emit:
```metal
uint8_t2 _S8 = uint8_t2(uint8_t(0U), uint8_t(16U));
int8_t3 _S9 = int8_t3(int8_t(0), int8_t(16), int8_t(48));
```

But the Metal compiler expects:
```metal
uchar2 _S8 = uchar2(uint8_t(0U), uint8_t(16U));
char3 _S9 = char3(int8_t(0), int8_t(16), int8_t(48));
```

This caused errors like:
```
error: unknown type name 'uint8_t2'; did you mean 'uint8_t'?
```

## Solution

Modified `MetalSourceEmitter::emitSimpleTypeImpl()` to emit the correct
Metal-specific type names for 8-bit types:
- `kIROp_Int8Type` now emits `char` instead of `int8_t`
- `kIROp_UInt8Type` now emits `uchar` instead of `uint8_t`

This change only affects the Metal backend and ensures that vector types
like `int8_t2`, `uint8_t3`, etc. are correctly emitted as `char2`,
`uchar3`, etc.

## Testing

- Added a new test case `tests/metal/8bit-vector-types.slang` to verify
the fix
- Re-enabled the previously disabled Metal test in
`tests/hlsl-intrinsic/countbits8.slang`
- Updated `tests/metal/byte-address-buffer.slang` to expect the correct
type names
- Verified that existing Metal tests continue to pass

Fixes #8211.

&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;</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>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>C-like emitter: Add parenthesis when combining relational and bitwise… (#6070)</title>
<updated>2025-01-16T17:23:35+00:00</updated>
<author>
<name>Anders Leino</name>
<email>aleino@nvidia.com</email>
</author>
<published>2025-01-16T17:23:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e771f1945ed692168a2634d66a0907acc9c68858'/>
<id>urn:sha1:e771f1945ed692168a2634d66a0907acc9c68858</id>
<content type='text'>
* C-like emitter: Add redundant parentheses in several cases

This is required since the Dawn WGSL compiler requires parentheses even though precedence
rules could resolve order of operations.

This closes #6005.

* Fix tests/metal/byte-address-buffer

The output now includes parentheses around shift expressions appearing as operands in
bitwise expressions, so update the test accordingly.

* format code

---------

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;
Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>WGSL: Convert signed vector shift amounts to unsigned (#6023)</title>
<updated>2025-01-10T19:05:05+00:00</updated>
<author>
<name>Anders Leino</name>
<email>aleino@nvidia.com</email>
</author>
<published>2025-01-10T19:05:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=803e0c9f9a9dc4b01e29ebbf3b37a5bba782ac83'/>
<id>urn:sha1:803e0c9f9a9dc4b01e29ebbf3b37a5bba782ac83</id>
<content type='text'>
* WGSL: Fixes for signed shift amounts

- Handle the case of vector shift amounts
 - Closes #5985
- Move handling of scalar case from emit to legalization
- Add tests for bitshifts.

* Move the binary operator legalization function to a common place

* Metal: Legalize binary operations

Closes #6029.

* Fix Metal filecheck test

The int shift amounts are now converted to unsigned.

* format code

---------

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;
Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Test more texture types in Metal (#4333)</title>
<updated>2024-06-11T19:30:58+00:00</updated>
<author>
<name>Jay Kwak</name>
<email>82421531+jkwak-work@users.noreply.github.com</email>
</author>
<published>2024-06-11T19:30:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=ef20d9309674dc8c25a9798d95138cf739299928'/>
<id>urn:sha1:ef20d9309674dc8c25a9798d95138cf739299928</id>
<content type='text'>
This commit adds testing for Metal texture functions with the following
six types that the document says supported:
 - float
 - half
 - int32_t
 - uint32_t
 - int16_t
 - uint16_t

Co-authored-by: Yong He &lt;yonghe@outlook.com&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>
</feed>
