Update compute shaders tests to include workgroup_size

Change-Id: I97ef98c1cfc1a06c5072d1a52233100ad3d37c09
Bug: tint:884
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56142
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Sarah 2021-06-29 00:10:01 +00:00 committed by Dawn LUCI CQ
parent 1c7c088b91
commit 98ab91b474
2 changed files with 3 additions and 2 deletions

View File

@ -171,7 +171,7 @@ void initSim() {
[[binding(2), group(0)]] var<storage, read_write> particlesB : Particles; [[binding(2), group(0)]] var<storage, read_write> particlesB : Particles;
// https://github.com/austinEng/Project6-Vulkan-Flocking/blob/master/data/shaders/computeparticles/particle.comp // https://github.com/austinEng/Project6-Vulkan-Flocking/blob/master/data/shaders/computeparticles/particle.comp
[[stage(compute)]] [[stage(compute), workgroup_size(1)]]
fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) { fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3<u32>) {
var index : u32 = GlobalInvocationID.x; var index : u32 = GlobalInvocationID.x;
if (index >= params.particleCount) { if (index >= params.particleCount) {

View File

@ -326,10 +326,11 @@ fn IsEqualTo(pixel : vec4<f32>, expected : vec4<f32>) -> bool {
auto* textureStore = is2DArray auto* textureStore = is2DArray
? "textureStore(storageImage0, vec2<i32>(x, y), layer, expected)" ? "textureStore(storageImage0, vec2<i32>(x, y), layer, expected)"
: "textureStore(storageImage0, vec2<i32>(x, y), expected)"; : "textureStore(storageImage0, vec2<i32>(x, y), expected)";
auto workgroupSize = !strcmp(stage, "compute") ? ", workgroup_size(1)" : "";
std::ostringstream ostream; std::ostringstream ostream;
ostream << GetImageDeclaration(format, "write", is2DArray, 0) << "\n"; ostream << GetImageDeclaration(format, "write", is2DArray, 0) << "\n";
ostream << "[[stage(" << stage << ")]]\n"; ostream << "[[stage(" << stage << ")" << workgroupSize << "]]\n";
ostream << "fn main() {\n"; ostream << "fn main() {\n";
ostream << " let size : vec2<i32> = textureDimensions(storageImage0);\n"; ostream << " let size : vec2<i32> = textureDimensions(storageImage0);\n";
ostream << " let layerCount : i32 = " << layerCount << ";\n"; ostream << " let layerCount : i32 = " << layerCount << ";\n";