<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/rewriter/glslang-bug-988-workaround.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>2017-07-24T01:37:52+00:00</updated>
<entry>
<title>Work around glslang issue 988</title>
<updated>2017-07-24T01:37:52+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoley@nvidia.com</email>
</author>
<published>2017-07-24T01:22:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=d4cfe5781284551d7c5ccf2cf1d28a86211bb1df'/>
<id>urn:sha1:d4cfe5781284551d7c5ccf2cf1d28a86211bb1df</id>
<content type='text'>
The basic bug there is that if you have a member of `struct` type in a `uniform` block and then pass a reference to that member directly to a call:

```
struct Foo { vec4 bar; };
uniform U { Foo foo; };

void main() { doSomething(foo); }
```

then glslang generates invalid SPIR-V which seems to cause an issue for some drivers.

This change works around the problem by detecting cases where an argument to a function call is a reference to `uniform` block member (of `struct` type) and then rewrites the code to move that value to a temporary before the call.
</content>
</entry>
</feed>
