<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/spirv/direct-spirv-emit.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>2023-09-27T06:56:06+00:00</updated>
<entry>
<title>Various SPIRV fixes. (#3231)</title>
<updated>2023-09-27T06:56:06+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-09-27T06:56:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=ebe8ddefc48478307d5f206cd3e40c41d28a36e3'/>
<id>urn:sha1:ebe8ddefc48478307d5f206cd3e40c41d28a36e3</id>
<content type='text'>
* Various SPIRV fixes.

- Geometry shader support (WIP).
- Fix texture get dimension and load.
- Fold global GetElement(MakeArray/MakeVector) insts.
- Call spvopt to inline all functions.
- Translate OpImageSubscript.
- Emit struct member names and global variable names.
- Fix lowering of OpBitNot -&gt; OpNot, instead of OpBitReverse.

* Fix test.

* Fix geometry shader.

* Fix geometry shader emit.

* Add atomic Image access test.

* Fix tests.

* don't fail if spirv-opt fails.

* Update comments.

* Fix test.

* Cleanups.

* indentation

---------

Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;
Co-authored-by: Ellie Hermaszewska &lt;ellieh@nvidia.com&gt;</content>
</entry>
<entry>
<title>Initial work on direct emission of SPIR-V (#1118)</title>
<updated>2019-11-14T21:11:07+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2019-11-14T21:11:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=ce4829b03622c7c23096253b0ee80b0fc923321e'/>
<id>urn:sha1:ce4829b03622c7c23096253b0ee80b0fc923321e</id>
<content type='text'>
* Initial work on direct emission of SPIR-V

This change adds a first vertical slice of support for emitting SPIR-V code directly from the Slang IR, instead of generating it indirectly via GLSL.
This work isn't usable for anything valuable right now; the goal is just to get something checked in that we can incrementally extend over time.

When invoking `slangc`, the `-emit-spirv-directly` option can be used to turn on the new code path.
I have not bothered to add an equivalent API option, because this flag is only intended to be used for testing in the immediate future.

The existing `emitEntryPoint()` function has become `emitEntryPointSource()` to more accurately reflect its role in a world where we can also emit entry points to a binary format.

Much of the logic that was inside `emitEntryPoint()` had to do with linking and then optimizing/transforming Slang IR code to get it ready for emission on a particular target.
This logic has been factored into a new `linkAndOptimizeIR()` function that can be shared between the path that emits source and the new one that emits SPIR-V.

The meat of the change is then the `emitSPIRVFromIR()` function in `slang-emit-spirv.cpp`, which is called *after* all the optimizations and transformations have been applied to the Slang IR to get it ready.
Rather than repeat myself here, I will try to make the comments in `slang-emit-spirv.cpp` usable as documentation of the approach being taken.

Smaller notes:

* I've included a test case that compares `slangc` output directly to expected SPIR-V. This is perhaps not an ideal plan for how to test SPIR-V emission going forward, but it suffices for now.

* The `external/` directory needed to be added to the include dirs for the `slang` project so that the new code can depend on the SPIR-V header.

* In `slang-ir-link`, the direct SPIR-V generation path means that we now link with a target of SPIR-V instead of GLSL. In principle this can be used to ensure that appropriate variants of intrinsics are selected based on the knowledge that we are emitting SPIR-V. In practice, that isn't being used at all.

* Fixup: path for SPIR-V headers

While working on this PR I used a copy of `spirv.h` that I placed into the repository tree manually, but since I started the work we ended up with SPIR-V headers in our tree anyway, albeit at a different path.

This change tries to fix things up so that my code uses the headers that were already placed in the repository.

* fixup; 64-bit build issue

* fixup: typo fixes based on review
</content>
</entry>
</feed>
