<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tools/gfx-util/shader-cursor.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-07-09T06:44:56+00:00</updated>
<entry>
<title>Convert gfx unit tests and examples to use slang-rhi (#7577)</title>
<updated>2025-07-09T06:44:56+00:00</updated>
<author>
<name>Gangzheng Tong</name>
<email>tonggangzheng@gmail.com</email>
</author>
<published>2025-07-09T06:44:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=43d0c2100ef1a5df4b54525e50eb29fe7c39ec16'/>
<id>urn:sha1:43d0c2100ef1a5df4b54525e50eb29fe7c39ec16</id>
<content type='text'>
* Port first gfx unit test to slang-rhi

* port triangle example to use slang-rhi

* port platform-test to slang-rhi

* Update platform-test to throttle mouse move events

* port gpu-printing example to use slang-rhi

* port model-viewer example to use slang-rhi

* port ray-tracing example to use slang-rhi

* port ray-tracing pipeline example to use slang-rhi

* port reflection parameter blocks example to use slang-rhi

* port shader-object example to use slang-rhi

* port shader-toy example to use slang-rhi

* Port most of tests to slang-rhi

* port link-time-constant-array-size to use slang-rhi

* Fix tests and find matching tests in slang-rhi

* port autodiff-texture

* remove gfx target; port nv-aftermath-example

* update include path for shader-cursor.h

* Disabled 2 more ported tests

* fix build error

* remove gfx test

* put slang-rhi (static-lib) before slang (shared)

* format code (#7621)

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

* add debug callback

* format code (#7649)

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

* Address review comments; revert back to use SLANG_CHECK_MSG

---------

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>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>Type layouts for structured buffers with counters (#3269)</title>
<updated>2023-10-17T22:26:00+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2023-10-17T22:26:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=7826afcaad78cc33c976bb3db3cdc9eada4c77e8'/>
<id>urn:sha1:7826afcaad78cc33c976bb3db3cdc9eada4c77e8</id>
<content type='text'>
* More tests for append structured buffer

* Append and Consume structured buffer tests for DX12

* neaten

* test wobble

* Add counter layout information to append/consume structured buffers

* add getRWStructuredBufferType

* Correct definition of get size for append/consume structured buffers

* tweak append structured buffer test

* Allow initializing counter buffer in render test

* vulkan test for consume structured buffer

* Handle null counterVarLayout in getExplicitCounterBindingRangeOffset

* remove dead code

* Implement atomic counter increment/decrement for spirv

* explicit spirv test

* Add missing check on result

* Hold on to counter resources

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>GFX renaming work part 2: slang-gfx.h renames (#2194)</title>
<updated>2022-04-21T19:59:09+00:00</updated>
<author>
<name>lucy96chen</name>
<email>47800040+lucy96chen@users.noreply.github.com</email>
</author>
<published>2022-04-21T19:59:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f493d24c70a6227754296439e97adf35ec412496'/>
<id>urn:sha1:f493d24c70a6227754296439e97adf35ec412496</id>
<content type='text'>
* Fixed all build errors and type conversion warnings from renames in slang-gfx.h

* Made necessary build fixes to the CUDA implementation

* Renamed ITextureResource::Size to ITextureResource::Extents

* More rename changes based on CI errors

* More renames to fix CI build errors

* Rerun tests</content>
</entry>
<entry>
<title>Various Fixes to gfx, reflection and emit. (#1867)</title>
<updated>2021-06-02T23:58:25+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2021-06-02T23:58:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e67af5b1a3993529c702ff2924dea11fd1017d2e'/>
<id>urn:sha1:e67af5b1a3993529c702ff2924dea11fd1017d2e</id>
<content type='text'>
* Various Fixes to gfx, reflection and emit.

- Fix GLSL emit to properly output `*bitsTo*` functions for `IRBitCast` insts.

- Add line directive mode setting for `ISession`.

- Extend `TypeLayout::getElementStride` to handle `VectorType` case.

- Fix `IDevice::readBufferResource` 's D3D12  implementation to copy only the requested bytes out.

- Fix `render-test` to use the `ISession` from `gfx` instead of creating its own `ISession` to make sure `gfx` and `render-test` agree on WitnessTable and RTTI IDs.

- Extend `render-test` to support filling vector and matrix values in the new `set x = ...` TEST_INPUT syntax.

- Add a `dynamic-dispatch-15` test case to make sure packing / unpacking works correctly across all targets, and to make sure render-test's RTTI/WitnessTable ID filling logic is correct for non-trivial cases.

* Remove default-major test

* Fix cyclic reference in `ExtendedTypeLayout`.

* Move `lineDirectiveMode` setting to `TargetDesc`.

Add `structureSize` to `TargetDesc` and `SessionDesc` for future binary compatibility.

* Cleanup.

Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
<entry>
<title>[gfx] Support StructuredBuffer&lt;IInterface&gt;. (#1851)</title>
<updated>2021-05-21T23:38:33+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2021-05-21T23:38:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=7f8a9994d0bd99a171a1daa0bce46d92c02ccffd'/>
<id>urn:sha1:7f8a9994d0bd99a171a1daa0bce46d92c02ccffd</id>
<content type='text'>
Co-authored-by: T. Foley &lt;tfoleyNV@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Refactor D3D12 renderer root signature creation (#1779)</title>
<updated>2021-04-01T23:15:09+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2021-04-01T23:15:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=0ec8e5b016e56ad491a418ab72a5be28dd83f3b4'/>
<id>urn:sha1:0ec8e5b016e56ad491a418ab72a5be28dd83f3b4</id>
<content type='text'>
This change originated as an attempt to re-enable a test case, but it has ended up disabling more tests (for good reasons) than it re-enables.

The main change here is a significant overhaul of the way that the D3D12 render path extracts information from the Slang reflection API to produce a root signature.
There were also some supporting fixes in the reflection information to make sure it returns what the D3D12 back-end needed.

The big picture here is that the D3D12 path now uses the descriptor ranges stored in the reflection data more or less directly.
It still needs to use register/space offset information queried via the "old" reflection API, but it only does so at the top level now, for the program and entry points themselves.
All other layout information is derived directly from what Slang provides.

Smaller changes:

* The "flat" reflection API was expanded to include `getBindingRangeDescriptorRangeCount()` which was clearly missing.

* The "flat" reflection results for a constant buffer or parameter block that didn't contain any uniform data and was mapped to a plain constant buffer needed to be fixed up. That logic is still way to subtle to be trusted.

* Several additional tests were disabled that relied on static specialization, global/entry-point generi type parameters, structured buffers of interfaces or other features we don't officially support with shader objects right now. All of the affected tests were somehow passing by sheer luck and because they often passed in specialization arguments via explicit  `TEST_INPUT` lines.

* The `inteface-shader-param` test is re-enabled now that we can properly describe its input with the new `set` mode on `TEST_INPUT`

* `ShaderCursor::getElement()` can now be used on structure types (in addition to arrays) to support by-index access to fields

* The `TEST_INPUT` system was expanded to support both by-name and by-index setting of structure fields for aggregates

* The `TEST_INPUT` system was expanded to allow an `out` prefix to mark parts of an expression as outputs on a `set` lines

* The `TEST_INPUT` system was expanded so that anything that would be allowed on a `TEST_INPUT` line by itself (like `ubuffer(...)`) can now be used as a sub-expression on a `set` line

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Clean up render-test handling of input (#1766)</title>
<updated>2021-03-25T23:40:17+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2021-03-25T23:40:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=abb020b15c4f1057657e5f8f63c02b15615bf6ec'/>
<id>urn:sha1:abb020b15c4f1057657e5f8f63c02b15615bf6ec</id>
<content type='text'>
The original goal of this change was to streamline the `TEST_INPUT` system by eliminating options that are no longer relevant once we have eliminated the non-shader-object execution paths. The result is more or less a re-implementation/refactor of the logic around how input is parsed and represented, that tries to set things up for a more general sytem going forward.

The main changes isthat the `ShaderInputLayout` no longer tracks a simple flat list of `ShaderInputLayoutEntry` (that is a kind of pseudo-union of the various buffer/texture/value cases), and it instead uses a hierarchical representation composed of `RefObject`-derived classes to represent "values."

There are several "simple" cases of values

* Textures

* Samplers

* Uniform/ordinary data (`uniform`)

* Buffers composed of uniform/ordinary data (`ubuffer`)

Then there are composed/aggregate values that nest other values:

* An *aggregate* value is a set of *fields* which are name/value pairs. It can be used to fill in a structure, for example.

* An *array* value is a list of values for the elements of an array. It can be used to fill out an array-of-textures parameter, for example.

* A combined texture/sampler value is a pair of a texture value and a sampler value (easy enough)

* An *object* holds an optional type name for a shader object to allocate (it defaults to the type that is "under" the current shader cursor when binding), and a nested value that describes how to fill in the contents of that object

Finally there are cases of values that are just syntactic sugar:

* A `cbuffer` is just shorthand for creating an object value with a nested uniform/ordinary data value

The big idea with this recursive structure is that it gives us a way to handle more arbitrary data types with name-based binding. Supporting this new capability requires changes to both how input layouts get parsed, and also how they get bound into shader objects.

On the parsing side, things have been refactored a bit so that parsing isn't a single monolithic routine. The refactor also tries to make it so that the various options on an input item (e.g., the `size=...` option for textures) are only supported on the relevant type of entry (so you can't specify as many useless options that will be ignored).

The bigger change to parsing is that it now supports a hierarchical structure, where certain input elements like `begin_array` can push a new "parent" value onto a stack, and subsequent `TEST_INPUT` lines will be parsed as children of that item until a matching `end` item. This approach means that we can now in principle describe arbitrary hierarchical structures as part of test input without endlessly increasing the complexity of invididual `TEST_INPUT` lines.

On the binding side, we now have a central recursive operation called `assign(ShaderCursor, ShaderInputLayout::ValPtr)` that assigns from a parsed `ShaderInputLayout` value to a particular cursor. That operation can then recurse on the fields/elements/contents of whatever the cursor points to.

Major open directions:

* With this change it is still necessary to use `uniform` entries to set things like individual integers or `float`s and that is a little silly. It would be good to have some streamlines cases for setting individual scalar values.

* Further, once we have a hierarchical representation of the values for `TEST_INPUT` lines, it becomes clear that we really ought to move to a format more like `TEST_INPUT: dstLocation = srcValue;` where `srcValue` is some kind of hierarchial expression grammar. Refactoring things in this way should make the binding logic even more clear and easy to understand. The refactored parser should make parsing hierarchical expressions easier to do in the future (even if it uses the push/pop model for now)

* One detailed note is that the representation of buffers in this change is kind of a compromise. Just as an "object" value is a thin wrapper around a recursively-contained value for its "content" it seems clear that a buffer could be represented as a wrapper around a content value that could include hierarchical aggregates/objects instead of just flat binary data (this would be important for things like a buffer over a structure type that lays out different on different targets). The main problem right now with changing the representation is actually needing to compute the size of a buffer based on its content, so that can/should be addressed in a subsequent change.

Details:

* The base `RenderTestApp` class and the `ShaderObjectRenderTestApp` classes have been merged, since the hierarchy no longer serves any purpose.

* Disabled the tess that rely on `StructuredBuffer&lt;IWhatever&gt;` because they aren't really supported by our current shader object implementation

* Replaced used of `Uniform` and `root_constants` in `TEST_INPUT` lines with just `uniform`

* Removed a bunch of uses of `stride` from `cbuffer` inputs, where it wasn't really correct/meaningful

* Added the `copyBuffer()` operation to VK/D3D renderers, along with some missing `Usage` cases to support it.

* Made `ShaderCursor` handle the logic to look up a name in the entry points of a root shader object, rather than just having that logic in `render-test`. (We probably need to make a clear design choice on this issue)</content>
</entry>
<entry>
<title>Integrate reflection more deeply into gfx layer (#1677)</title>
<updated>2021-01-26T21:32:03+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2021-01-26T21:32:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=a90c850735664e2928e4cc961442a126c6859b97'/>
<id>urn:sha1:a90c850735664e2928e4cc961442a126c6859b97</id>
<content type='text'>
</content>
</entry>
</feed>
