aboutsummaryrefslogtreecommitdiff
path: root/source/val
diff options
context:
space:
mode:
authorSteven Perron <stevenperron@google.com>2017-10-24 15:13:13 -0400
committerDavid Neto <dneto@google.com>2017-10-28 18:48:21 -0400
commit716138ee14c88ba0f0aa65a9a995f67e5ad252ec (patch)
tree2ac6d02b4449691aac7736c6b6af6d0da67fe29f /source/val
parent6724c272515686398105813de0801407566ae914 (diff)
downloadspirv-tools-716138ee14c88ba0f0aa65a9a995f67e5ad252ec.tar.gz
Add option to relax validation of store types.
There are a number of users of spriv-opt that are hitting errors because of stores with different types. In general, this is wrong, but, in these cases, the types are the exact same except for decorations. The options is "--relax-store-struct", and it can be used with the validator or the optimizer. We assume that if layout information is missing it is consistent. For example if one struct has a offset of one of its members, and the other one does not, we will still consider them as being layout compatible. The problem will be if both struct has and offset decoration for corresponding members, and the offset are different.
Diffstat (limited to 'source/val')
-rw-r--r--source/val/validation_state.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/val/validation_state.h b/source/val/validation_state.h
index 7b11bc71..db39dae5 100644
--- a/source/val/validation_state.h
+++ b/source/val/validation_state.h
@@ -260,6 +260,9 @@ class ValidationState_t {
std::vector<Decoration>& id_decorations(uint32_t id) {
return id_decorations_[id];
}
+ const std::vector<Decoration>& id_decorations(uint32_t id) const {
+ return id_decorations_.at(id);
+ }
/// Finds id's def, if it exists. If found, returns the definition otherwise
/// nullptr