Commit Graph

10 Commits

Author SHA1 Message Date
dan sinclair
c4304ea0ac Reland "Disallow array-of-arrays with DescriptorSets when validating. (#1586)"
This CL reverts the revert of 'Disallow array-of-arrays with DescriptorSets when
validating." Other changes have been committed which should aleviate the
AppVeryor resource constraints.

This reverts commit f2c93c6e12.

This CL adds validation to disallow using an array-of-arrays when attached to a
DescriptorSet.

Fixes #1522
2018-06-19 15:14:17 -04:00
dan sinclair
f2c93c6e12
Revert "Disallow array-of-arrays with DescriptorSets when validating. (#1586)" (#1607)
This reverts commit e3f1f3bda5.
2018-06-06 20:27:43 -04:00
dan sinclair
e3f1f3bda5
Disallow array-of-arrays with DescriptorSets when validating. (#1586)
* Disallow array-of-arrays with DescriptorSets when validating.

This CL adds validation to disallow using an array-of-arrays when attached to a
DescriptorSet.

Fixes #1522
2018-06-05 09:11:35 -04:00
Arseny Kapoulkine
8b27ba834d Vulkan BuiltIn variables can't have Location/Component decorations
As per Vulkan spec, BuiltIn variables can't have Location or Component
decorations. On some drivers, these can lead to driver crashing when
compiling the shader pipeline; for example, NVidia/AMD desktop drivers:
https://github.com/KhronosGroup/glslang/issues/1182.

This change adds validation and tests to catch this.
2018-03-01 15:00:08 -05:00
Diego Novillo
83228137e1 Re-format source tree - NFC.
Re-formatted the source tree with the command:

$ /usr/bin/clang-format -style=file -i \
    $(find include source tools test utils -name '*.cpp' -or -name '*.h')

This required a fix to source/val/decoration.h.  It was not including
spirv.h, which broke builds when the #include headers were re-ordered by
clang-format.
2017-11-27 14:31:49 -05:00
Ehsan Nasiri
2046e24498 Fixes issue #489.
From the SPIR-V Spec 2.16.1:

A function declaration (an OpFunction with no basic blocks), must have
a Linkage Attributes Decoration with the Import Linkage Type.

A function definition (an OpFunction with basic blocks) cannot be
decorated with the Import Linkage Type.
2017-03-02 10:06:29 -05:00
Ehsan Nasiri
cb009b3862 Fixes issue #497.
The Linkage Attributes Decoration cannot be applied to functions
targeted by an OpEntryPoint instruction.
2017-01-19 16:34:47 -05:00
Ehsan Nasiri
9c71c572e5 Check BuiltIn Decoration rules.
When applied to a structure-type member, all members of that structure
type must also be decorated with BuiltIn. (No allowed mixing of built-in
variables and non-built-in variables within a single structure.)

When applied to a structure-type member, that structure type cannot be
contained as a member of another structure type.

There is at most one object per Storage Class that can contain a
structure type containing members decorated with BuiltIn, consumed per
entry-point.
2017-01-19 16:01:06 -05:00
Ehsan Nasiri
d75bf5ef03 Validation for decoration rules. Fixes issue #499.
Added a new file where all the decoration validation can be performed.

In this change the SPIRV Spec Section 2.16.1 is implemented:
"It is illegal to initialize an imported variable. This means
that a module-scope OpVariable with initialization value cannot be
marked with the Import Linkage Type."

Also added unit tests.
2017-01-18 16:29:14 -05:00
Ehsan Nasiri
fcf7df069d Adding decoration class and tests.
* Added the decoration class as well as the code that registers the
decorations for each <id> and also decorations for struct members.

* Added unit tests for decorations in ValidationState as well as
decoration id tests.
2017-01-16 16:52:08 -05:00