Add missing structure padding to test

WGSL specifies that the size of a host-shareable structure is a
multiple of the largest alignment of any member in that
structure. While SPIR-V cross doesn't generate this trailing padding,
Tint does, and so we need to pad the host structure to match to avoid
validation errors.

Bug: dawn:571
Change-Id: Id5de89125a74c0469ae69d6e86b4c570bbdb31ab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56120
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
James Price 2021-06-28 08:38:28 +00:00 committed by Dawn LUCI CQ
parent 610de1d725
commit a0b31e04e8
1 changed files with 1 additions and 0 deletions

View File

@ -668,6 +668,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) {
float color0;
char padding2[256 - sizeof(float)];
float color1;
char padding3[256 - sizeof(float)];
};
wgpu::Buffer buffer = CreateZeroedBuffer(
sizeof(Data), wgpu::BufferUsage::Vertex | wgpu::BufferUsage::Index |