https://github.com/shader-slang/slang
Revision 34c7cdc68fd5b7b8132250c4de0d562c9ba0adbb authored by Tim Foley on 14 June 2017, 15:35:43 UTC, committed by Tim Foley on 14 June 2017, 15:35:43 UTC
Most of the Vulkan GLSL shaders in the `sascha-willems` corpus use completely regular parameter bindings, e.g.:

```
layout (binding = 0) uniform sampler2D samplerPositionDepth;
layout (binding = 1) uniform sampler2D samplerNormal;
layout (binding = 2) uniform sampler2D ssaoNoise;
```

With the Slang compiler, we can write this kind of stuff more compactly as:

```
uniform sampler2D samplerPositionDepth;
uniform sampler2D samplerNormal;
uniform sampler2D ssaoNoise;
```

and get the exact same result (in fact, we will generate output GLSL matching the first example).

There are a few spot tests for this in the HLSL case, but I hadn't done anything for GLSL yet.
Now that we have the ability to specify multiple tests to run on each input file, it was easy enough to go in and tweak some of these files to be usable as binding-generation tests.

I didn't ammend all of the GLSL shaders for two reasons:

1. Not all of the shaders will work with completely automatic binding generation done on a per-file basis. In some cases, the parameter layout needs to consider multiple files (and the order in which the files are supplied could matter). This is probably best handled with more directed tests.

2. There is going to be a ton of duplication if I just have 100s of tests that all confirm that, yes, the Slang compiler can count vertex inputs starting from zero. These shaders aren't really presenting a whole lot of unique cases to work with.

That said, a level of confidence greater than zero is always better than zero confidence.
1 parent 604e0fc
History
Tip revision: 34c7cdc68fd5b7b8132250c4de0d562c9ba0adbb authored by Tim Foley on 14 June 2017, 15:35:43 UTC
Testing: Adding binding-generation tests for some GLSL shaders
Tip revision: 34c7cdc
File Mode Size
build
examples
external
source
tests
tools
.gitignore -rw-r--r-- 247 bytes
.gitmodules -rw-r--r-- 107 bytes
LICENSE -rw-r--r-- 1.1 KB
README.md -rw-r--r-- 1.5 KB
appveyor.yml -rw-r--r-- 2.0 KB
slang.h -rw-r--r-- 28.4 KB
slang.sln -rw-r--r-- 6.3 KB
test.bat -rw-r--r-- 786 bytes

README.md

back to top