Validate that in/out storage classes are not used

Use a DisableValidationDecoration to allow these storage classes only
for variables generated by the SPIR-V sanitizer. This is also used in
the Inspector tests, since the Inspector is currently run *after* the
SPIR-V sanitizer. These tests will be removed when this is no longer
the case.

Also validate that builtin/location decorations are not used on
variables (unless they have input/output storage class).

Fix or delete all of the other tests that were wrongly using these
storage classes and attributes.

Bug: tint:697
Change-Id: I8be7fb16191f5e2bed9f7dfb700e51f3b97fd1fe
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55862
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price
2021-06-24 15:53:26 +00:00
committed by Tint LUCI CQ
parent ffd28e2e1a
commit 14c0b8acbf
25 changed files with 268 additions and 462 deletions

View File

@@ -34,8 +34,8 @@ std::string DisableValidationDecoration::InternalName() const {
return "disable_validation__function_has_no_body";
case DisabledValidation::kBindingPointCollision:
return "disable_validation__binding_point_collision";
case DisabledValidation::kFunctionVarStorageClass:
return "disable_validation__function_var_storage_class";
case DisabledValidation::kIgnoreStorageClass:
return "disable_validation__ignore_storage_class";
case DisabledValidation::kEntryPointParameter:
return "disable_validation__entry_point_parameter";
}

View File

@@ -31,9 +31,9 @@ enum class DisabledValidation {
/// When applied to a module-scoped variable, the validator will not complain
/// if two resource variables have the same binding points.
kBindingPointCollision,
/// When applied to a function-scoped variable, the validator will not
/// complain if the storage class is not `function`.
kFunctionVarStorageClass,
/// When applied to a variable, the validator will not complain about the
/// declared storage class.
kIgnoreStorageClass,
/// When applied to an entry-point function parameter, the validator will not
/// check for entry IO decorations.
kEntryPointParameter,