Fix the ComputeBoids sample on the OpenGL backend.

Having the [[block]] decorator on the nested Particle struct causes
SPIRV-Cross to not emit it (see bug). Removing the decorator from
the Particle while leaving it on the top-level struct works fine.

This fixes the issue, but validation should be added to Tint
to catch the problem (this work is tracked in https://bugs.chromium.org/p/tint/issues/detail?id=320).

Bug: dawn:611
Change-Id: I8bef811e314ed758f805247977f8b129477abd39
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/42300
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Stephen White 2021-02-23 20:30:39 +00:00 committed by Commit Bot service account
parent ab204c9d3d
commit d67544797e

View File

@ -150,7 +150,7 @@ void initRender() {
void initSim() {
wgpu::ShaderModule module = utils::CreateShaderModuleFromWGSL(device, R"(
[[block]] struct Particle {
struct Particle {
[[offset(0)]] pos : vec2<f32>;
[[offset(8)]] vel : vec2<f32>;
};