<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/pipeline/ray-tracing/trace-ray-inline.slang.glsl, 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>2023-08-22T00:07:34+00:00</updated>
<entry>
<title>Compile append and consume structured buffers to glsl. (#3142)</title>
<updated>2023-08-22T00:07:34+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-08-22T00:07:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=bd6dbaf7c3ea720b4ed39904fe08878f9dcbd947'/>
<id>urn:sha1:bd6dbaf7c3ea720b4ed39904fe08878f9dcbd947</id>
<content type='text'>
* Compile append and consume structured buffers to glsl.

* Fix.

* Update CI config.

---------

Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
<entry>
<title>Fixes for Shader Execution Reordering on VK (#2929)</title>
<updated>2023-06-13T21:40:02+00:00</updated>
<author>
<name>Theresa Foley</name>
<email>10618364+tangent-vector@users.noreply.github.com</email>
</author>
<published>2023-06-13T21:40:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f161686e8e260a4b0e6e0a773cf1cf16069f41bf'/>
<id>urn:sha1:f161686e8e260a4b0e6e0a773cf1cf16069f41bf</id>
<content type='text'>
* Fixes for Shader Execution Reordering on VK

There are some mismatches between the way that hit objects are
handled between the current NVAPI/HLSL and proposed GLSL extensions
for shader execution reordering. These mismatches create complications
for generating valid GLSL/SPIR-V code from input Slang.

Many of the problems that apply to `HitObject` also apply to the
existing `RayQuery&lt;&gt;` type used for "inline" ray tracing.

In the case of `RayQuery&lt;&gt;` we have that for *both* HLSL and
GLSL/SPIR-V:

* A `RayQuery` (or `rayQueryEXT`) is an opaque handle to underlying
  mutable storage

* The storage that backs a `RayQuery` is allocated as part of the
  "defualt constructor" for a local variable declared with type
  `RayQuery`.

* The `RayQuery` API provides numerous operations that mutate the
  storage referred to by the opaque handle.

The key difference between HLSL and GLSL/SPIR-V for the case of a
`RayQuery` amounts to:

* In HLSL, local variables of type `RayQuery` can be assigned to,
  and assignment has by-reference semantics. It is possible to create
  multiple aliased handles to the same underlying storage.

* In GLSL/SPIR-V, local variables of type `rayQueryEXT` cannot be
  assigned to, returned from functions, etc. It is impossible to
  create multiple aliased handles to the same underlying storage.

The case for `HitObject`s is signicantly *more* messy, because:

* In NVAPI/HLSL a `HitObject` is effectively a "value type" in that
  it only exposes constructors, and there is no way to mutate the
  state of a `HitObject` other than by assignment to a variable of that
  type. It makes no semantic difference whether a `HitObject` directly
  stores the value(s), or if it is a handle, since there is no way
  to introduce aliasing of mutable state. Assignment of `HitObject`s
  semantically creates a copy.

* In GLSL/SPIR-V, a `hitObjectNV` is, like a `rayQueryEXT`, a handle
  to underlying mutable state. These handles cannot be assigned,
  returned from functions, etc. There is no way to make a copy of
  a hit object.

This change includes several changes to how *both* `RayQuery&lt;&gt;` and
`HitObject` are implemented, with the intention of getting more cases
to work correctly when compiling for GLSL/SPIR-V, and to set up a
more clear mental model for the semantics we want to give to these
types in Slang, and how those semantics can/should map to our targets.

An overview of important changes:

* Marked a few operations on `RayQuery` as `[mutating]` that
  realistically should have already been that way.

* Marked the `HitObject` type as being non-copyable (an attribute we
  do not currently enforce), and marked the various GLSL operations that
  construct a hit object as having an `out` parameter of the `HitObject`
  type (even if they are nominally specified in GLSL as not writing
  to the correspondign parameter).

* Added a distinct IR opcode (`allocateOpaqueHandle`) to represent the
  implicit allocation that happens when declaring a variable of type
  `HitObject` or `RayQuery`, and made the "implicit constructor" for
  those types map to the new op. This operation took a lot of tweaking
  to get emitting in a reasonable way, and I'm still not 100% sure that
  all of the emission-related logic for it is strictly required
  (or correct).

* Added new IR instructions for `HitObject` and `RayQuery` types, and
  made the stdlib types map to those IR instructions.

* Treat `HitObject` and `RayQuery` as resource types for the purpose
  of our existing pass that specializes calls to functions that have
  outputs of resource type

* Added a new test case that includes a function that returns a
  `HitObject` as its result.

* Many test cases saw slight changes in their output (especially around
  the relative ordering of declarations of `HitObject`s and `RayQuery`s
  with other instructions)

* Remove debugging logic</content>
</entry>
<entry>
<title>Fix function side-effectness prop logic. (#2875)</title>
<updated>2023-05-09T16:44:33+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-05-09T16:44:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=38ed03a7203baacf36fca62539ac74fd45ed42d2'/>
<id>urn:sha1:38ed03a7203baacf36fca62539ac74fd45ed42d2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Various dxc/fxc compatibility fixes. (#2863)</title>
<updated>2023-05-03T03:29:38+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-05-03T03:29:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=d52376a65f37fcbbb67428b917fd3819436b6dfb'/>
<id>urn:sha1:d52376a65f37fcbbb67428b917fd3819436b6dfb</id>
<content type='text'>
* Various dxc/fxc compatibility fixes.

* Cleanup.

* Fix test cases.

* Fix comments.

---------

Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
<entry>
<title>Fix Phi simplification bug. (#2710)</title>
<updated>2023-03-17T06:46:14+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-03-17T06:46:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=9476d4543f4336a66308e55f722b0b0b2bd69dd2'/>
<id>urn:sha1:9476d4543f4336a66308e55f722b0b0b2bd69dd2</id>
<content type='text'>
* Fix Phi simplification bug.

* Fix up.

* Fix.

* Fix.

* Fix.

* Fix.

* Fix.

* Fix test.

* Fix test.

---------

Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
<entry>
<title>More control flow simplifications. (#2673)</title>
<updated>2023-02-24T18:01:47+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-02-24T18:01:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=bd6306cdaa4a49344658bd026721b6532e103d09'/>
<id>urn:sha1:bd6306cdaa4a49344658bd026721b6532e103d09</id>
<content type='text'>
* More control flow and Phi param simplifications.

* Fix.

* Fix gcc error.

* Fix.

* More IR cleanup.

* Fix bug in phi param dce + ifelse simplify.

* Propagate and DCE side-effect-free functions.

* Enhance CFG simplifcation to remove loops with no side effects.

* Fix.

* Fixes.

* Fix tests. Add [__AlwaysFoldIntoUseSite] for rayPayloadLocation.

* More cleanup.

* Fixes.

* Fix.

---------

Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
<entry>
<title>Add Loop Unrolling Pass. (#2644)</title>
<updated>2023-02-13T18:38:14+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-02-13T18:38:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=4dbc74a953ae1b34ce64a4eaef3aa7feb73663b9'/>
<id>urn:sha1:4dbc74a953ae1b34ce64a4eaef3aa7feb73663b9</id>
<content type='text'>
Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
<entry>
<title>Arithmetic simplifications and more IR clean up logic. (#2632)</title>
<updated>2023-02-08T02:36:35+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-02-08T02:36:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=4be623c52a6518eb86756a0369706c1d6670f6bb'/>
<id>urn:sha1:4be623c52a6518eb86756a0369706c1d6670f6bb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Register allocation during phi elimination. (#2613)</title>
<updated>2023-01-28T00:41:31+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-01-28T00:41:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=4a66e9729175a89833e5db784bb64e6a7f60cdf2'/>
<id>urn:sha1:4a66e9729175a89833e5db784bb64e6a7f60cdf2</id>
<content type='text'>
* Register allocation during phi elimination.

* Enhance the test case.

* Cleanup line breaks in test case.

* remove unncessary line break changes.

* More cleanups.

---------

Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
<entry>
<title>Reimplement address elimination. (#2605)</title>
<updated>2023-01-25T06:16:21+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-01-25T06:16:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=951ad25e0a9c3b0089c6b996b8e821ac93cf5766'/>
<id>urn:sha1:951ad25e0a9c3b0089c6b996b8e821ac93cf5766</id>
<content type='text'>
* Reimplement address elimination pass.

* Fix error.

* Update test references.

Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
</feed>
