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.

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

Bug: tint:697
Change-Id: Ife1154f687b18529cfcc7a0ed93407fd25c9868e
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55404
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
James Price
2021-06-21 20:27:56 +00:00
committed by Tint LUCI CQ
parent 53a0d2681a
commit 6330260f7d
22 changed files with 238 additions and 434 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,