diff options
author | dan sinclair <dj2@everburning.com> | 2019-03-30 13:29:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-30 13:29:57 -0400 |
commit | 86af71dc2875a1c64bcb9e418aa5ad43c7a6747d (patch) | |
tree | 701930b34a5402122e5eba8143d877b72b3535a0 /src/verifier.cc | |
parent | f23a84c68a7fa5a86429d1261f02f427402ce4db (diff) | |
download | amber-86af71dc2875a1c64bcb9e418aa5ad43c7a6747d.tar.gz |
[vkscript] report error on invalid ssbo subdata offset. (#421)
This CL adds an error message if the requested offset is not a multiple
of the data type. This also updates the DatumType code to handle std140
layouts where we have to add an extra element for 3 item arrays.
Currently all things are considered to be in std140.
Fixes #296.
Diffstat (limited to 'src/verifier.cc')
-rw-r--r-- | src/verifier.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/verifier.cc b/src/verifier.cc index 0014399..5754c54 100644 --- a/src/verifier.cc +++ b/src/verifier.cc @@ -650,8 +650,7 @@ Result Verifier::ProbeSSBO(const ProbeSSBOCommand* command, } const auto& datum_type = command->GetDatumType(); - size_t bytes_per_elem = datum_type.SizeInBytes() / datum_type.RowCount() / - datum_type.ColumnCount(); + size_t bytes_per_elem = datum_type.ElementSizeInBytes(); size_t offset = static_cast<size_t>(command->GetOffset()); if (values.size() * bytes_per_elem + offset > size_in_bytes) { return Result( |