<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang/slang-ir-legalize-image-subscript.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>2024-11-05T17:47:26+00:00</updated>
<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>Implement non member function atomic texture support (#4544)</title>
<updated>2024-07-10T20:25:51+00:00</updated>
<author>
<name>ArielG-NV</name>
<email>159081215+ArielG-NV@users.noreply.github.com</email>
</author>
<published>2024-07-10T20:25:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=ff9437e6c926c1e7c6a0ebe66592b46dbb3fb36b'/>
<id>urn:sha1:ff9437e6c926c1e7c6a0ebe66592b46dbb3fb36b</id>
<content type='text'>
* Implement non member function atomic texture support texture_buffer and texture1d

Fixes: #4538
Related to: #4291, fixes `tests/compute/atomics-buffer.slang`

Texture objects cannot use `__getMetalAtomicRef` to cast objects into atomic value type. [Texture objects mandate use of member functions](https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf#Texture%20Functions). The implementation is as follows:
* We can detect texture object usage through checking for an `IRImageSubscript` Operation. `__isTextureAccess()` was added to evaluate if we have an `IRImageSubscript` operation at compile time (before `static_assert`). `__isTextureAccess()` only checks if we are targeting Metal.
* We have all parameter data needed to call a texture atomic function embedded inside `IRImageSubscript`. `__extractTextureFromTextureAccess()` and `__extractCoordFromTextureAccess()` was added to extract this data for use with Metal atomics.

Note:
* Metal documentation has various incorrect details (function names)
* Since we currently hardcode metal versions for compiling, the Metal compiler version was changed to target `Metal 3.1` (`slang-gcc-compiler-util.cpp`)
* textures do not permit atomic float operations

* add fallthrough attribute + fix bug with 'exchange instead of xor' + fix warning bug

* incorrect function name fix

* missing filecheck

* disable atomics-buffer.slang compute test since GFX issue causing it to fail

* Array support for metal interlockedAtomic and proper verification of texture with interlockedAtomic functions

* Array support for metal interlockedAtomic
* proper verification of texture with interlockedAtomic functions
note: had to seperate many functions to allow forceInlining to run

* missing getOperand(0)

* push atomic fix for metal

* fix atomic syntax for metal and hlsl emitting extra brackets (breaks tests)

* test changes and meta changes

1. max is 8 rw textures with metal because Metal has this limit. Split up tests to not hit this limit
2. added back `[0]`...,`T` to test since this legalizes metal atomic intrinsic

* macro'ify some of the atomic code

1. addresses review
2. makes code easier to modify in the future (rather than sifting through 1000 lines we can just look at ~10-30

* fix test 'check'

* missing float support due to macro

* add functions macro generates, `InternalAtomicOperationInfo`

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Expand upon existing `ImageSubscript` support (Metal, GLSL, SPIRV) (#4408)</title>
<updated>2024-06-26T13:37:18+00:00</updated>
<author>
<name>ArielG-NV</name>
<email>159081215+ArielG-NV@users.noreply.github.com</email>
</author>
<published>2024-06-26T13:37:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e1d0ef2002d7b0f459cf689ec1f8e37c4ff2afba'/>
<id>urn:sha1:e1d0ef2002d7b0f459cf689ec1f8e37c4ff2afba</id>
<content type='text'>
* Add additional `ImageSubscript` features:

1. Added ImageSubscript support for Metal &amp; a test case
    * Merge GLSL/SPIRV/Metal `ImageSubscript` legalization pass
2. Added multisample support to glsl/spirv/metal for when using ImageSubscript
    * Added in this PR since the overhaul of the code merges together GLSL/SPIRV/Metal implementation
3. Fixed minor metal texture `Load`/`Read` bugs
    * [HLSL methods of access do not support subscript accessor for texture cube array](https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/texturecubearray)
    * removed swizzling of uint/int/float
    * other odd bugs which were causing compile errors

note: Compute tests do not work due to what seems to be the GFX backend (causes crash without error report). The tests are disabled.

* disable LOD with texture 1d

seems that LOD for 1d textures need to be a compile time constant as per an error metal throws

* syntax error in hlsl.meta

* static_assert alone with intrinsic_asm error

provides cleaner errors
Note: `static_assert` seems to be unstable and not be fully respected (still require `intrinsic_asm` to avoid a stdlib compile error)

* change comment to `// lod is not supported for 1D texture

* add `static_assert` in related code gen paths

* address review

* address review

* add asserts as per review comment, NOTE: unclear if these should be release 'asserts' as well</content>
</entry>
</feed>
