<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/compute/generic-struct.slang.expected.txt, 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>2017-12-22T00:16:23+00:00</updated>
<entry>
<title>Support generic `struct` types during IR-based emit</title>
<updated>2017-12-22T00:16:23+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoley@nvidia.com</email>
</author>
<published>2017-12-22T00:16:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=00490154ef0762839556b5884ba9b7523b265a1c'/>
<id>urn:sha1:00490154ef0762839556b5884ba9b7523b265a1c</id>
<content type='text'>
Fixes #318

Most of the required support was actually in place, so this is just a bunch of fixes:

- Detect when we are in "full IR" mode, so that we can always emit `struct` declarations with their mangled named (which will produce different names for different specializations, since we emit decl-refs)

  - Carefully exclude builtin types from this for now. We'll need a more complete solution for mapping HLSL/Slang builtin types to their GLSL equivalents soon.

- Skip emitting types referenced by generic IR functions, since they might not be usable.

  - Also fix things up so that we emit types used in the initializer for any global variables.

- Fix bug in generic specialization where we specialize the same function more than once, with different type arguments. We were crashing on a `Dictionary::Add` call where the key already exists from a previous specialization attempt.

- Fix name-mangling logic so that when outputting a possibly-specialized generic it looks for the outer-most `GenericSubstitution` rather than just the first one in the list. This is to handle the way that we insert other substitutions willy-nilly in places where they realistically don't belong. :(

All of these changes together allow us to pass a slightly modified (more advanced) version of the test case posted to #318.
</content>
</entry>
</feed>
