<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/compute/static-const-array.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>2018-02-08T22:46:12+00:00</updated>
<entry>
<title>Basic IR support for `static const` globals (#404)</title>
<updated>2018-02-08T22:46:12+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-02-08T22:46:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=c7c97ad4bb62b83efd6e26cdd4f38ebf164ec40e'/>
<id>urn:sha1:c7c97ad4bb62b83efd6e26cdd4f38ebf164ec40e</id>
<content type='text'>
* Basic IR support for `static const` globals

Our strategy for lowering global *variables* can fall back to putting their initialization into a function, but that isn't really appropriate for global constants (it also isn't appropriate for arrays, but we'll need to deal with that seaprately).

This change adds a distinct case for global constants (rather than treating them as variables), and forces the emission logic to always emit them as a single expression.
Doing this makes assumptions about how the IR for these constants gets emitted (and what optimziations might do to it).
In order to make things work, I had to switch the handling of initializer-list expressions to not be lowered via temporaries and mutation (since that isn't a good fit for reverting to a single expression).

I've added a single test case to ensure that this works in the simplest scenario. My next priority will be to see if this unblocks my work in Falcor.

* Fixup: bug fixes
</content>
</entry>
</feed>
