<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/compute/atomics-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>2024-11-21T07:37:28+00:00</updated>
<entry>
<title>Refresh of disabled WGPU tests (#5614)</title>
<updated>2024-11-21T07:37:28+00:00</updated>
<author>
<name>Anders Leino</name>
<email>aleino@nvidia.com</email>
</author>
<published>2024-11-21T07:37:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=93f5d13fc90c518ef2829dc16c28f0403e230337'/>
<id>urn:sha1:93f5d13fc90c518ef2829dc16c28f0403e230337</id>
<content type='text'>
Some tests are now passing and are enabled.
Other tests are still failing, but are given comments categorizing the failures.

Tests in the 'Not supported in WGSL' category are also removed from the expected failures
list. (Though they are still kept disabled for WebGPU, of course.)

This closes #5519.</content>
</entry>
<entry>
<title>Add WGSL support for slang-test (#5174)</title>
<updated>2024-10-07T17:16:19+00:00</updated>
<author>
<name>Anders Leino</name>
<email>aleino@nvidia.com</email>
</author>
<published>2024-10-07T17:16:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=509409ef11e3b1abd1d7e1bfb540bc172aa1a817'/>
<id>urn:sha1:509409ef11e3b1abd1d7e1bfb540bc172aa1a817</id>
<content type='text'>
* Use the assembly description as target when disassembling

I believe this is a bugfix.
It seems to have worked before because up until the WGSL case, the disassembler has been
the same executable as the one producing the binary to be disassembled.

* Add Tint as a downstream compiler

This closes issue #5104.

* Add downstream compiler for Tint.
 * Tint is wrapped in a shared library, 'slang-tint' available from [1].
 * The header file for slang-tint.dll is added in external/slang-tint-headers.
* Add some boilerplate for WGSL targets.
* Add an entry point test for WGSL.

[1] https://github.com/shader-slang/dawn/releases/tag/slang-tint-0

* Add WGSL_SPIRV as supported target for Glslang

* Add WebGPU support to slang-test

This helps to address issue #5051.

* Disable lots of crashing compute tests for 'wgpu'

This closes issue #5051.

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</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>Metal compute tests (#4292)</title>
<updated>2024-06-07T07:28:16+00:00</updated>
<author>
<name>skallweitNV</name>
<email>64953474+skallweitNV@users.noreply.github.com</email>
</author>
<published>2024-06-07T07:28:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=004fe27a52b7952111ad7e749397aeff499de7ed'/>
<id>urn:sha1:004fe27a52b7952111ad7e749397aeff499de7ed</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Convert more tests to use shader objects (#1659)</title>
<updated>2021-01-15T20:10:06+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2021-01-15T20:10:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=2a5d5b32348c33aac7ca62aa9a4c2bb7cff8e08a'/>
<id>urn:sha1:2a5d5b32348c33aac7ca62aa9a4c2bb7cff8e08a</id>
<content type='text'>
This change converts a large number of our existing tests to use the `ShaderObject` support that was added to the `gfx` layer.

In many cases, tests were just updated to pass `-shaderobj` and the result Just Worked.
In other cases, a `name` attribute had to be added to one or more `TEST_INPUT` lines.

For tests that did not work with shader objects "out of the box," I spent a little bit of time trying to get them work, but fell back to letting those tests run in the older mode.
Future changes to the infrastructure will be needed to get those additional tests working in the new path.

Along with the changes to test files, the following implementation changes were made to get additional tests working:

* Because the shader object mode uses explicit register bindings (from reflection), the hacky logic that was offseting `u` registers for D3D12 based on the number of render targets gets disabled (by another hack).

* The "flat" reflection information coming from Slang was not correctly reporting "binding ranges" for things that consumed only uniform data (which would be everything on CUDA/CPU), so it was refactored to properly include binding ranges for anything where the type of the field/variable implied a binding range should be created (even if the `LayoutResourceKind` was `::Uniform`).

* A few fixes were made to the CUDA implementation of `Renderer`, in order to get additional tests up and running. Most of these changes had to do with texture bindings, which hadn't really been tested previously.

In addition, a few changes were made that were attempts at getting more tests working, but didn't actually help. These could be dropped if requested:

* As a quality-of-life feature (not being used) the `object` style of `TEST_INPUT` line is upgraded to support inferring the type to use from the type of the input being set.

* Any `object` shader input lines get ignored in non-shader-object mode.</content>
</entry>
<entry>
<title>Small improvements around atomics (#1333)</title>
<updated>2020-04-23T18:40:01+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2020-04-23T18:40:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=6f5c250b19b03a8eb4b6a9254613ce8539769a23'/>
<id>urn:sha1:6f5c250b19b03a8eb4b6a9254613ce8539769a23</id>
<content type='text'>
* Use the original value in the test.
Run test on VK.

* Added RWBuffer and Buffer types to C++ prelude.

* Add vk to atomics.slang tests

* Update target-compatibility around atomics.
When tests disabled in atomics-buffer.slang explained why.

* tabs -&gt; spaces.

* Small docs improvement.</content>
</entry>
<entry>
<title>CUDA barrier/atomic support (#1218)</title>
<updated>2020-02-12T14:15:47+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2020-02-12T14:15:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=fe9d27af9de047ea75db1334c961bb025fb732f6'/>
<id>urn:sha1:fe9d27af9de047ea75db1334c961bb025fb732f6</id>
<content type='text'>
* * Improved fastRemoveAt
* Fixed off by one bug
* Fixed const safeness with List&lt;&gt;

* Made List begin and end const safe.

* Revert to previous RefPtr usage.

* Fix bug with casting.

* Tabs -&gt; spaces.
Small fixes/improvements to List.

* Improve comment on List.

* Group shared/atomic test works on CUDA.

* * Enabled CUDA tests for atomics tests
* Enabled DX12 test for atomics-buffer.slang

Not clear just yet how to implement that for CUDA - it will work with StructuredBuffer.

* hasContent -&gt; isNonEmpty

* Remove unneeded comment.
</content>
</entry>
<entry>
<title>Remove support for explicit register/binding syntax on TEST_INPUT (#1132)</title>
<updated>2019-11-21T22:06:19+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2019-11-21T22:06:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=2ea64ff4f2c7c43b72ff24650330fca79a87500f'/>
<id>urn:sha1:2ea64ff4f2c7c43b72ff24650330fca79a87500f</id>
<content type='text'>
The `TEST_INPUT` facility allows textual Slang test cases to provide two kinds of information to the `render-test` tool:

1. Information on what shader inputs exist
2. Information on what values/objects to bind into those shader inputs

Under the first category of information, there exists supporting for attaching a `dxbinding(...)` annotation to a `TEST_INPUT` which seemingly indicates what HLSL `register` the input uses. There is a similar `glbinding(...)` annotation, used for OpenGL and Vulkan.

It turns out that these annotations were, in practice, completely ignored and had no bearing on how `render-test` allocates or bindings graphics API objects. There was some amount of code attempting to validate that explicit registers/bindings were being set appropriately, but the actual values were being ignored.

The visible consequence of the `dxbinding` and `glbinding` annotations being ignored is issue #1036: the order of `TEST_INPUT` lines was *de facto* determining the registers/bindings that were being used by `render-test`.

This change simply removes the placebo features and strips things down to what is implemented in practice: the `TEST_INPUT` lines do not need target-API-specific binding/register numbers, because their order in the file implicitly defines them.

I added logic to the parsing of `TEST_INPUT` lines to make sure I got an error message on any leftover annotations, and went ahead and systematicaly deleted all of the placebo annotations from our test cases.

If we decide to make `TEST_INPUT` lines *not* depend on order of declaration in the future, we can build it up as a new and better considered feature.

The main alternative I considered was to keep the annotations in place, and change `render-test` and the `gfx` abstraction layer to properly respect them, but that path actually creates much more opportunity for breakage (since every single test case would suddenly be specifying its root signature / pipeline layout via a different path using data that has never been tested). The approach in this change has the benefit of giving me high confidence that all the test cases continue to work just as they had before.</content>
</entry>
<entry>
<title>Fix atomic operations on RWBuffer (#593)</title>
<updated>2018-06-06T04:35:48+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-06-06T04:35:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=1a698128c15bce0c05b0664bb1458842e1e55511'/>
<id>urn:sha1:1a698128c15bce0c05b0664bb1458842e1e55511</id>
<content type='text'>
* Fix atomic operations on RWBuffer

An earlier change added support for passing true pointers to `__ref` parameters to fix the global `Interlocked*()` functions when applied to `groupshared` variables or `RWStructureBuffer&lt;T&gt;` elements.
That change didn't apply to `RWBuffer&lt;T&gt;` or `RWTexture2D&lt;T&gt;`, etc. because those types had so far only declared `get` and `set` accessors, but not any `ref` accessors (which return a pointer).

The main fixes here are:

* Add `ref` accessors to the subscript oeprations on the `RW*` resource types

* Adjust the logic for emitting calls to subscript accessors so that we don't get quite as eager about invoking a `ref` accessor, and instead try to invoke just a `get` or `set` accessor when these will suffice. This is important for Vulkan cross-compilation, where we don't yet support the semantics of our `ref` accessors.

* Add a test case for atomics on a `RWBuffer`

* Fix up `render-test` so that we can specify a format for a buffer resource, which allows us to use things other than `*StructuredBuffer` and `*ByteAddressBuffer`. The work there is probably not complete; I just did what I could to get the test working.

* A bunch of files got whitespace edits thanks to the fact that I'm using editorconfig and others on the project seemingly arent...

* fixup: remove ifdefed-out code
</content>
</entry>
</feed>
