diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-07-13 09:50:27 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-07-13 09:52:19 -0700 |
| commit | bb8ebb4e75db0a19ed7643876bf646bdacb2726e (patch) | |
| tree | 2c41633b9ba7d63754bc2acfbe1d90468131f06c /tests/bindings | |
| parent | c51fd4ee8f478aa3d3b7e6208a3a4e9c00e2413a (diff) | |
An array of resources in Vulkan only consumes one binding
Fixes #84
- When computing resource usage for an array type, don't multiply the resource usage of the element type by the element count foor descriptor-table-slot resources.
- When reporting the "stride" of an array type through reflection, report the stride for descriptor table slots as zero, always.
Diffstat (limited to 'tests/bindings')
| -rw-r--r-- | tests/bindings/gh-84.frag | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/bindings/gh-84.frag b/tests/bindings/gh-84.frag new file mode 100644 index 000000000..b5cc1875e --- /dev/null +++ b/tests/bindings/gh-84.frag @@ -0,0 +1,35 @@ +#version 450 +//TEST:COMPARE_GLSL: + +// Confirm implementation of GitHub issue #84 + +#if defined(__SLANG__) +#define LAYOUT(X) /* empty */ +#else +#define LAYOUT(X) layout(X) +#endif + +// Array of resources: should only use up one binding +LAYOUT(binding = 0) +uniform texture2D t[8]; + +// This should automatically get binding 1 +LAYOUT(binding = 1) +uniform sampler s; + +LAYOUT(binding = 2) +uniform U +{ + int i; +}; + +LAYOUT(location = 0) +in vec2 uv; + +LAYOUT(location = 0) +out vec4 color; + +void main() +{ + color = texture(sampler2D(t[i], s), uv); +} |
