<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/rewriter/glslang-bug-988-workaround.frag, 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-03T15:30:54+00:00</updated>
<entry>
<title>Remove non-IR codegen paths (#398)</title>
<updated>2018-02-03T15:30:54+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-02-03T15:30:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=662f43fff6721c6cd013a8f1b2639c2e29fe6be3'/>
<id>urn:sha1:662f43fff6721c6cd013a8f1b2639c2e29fe6be3</id>
<content type='text'>
The basic change is simple: remove support for all code generation paths other than the IR.
There is a lot of vestigial code left, but the main logic in `ast-legalize.*` is gone.

Doing this breaks a *lot* of tests, for various reasons:

- We can no longer guarantee exactly matching DXBC or SPIR-V output after things pass through out IR

- Many builtins don't have matching versions defined for GLSL output via IR (even when they had versions defined via the earlier approach that worked with the AST)

- A lot of code creates intermediate values of opaque types in the IR, which turn into opaque-type temporaries that aren't allowed (this breaks many GLSL tests, but also some HLSL)

I implemented some small fixes for issues that I could get working in the time I had, but most of the above are larger than made sense to fix in this commit.

For now I'm disabling the tests that cause problems, but we will need to make a concerted effort to get things working on this new substrate if we are going to make good on our goals.</content>
</entry>
<entry>
<title>Fixup for the glslang bug workaround</title>
<updated>2017-07-24T02:52:14+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoley@nvidia.com</email>
</author>
<published>2017-07-24T02:52:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e7241a921407ae79e0767956127f7ed501c5eeb1'/>
<id>urn:sha1:e7241a921407ae79e0767956127f7ed501c5eeb1</id>
<content type='text'>
There was a bug where the intialization expression for a variable was being lowered after the declaration was added to the output code, so that any sub-expressions that get hoisted out actually get computed *after* the original variable. This obviously led to downstream compilation failure.

I've updated the test case to stress this scenario.
</content>
</entry>
<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>
