diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-06-14 08:35:43 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-06-14 08:35:43 -0700 |
| commit | 34c7cdc68fd5b7b8132250c4de0d562c9ba0adbb (patch) | |
| tree | 6e2308639ac3205fb7a8760ff61def7779352699 /source/slang/compiled-program.h | |
| parent | 604e0fc8dc859e5d3954fd1e074e5288659cb439 (diff) | |
Testing: Adding binding-generation tests for some GLSL shaders
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.
Diffstat (limited to 'source/slang/compiled-program.h')
0 files changed, 0 insertions, 0 deletions
