mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-18 01:15:39 +00:00
Fix Storage Buffers in WGSL tests & examples
Converts var<storage_buffer> to var<storage> Adds in [[access(read_write)]] when no access qualifier was supplied. BUG=dawn:699 Change-Id: I9da95366d0bb8734f1d134ee2dc764a7c16ef0cf Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45300 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org> Auto-Submit: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
9895c273d6
commit
bbabda3590
@@ -1094,8 +1094,8 @@ class SetBindGroupValidationTest : public ValidationTest {
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> uBufferDynamic : S;
|
||||
[[group(0), binding(1)]] var<uniform> uBuffer : S;
|
||||
[[group(0), binding(2)]] var<storage_buffer> sBufferDynamic : [[access(read_write)]] S;
|
||||
[[group(0), binding(3)]] var<storage_buffer> sReadonlyBufferDynamic : [[access(read)]] S;
|
||||
[[group(0), binding(2)]] var<storage> sBufferDynamic : [[access(read_write)]] S;
|
||||
[[group(0), binding(3)]] var<storage> sReadonlyBufferDynamic : [[access(read)]] S;
|
||||
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
@@ -1117,8 +1117,8 @@ class SetBindGroupValidationTest : public ValidationTest {
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> uBufferDynamic : S;
|
||||
[[group(0), binding(1)]] var<uniform> uBuffer : S;
|
||||
[[group(0), binding(2)]] var<storage_buffer> sBufferDynamic : [[access(read_write)]] S;
|
||||
[[group(0), binding(3)]] var<storage_buffer> sReadonlyBufferDynamic : [[access(read)]] S;
|
||||
[[group(0), binding(2)]] var<storage> sBufferDynamic : [[access(read_write)]] S;
|
||||
[[group(0), binding(3)]] var<storage> sReadonlyBufferDynamic : [[access(read)]] S;
|
||||
|
||||
[[stage(compute), workgroup_size(4, 4, 1)]] fn main() -> void {
|
||||
})");
|
||||
@@ -1543,7 +1543,7 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest {
|
||||
ss << "[[group(" << l << "), binding(" << b << ")]] ";
|
||||
switch (binding) {
|
||||
case wgpu::BufferBindingType::Storage:
|
||||
ss << "var<storage_buffer> set" << l << "_binding" << b
|
||||
ss << "var<storage> set" << l << "_binding" << b
|
||||
<< " : [[access(read_write)]] S;";
|
||||
break;
|
||||
case wgpu::BufferBindingType::Uniform:
|
||||
@@ -1711,8 +1711,8 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest {
|
||||
value : vec2<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage_buffer> sBufferDynamic : [[access(read_write)]] S;
|
||||
[[group(1), binding(0)]] var<storage_buffer> sReadonlyBufferDynamic : [[access(read)]] S;
|
||||
[[group(0), binding(0)]] var<storage> sBufferDynamic : [[access(read_write)]] S;
|
||||
[[group(1), binding(0)]] var<storage> sReadonlyBufferDynamic : [[access(read)]] S;
|
||||
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})",
|
||||
@@ -1744,8 +1744,8 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest {
|
||||
value : vec2<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(0)]] var<storage_buffer> sBufferDynamic : [[access(read_write)]] S;
|
||||
[[group(1), binding(0)]] var<storage_buffer> sReadonlyBufferDynamic : [[access(read)]] S;
|
||||
[[group(0), binding(0)]] var<storage> sBufferDynamic : [[access(read_write)]] S;
|
||||
[[group(1), binding(0)]] var<storage> sReadonlyBufferDynamic : [[access(read)]] S;
|
||||
|
||||
[[stage(compute), workgroup_size(4, 4, 1)]] fn main() -> void {
|
||||
})",
|
||||
|
||||
@@ -62,7 +62,7 @@ TEST_F(GetBindGroupLayoutTests, SameObject) {
|
||||
[[block]] struct S3 {
|
||||
pos : mat4x4<f32>;
|
||||
};
|
||||
[[group(3), binding(0)]] var<storage_buffer> storage3 : S3;
|
||||
[[group(3), binding(0)]] var<storage> storage3 : [[access(read_write)]] S3;
|
||||
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
@@ -194,7 +194,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
|
||||
[[block]] struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage_buffer> ssbo : S;
|
||||
[[group(0), binding(0)]] var<storage> ssbo : [[access(read_write)]] S;
|
||||
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
@@ -219,7 +219,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
|
||||
[[block]] struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage_buffer> ssbo : [[access(read)]] S;
|
||||
[[group(0), binding(0)]] var<storage> ssbo : [[access(read)]] S;
|
||||
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
@@ -638,7 +638,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) {
|
||||
[[block]] struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage_buffer> ssbo : S;
|
||||
[[group(0), binding(0)]] var<storage> ssbo : [[access(read_write)]] S;
|
||||
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
@@ -827,8 +827,8 @@ TEST_F(GetBindGroupLayoutTests, DISABLED_FromCorrectEntryPoint) {
|
||||
[[block]] struct Data {
|
||||
data : f32;
|
||||
};
|
||||
[[binding 0, set 0]] var<storage_buffer> data0 : Data;
|
||||
[[binding 1, set 0]] var<storage_buffer> data1 : Data;
|
||||
[[binding 0, set 0]] var<storage> data0 : [[access(read_write)]] Data;
|
||||
[[binding 1, set 0]] var<storage> data1 : [[access(read_write)]] Data;
|
||||
|
||||
fn compute0() -> void {
|
||||
data0.data = 0.0;
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace {
|
||||
[[block]] struct Storage {
|
||||
dummy : array<f32>;
|
||||
};
|
||||
[[group(1), binding(1)]] var<storage_buffer> ssbo : [[access(read_write)]] Storage;
|
||||
[[group(1), binding(1)]] var<storage> ssbo : [[access(read_write)]] Storage;
|
||||
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
@@ -486,7 +486,7 @@ TEST_F(RenderPipelineValidationTest, StorageBufferInVertexShaderNoLayout) {
|
||||
[[block]] struct Dst {
|
||||
data : array<u32, 100>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage_buffer> dst : [[access(read_write)]] Dst;
|
||||
[[group(0), binding(0)]] var<storage> dst : [[access(read_write)]] Dst;
|
||||
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
dst.data[VertexIndex] = 0x1234u;
|
||||
|
||||
@@ -779,7 +779,7 @@ namespace {
|
||||
[[block]] struct RBuffer {
|
||||
value : f32;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage_buffer> rBuffer : [[access(read)]] RBuffer;
|
||||
[[group(0), binding(0)]] var<storage> rBuffer : [[access(read)]] RBuffer;
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
utils::ComboRenderPipelineDescriptor2 pipelineDescriptor;
|
||||
@@ -819,7 +819,7 @@ namespace {
|
||||
[[block]] struct RBuffer {
|
||||
value : f32;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage_buffer> rBuffer : [[access(read)]] RBuffer;
|
||||
[[group(0), binding(0)]] var<storage> rBuffer : [[access(read)]] RBuffer;
|
||||
[[stage(compute)]] fn main() -> void {
|
||||
})");
|
||||
wgpu::ComputePipelineDescriptor pipelineDescriptor;
|
||||
|
||||
@@ -197,7 +197,7 @@ TEST_F(StorageTextureValidationTests, ComputePipeline) {
|
||||
[[block]] struct Buf {
|
||||
data : f32;
|
||||
};
|
||||
[[group(0), binding(1)]] var<storage_buffer> buf : [[access(read_write)]] Buf;
|
||||
[[group(0), binding(1)]] var<storage> buf : [[access(read_write)]] Buf;
|
||||
|
||||
[[stage(compute)]] fn main() -> void {
|
||||
buf.data = textureLoad(image0, vec2<i32>(LocalInvocationID.xy)).x;
|
||||
|
||||
Reference in New Issue
Block a user