Remove [[block]] attribute from all shaders
This has been removed from WGSL and is now deprecated in Tint.
Bug: tint:1324
Change-Id: Ic187ce3c5ce0723db6f3ca6483e9f5e73ce27acc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72880
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn_native/ComputePassEncoder.cpp b/src/dawn_native/ComputePassEncoder.cpp
index 3831868..f7b9aa7 100644
--- a/src/dawn_native/ComputePassEncoder.cpp
+++ b/src/dawn_native/ComputePassEncoder.cpp
@@ -45,18 +45,18 @@
// Type 'bool' cannot be used in storage class 'uniform' as it is non-host-shareable.
Ref<ShaderModuleBase> shaderModule;
DAWN_TRY_ASSIGN(shaderModule, utils::CreateShaderModule(device, R"(
- [[block]] struct UniformParams {
+ struct UniformParams {
maxComputeWorkgroupsPerDimension: u32;
clientOffsetInU32: u32;
enableValidation: u32;
duplicateNumWorkgroups: u32;
};
- [[block]] struct IndirectParams {
+ struct IndirectParams {
data: array<u32>;
};
- [[block]] struct ValidatedParams {
+ struct ValidatedParams {
data: array<u32>;
};
diff --git a/src/dawn_native/CopyTextureForBrowserHelper.cpp b/src/dawn_native/CopyTextureForBrowserHelper.cpp
index f9ab3fd..90dfa7b 100644
--- a/src/dawn_native/CopyTextureForBrowserHelper.cpp
+++ b/src/dawn_native/CopyTextureForBrowserHelper.cpp
@@ -48,7 +48,7 @@
padding: u32;
};
- [[block]] struct Uniforms { // offset align size
+ struct Uniforms { // offset align size
scale: vec2<f32>; // 0 8 8
offset: vec2<f32>; // 8 8 8
steps_mask: u32; // 16 4 4
diff --git a/src/dawn_native/IndirectDrawValidationEncoder.cpp b/src/dawn_native/IndirectDrawValidationEncoder.cpp
index a58f9b0..36c8d0a 100644
--- a/src/dawn_native/IndirectDrawValidationEncoder.cpp
+++ b/src/dawn_native/IndirectDrawValidationEncoder.cpp
@@ -53,7 +53,7 @@
let kBaseVertexEntry = 3u;
let kFirstInstanceEntry = 4u;
- [[block]] struct BatchInfo {
+ struct BatchInfo {
numIndexBufferElementsLow: u32;
numIndexBufferElementsHigh: u32;
numDraws: u32;
@@ -61,7 +61,7 @@
indirectOffsets: array<u32>;
};
- [[block]] struct IndirectParams {
+ struct IndirectParams {
data: array<u32>;
};
diff --git a/src/dawn_native/QueryHelper.cpp b/src/dawn_native/QueryHelper.cpp
index 03d2194..ef8e206 100644
--- a/src/dawn_native/QueryHelper.cpp
+++ b/src/dawn_native/QueryHelper.cpp
@@ -40,15 +40,15 @@
high : u32;
};
- [[block]] struct TimestampArr {
+ struct TimestampArr {
t : array<Timestamp>;
};
- [[block]] struct AvailabilityArr {
+ struct AvailabilityArr {
v : array<u32>;
};
- [[block]] struct TimestampParams {
+ struct TimestampParams {
first : u32;
count : u32;
offset : u32;
diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp
index 57ed3f7..490b2ca 100644
--- a/src/tests/DawnTest.cpp
+++ b/src/tests/DawnTest.cpp
@@ -1146,7 +1146,7 @@
shaderSource << "let width : u32 = " << width << "u;\n";
shaderSource << "[[group(0), binding(0)]] var tex : " << wgslTextureType << ";\n";
shaderSource << R"(
- [[block]] struct Result {
+ struct Result {
values : array<f32>;
};
[[group(0), binding(1)]] var<storage, read_write> result : Result;
diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp
index f6693b8..b364e0a 100644
--- a/src/tests/end2end/BindGroupTests.cpp
+++ b/src/tests/end2end/BindGroupTests.cpp
@@ -67,7 +67,7 @@
std::ostringstream fs;
for (size_t i = 0; i < bindingTypes.size(); ++i) {
- fs << "[[block]] struct Buffer" << i << R"( {
+ fs << "struct Buffer" << i << R"( {
color : vec4<f32>;
};)";
@@ -129,7 +129,7 @@
// This test passes by not asserting or crashing.
TEST_P(BindGroupTests, ReusedBindGroupSingleSubmit) {
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct Contents {
+ struct Contents {
f : f32;
};
[[group(0), binding(0)]] var <uniform> contents: Contents;
@@ -164,7 +164,7 @@
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
// TODO(crbug.com/tint/369): Use a mat2x2 when Tint translates it correctly.
- [[block]] struct VertexUniformBuffer {
+ struct VertexUniformBuffer {
transform : vec4<f32>;
};
@@ -182,7 +182,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct FragmentUniformBuffer {
+ struct FragmentUniformBuffer {
color : vec4<f32>;
};
[[group(0), binding(1)]] var <uniform> fragmentUbo : FragmentUniformBuffer;
@@ -242,7 +242,7 @@
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
// TODO(crbug.com/tint/369): Use a mat2x2 when Tint translates it correctly.
- [[block]] struct VertexUniformBuffer {
+ struct VertexUniformBuffer {
transform : vec4<f32>;
};
[[group(0), binding(0)]] var <uniform> vertexUbo : VertexUniformBuffer;
@@ -345,7 +345,7 @@
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
// TODO(crbug.com/tint/369): Use a mat2x2 when Tint translates it correctly.
- [[block]] struct VertexUniformBuffer {
+ struct VertexUniformBuffer {
transform : vec4<f32>;
};
@@ -366,7 +366,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct FragmentUniformBuffer {
+ struct FragmentUniformBuffer {
color : vec4<f32>;
};
@@ -435,7 +435,7 @@
// This test passes by not asserting or crashing.
TEST_P(BindGroupTests, MultipleEntryPointsWithMultipleNonZeroGroups) {
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct Contents {
+ struct Contents {
f : f32;
};
[[group(0), binding(0)]] var <uniform> contents0: Contents;
@@ -1035,11 +1035,11 @@
wgpu::ComputePipelineDescriptor pipelineDescriptor;
pipelineDescriptor.compute.module = utils::CreateShaderModule(device, R"(
- [[block]] struct Buffer {
+ struct Buffer {
value : u32;
};
- [[block]] struct OutputBuffer {
+ struct OutputBuffer {
value : vec3<u32>;
};
@@ -1118,11 +1118,11 @@
wgpu::ComputePipelineDescriptor pipelineDescriptor;
pipelineDescriptor.compute.module = utils::CreateShaderModule(device, R"(
- [[block]] struct Buffer {
+ struct Buffer {
value : u32;
};
- [[block]] struct OutputBuffer {
+ struct OutputBuffer {
value : vec2<u32>;
};
@@ -1244,7 +1244,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct Ubo {
+ struct Ubo {
color : vec4<f32>;
};
@@ -1386,7 +1386,7 @@
})");
pipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"(
- [[block]] struct Buffer0 {
+ struct Buffer0 {
color : vec4<f32>;
};
[[group(0), binding(0)]] var<storage, read> buffer0 : Buffer0;
@@ -1501,7 +1501,7 @@
device, wgpu::BufferUsage::Uniform, {expectedValue, 0, 0, 0});
bgEntries.push_back({nullptr, binding, buffer, 0, 4 * sizeof(uint32_t), nullptr, nullptr});
- interface << "[[block]] struct UniformBuffer" << i << R"({
+ interface << "struct UniformBuffer" << i << R"({
value : u32;
};
)";
@@ -1518,7 +1518,7 @@
device, wgpu::BufferUsage::Storage, {expectedValue});
bgEntries.push_back({nullptr, binding, buffer, 0, sizeof(uint32_t), nullptr, nullptr});
- interface << "[[block]] struct ReadOnlyStorageBuffer" << i << R"({
+ interface << "struct ReadOnlyStorageBuffer" << i << R"({
value : u32;
};
)";
@@ -1534,7 +1534,7 @@
device, wgpu::BufferUsage::Storage | wgpu::BufferUsage::CopySrc, {0});
bgEntries.push_back({nullptr, binding, result, 0, sizeof(uint32_t), nullptr, nullptr});
- interface << R"([[block]] struct ReadWriteStorageBuffer{
+ interface << R"(struct ReadWriteStorageBuffer{
value : u32;
};
)";
diff --git a/src/tests/end2end/BufferZeroInitTests.cpp b/src/tests/end2end/BufferZeroInitTests.cpp
index d559d61..63df6b8 100644
--- a/src/tests/end2end/BufferZeroInitTests.cpp
+++ b/src/tests/end2end/BufferZeroInitTests.cpp
@@ -997,7 +997,7 @@
constexpr uint32_t kBoundBufferSize = 16u;
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct UBO {
+ struct UBO {
value : vec4<u32>;
};
[[group(0), binding(0)]] var<uniform> ubo : UBO;
@@ -1036,7 +1036,7 @@
constexpr uint32_t kBoundBufferSize = 16u;
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct SSBO {
+ struct SSBO {
value : vec4<u32>;
};
[[group(0), binding(0)]] var<storage, read> ssbo : SSBO;
@@ -1075,7 +1075,7 @@
constexpr uint32_t kBoundBufferSize = 32u;
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct SSBO {
+ struct SSBO {
value : array<vec4<u32>, 2>;
};
[[group(0), binding(0)]] var<storage, read_write> ssbo : SSBO;
diff --git a/src/tests/end2end/ColorStateTests.cpp b/src/tests/end2end/ColorStateTests.cpp
index 478d61a..1fd3845 100644
--- a/src/tests/end2end/ColorStateTests.cpp
+++ b/src/tests/end2end/ColorStateTests.cpp
@@ -61,7 +61,7 @@
// attachment. basePipeline has no blending
void SetupSingleSourcePipelines(wgpu::ColorTargetState colorTargetState) {
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct MyBlock {
+ struct MyBlock {
color : vec4<f32>;
};
@@ -791,7 +791,7 @@
{renderTargetViews[0], renderTargetViews[1], renderTargetViews[2], renderTargetViews[3]});
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct MyBlock {
+ struct MyBlock {
color0 : vec4<f32>;
color1 : vec4<f32>;
color2 : vec4<f32>;
@@ -915,7 +915,7 @@
// Test that the default blend color is correctly set at the beginning of every subpass
TEST_P(ColorStateTest, DefaultBlendColor) {
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct MyBlock {
+ struct MyBlock {
color : vec4<f32>;
};
@@ -1041,7 +1041,7 @@
// attachment.
TEST_P(ColorStateTest, ColorWriteMaskDoesNotAffectRenderPassLoadOpClear) {
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct MyBlock {
+ struct MyBlock {
color : vec4<f32>;
};
diff --git a/src/tests/end2end/ComputeCopyStorageBufferTests.cpp b/src/tests/end2end/ComputeCopyStorageBufferTests.cpp
index 6b60a0e..8739c23 100644
--- a/src/tests/end2end/ComputeCopyStorageBufferTests.cpp
+++ b/src/tests/end2end/ComputeCopyStorageBufferTests.cpp
@@ -88,7 +88,7 @@
// Test that a trivial compute-shader memcpy implementation works.
TEST_P(ComputeCopyStorageBufferTests, SizedArrayOfBasic) {
BasicTest(R"(
- [[block]] struct Buf {
+ struct Buf {
s : array<vec4<u32>, 4>;
};
@@ -111,7 +111,7 @@
b : vec2<u32>;
};
- [[block]] struct Buf {
+ struct Buf {
s : array<S, 4>;
};
@@ -129,7 +129,7 @@
// Test that a trivial compute-shader memcpy implementation works.
TEST_P(ComputeCopyStorageBufferTests, UnsizedArrayOfBasic) {
BasicTest(R"(
- [[block]] struct Buf {
+ struct Buf {
s : array<vec4<u32>>;
};
diff --git a/src/tests/end2end/ComputeDispatchTests.cpp b/src/tests/end2end/ComputeDispatchTests.cpp
index f335f26..727d88f 100644
--- a/src/tests/end2end/ComputeDispatchTests.cpp
+++ b/src/tests/end2end/ComputeDispatchTests.cpp
@@ -28,7 +28,7 @@
// Write workgroup number into the output buffer if we saw the biggest dispatch
// To make sure the dispatch was not called, write maximum u32 value for 0 dispatches
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct OutputBuf {
+ struct OutputBuf {
workGroups : vec3<u32>;
};
@@ -54,10 +54,10 @@
// Test the use of the compute pipelines without using [[num_workgroups]]
wgpu::ShaderModule moduleWithoutNumWorkgroups = utils::CreateShaderModule(device, R"(
- [[block]] struct InputBuf {
+ struct InputBuf {
expectedDispatch : vec3<u32>;
};
- [[block]] struct OutputBuf {
+ struct OutputBuf {
workGroups : vec3<u32>;
};
diff --git a/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp b/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
index eeacf70..93f47d3 100644
--- a/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
+++ b/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp
@@ -174,17 +174,17 @@
footer : u32;
};
-[[block]] struct Input {
+struct Input {
header : u32;
{data_align}data : Data;
{footer_align}footer : u32;
};
-[[block]] struct Output {
+struct Output {
data : {field_type};
};
-[[block]] struct Status {
+struct Status {
code : u32;
};
diff --git a/src/tests/end2end/ComputeSharedMemoryTests.cpp b/src/tests/end2end/ComputeSharedMemoryTests.cpp
index 7519e68..ee27977 100644
--- a/src/tests/end2end/ComputeSharedMemoryTests.cpp
+++ b/src/tests/end2end/ComputeSharedMemoryTests.cpp
@@ -74,7 +74,7 @@
let kTileSize : u32 = 4u;
let kInstances : u32 = 11u;
- [[block]] struct Dst {
+ struct Dst {
x : u32;
};
@@ -110,7 +110,7 @@
m: mat2x2<f32>;
};
- [[block]] struct Dst {
+ struct Dst {
d_struct : StructValues;
d_matrix : mat2x2<f32>;
d_array : array<u32, 4>;
diff --git a/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp b/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp
index ccf65fd..12fa33d 100644
--- a/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp
+++ b/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp
@@ -32,7 +32,7 @@
device, data.data(), bufferSize, wgpu::BufferUsage::Storage | wgpu::BufferUsage::CopySrc);
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct Buf {
+ struct Buf {
data : array<u32, 100>;
};
@@ -82,7 +82,7 @@
device, data.data(), bufferSize, wgpu::BufferUsage::Storage | wgpu::BufferUsage::CopySrc);
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct Buf {
+ struct Buf {
data : array<u32, 100>;
};
@@ -148,7 +148,7 @@
device, data.data(), bufferSize, wgpu::BufferUsage::Storage | wgpu::BufferUsage::CopySrc);
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct Buf {
+ struct Buf {
data : array<u32, 100>;
};
@@ -216,7 +216,7 @@
wgpu::BufferUsage::Storage | wgpu::BufferUsage::Uniform | wgpu::BufferUsage::CopySrc);
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct Buf {
+ struct Buf {
data : array<vec4<u32>, 25>;
};
@@ -284,7 +284,7 @@
wgpu::BufferUsage::Storage | wgpu::BufferUsage::Uniform | wgpu::BufferUsage::CopySrc);
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct Buf {
+ struct Buf {
data : array<vec4<u32>, 25>;
};
@@ -342,7 +342,7 @@
wgpu::ComputePipelineDescriptor step2PipelineDesc;
step2PipelineDesc.compute.entryPoint = "main";
step2PipelineDesc.compute.module = utils::CreateShaderModule(device, R"(
- [[block]] struct Buf {
+ struct Buf {
data : array<u32, 3>;
};
[[group(0), binding(0)]] var<storage, read_write> buf : Buf;
@@ -356,12 +356,12 @@
wgpu::ComputePipelineDescriptor step3PipelineDesc;
step3PipelineDesc.compute.entryPoint = "main";
step3PipelineDesc.compute.module = utils::CreateShaderModule(device, R"(
- [[block]] struct Buf {
+ struct Buf {
data : array<u32, 3>;
};
[[group(0), binding(0)]] var<storage, read> buf : Buf;
- [[block]] struct Result {
+ struct Result {
data : u32;
};
[[group(0), binding(1)]] var<storage, read_write> result : Result;
diff --git a/src/tests/end2end/CopyTextureForBrowserTests.cpp b/src/tests/end2end/CopyTextureForBrowserTests.cpp
index f0284e4..2da9062 100644
--- a/src/tests/end2end/CopyTextureForBrowserTests.cpp
+++ b/src/tests/end2end/CopyTextureForBrowserTests.cpp
@@ -247,7 +247,7 @@
// comparing a value generated on CPU to the one generated on GPU.
wgpu::ComputePipeline MakeTestPipeline() {
wgpu::ShaderModule csModule = utils::CreateShaderModule(this->device, R"(
- [[block]] struct Uniforms {
+ struct Uniforms {
dstTextureFlipY : u32;
channelCount : u32;
srcCopyOrigin : vec2<u32>;
@@ -255,7 +255,7 @@
copySize : vec2<u32>;
alphaOp : u32;
};
- [[block]] struct OutputBuf {
+ struct OutputBuf {
result : array<u32>;
};
[[group(0), binding(0)]] var src : texture_2d<f32>;
diff --git a/src/tests/end2end/CreatePipelineAsyncTests.cpp b/src/tests/end2end/CreatePipelineAsyncTests.cpp
index 4a6d2b7..4344e99 100644
--- a/src/tests/end2end/CreatePipelineAsyncTests.cpp
+++ b/src/tests/end2end/CreatePipelineAsyncTests.cpp
@@ -133,7 +133,7 @@
TEST_P(CreatePipelineAsyncTest, BasicUseOfCreateComputePipelineAsync) {
wgpu::ComputePipelineDescriptor csDesc;
csDesc.compute.module = utils::CreateShaderModule(device, R"(
- [[block]] struct SSBO {
+ struct SSBO {
value : u32;
};
[[group(0), binding(0)]] var<storage, read_write> ssbo : SSBO;
@@ -163,7 +163,7 @@
TEST_P(CreatePipelineAsyncTest, ReleaseEntryPointAfterCreatComputePipelineAsync) {
wgpu::ComputePipelineDescriptor csDesc;
csDesc.compute.module = utils::CreateShaderModule(device, R"(
- [[block]] struct SSBO {
+ struct SSBO {
value : u32;
};
[[group(0), binding(0)]] var<storage, read_write> ssbo : SSBO;
@@ -202,7 +202,7 @@
wgpu::ComputePipelineDescriptor csDesc;
csDesc.compute.module = utils::CreateShaderModule(device, R"(
- [[block]] struct SSBO {
+ struct SSBO {
value : u32;
};
[[group(0), binding(0)]] var<storage, read_write> ssbo : SSBO;
@@ -482,7 +482,7 @@
TEST_P(CreatePipelineAsyncTest, CreateSameComputePipelineTwice) {
wgpu::ComputePipelineDescriptor csDesc;
csDesc.compute.module = utils::CreateShaderModule(device, R"(
- [[block]] struct SSBO {
+ struct SSBO {
value : u32;
};
[[group(0), binding(0)]] var<storage, read_write> ssbo : SSBO;
@@ -541,7 +541,7 @@
wgpu::ComputePipelineDescriptor csDesc;
csDesc.layout = pipelineLayout;
csDesc.compute.module = utils::CreateShaderModule(device, R"(
- [[block]] struct SSBO {
+ struct SSBO {
value : u32;
};
[[group(0), binding(0)]] var<storage, read_write> ssbo : SSBO;
diff --git a/src/tests/end2end/D3D12CachingTests.cpp b/src/tests/end2end/D3D12CachingTests.cpp
index 00eab66..b2cab47 100644
--- a/src/tests/end2end/D3D12CachingTests.cpp
+++ b/src/tests/end2end/D3D12CachingTests.cpp
@@ -208,7 +208,7 @@
// of HLSL shaders. WGSL shader should result into caching 1 HLSL shader (stage x entrypoints)
TEST_P(D3D12CachingTests, ReuseShaderWithMultipleEntryPoints) {
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct Data {
+ struct Data {
data : u32;
};
[[binding(0), group(0)]] var<storage, read_write> data : Data;
diff --git a/src/tests/end2end/DepthStencilSamplingTests.cpp b/src/tests/end2end/DepthStencilSamplingTests.cpp
index e916e6d..7ac870a 100644
--- a/src/tests/end2end/DepthStencilSamplingTests.cpp
+++ b/src/tests/end2end/DepthStencilSamplingTests.cpp
@@ -70,10 +70,10 @@
std::ostringstream& shaderBody) {
shaderSource << "type StencilValues = array<u32, " << components.size() << ">;\n";
shaderSource << R"(
- [[block]] struct DepthResult {
+ struct DepthResult {
value : f32;
};
- [[block]] struct StencilResult {
+ struct StencilResult {
values : StencilValues;
};)";
shaderSource << "\n";
@@ -181,7 +181,7 @@
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var samp : sampler_comparison;
[[group(0), binding(1)]] var tex : texture_depth_2d;
- [[block]] struct Uniforms {
+ struct Uniforms {
compareRef : f32;
};
[[group(0), binding(2)]] var<uniform> uniforms : Uniforms;
@@ -203,12 +203,12 @@
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var samp : sampler_comparison;
[[group(0), binding(1)]] var tex : texture_depth_2d;
- [[block]] struct Uniforms {
+ struct Uniforms {
compareRef : f32;
};
[[group(0), binding(2)]] var<uniform> uniforms : Uniforms;
- [[block]] struct SamplerResult {
+ struct SamplerResult {
value : f32;
};
[[group(0), binding(3)]] var<storage, read_write> samplerResult : SamplerResult;
diff --git a/src/tests/end2end/DepthStencilStateTests.cpp b/src/tests/end2end/DepthStencilStateTests.cpp
index efe3e53..73e9aad 100644
--- a/src/tests/end2end/DepthStencilStateTests.cpp
+++ b/src/tests/end2end/DepthStencilStateTests.cpp
@@ -56,7 +56,7 @@
depthTextureView = depthTexture.CreateView();
vsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct UBO {
+ struct UBO {
color : vec3<f32>;
depth : f32;
};
@@ -75,7 +75,7 @@
})");
fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct UBO {
+ struct UBO {
color : vec3<f32>;
depth : f32;
};
diff --git a/src/tests/end2end/DeviceLostTests.cpp b/src/tests/end2end/DeviceLostTests.cpp
index 91bdabe..57a4bff 100644
--- a/src/tests/end2end/DeviceLostTests.cpp
+++ b/src/tests/end2end/DeviceLostTests.cpp
@@ -112,7 +112,7 @@
// Test that GetBindGroupLayout fails when device is lost
TEST_P(DeviceLostTest, GetBindGroupLayoutFails) {
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
- [[block]] struct UniformBuffer {
+ struct UniformBuffer {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> ubo : UniformBuffer;
diff --git a/src/tests/end2end/DrawIndexedIndirectTests.cpp b/src/tests/end2end/DrawIndexedIndirectTests.cpp
index 0a8a83f..6f56904 100644
--- a/src/tests/end2end/DrawIndexedIndirectTests.cpp
+++ b/src/tests/end2end/DrawIndexedIndirectTests.cpp
@@ -595,8 +595,8 @@
wgpu::ShaderModule paramWriterModule = utils::CreateShaderModule(device,
R"(
- [[block]] struct Input { firstIndex: u32; };
- [[block]] struct Params {
+ struct Input { firstIndex: u32; };
+ struct Params {
indexCount: u32;
instanceCount: u32;
firstIndex: u32;
diff --git a/src/tests/end2end/DynamicBufferOffsetTests.cpp b/src/tests/end2end/DynamicBufferOffsetTests.cpp
index 77f1e7e..a83b86c 100644
--- a/src/tests/end2end/DynamicBufferOffsetTests.cpp
+++ b/src/tests/end2end/DynamicBufferOffsetTests.cpp
@@ -115,7 +115,7 @@
std::ostringstream fs;
std::string multipleNumber = isInheritedPipeline ? "2" : "1";
fs << R"(
- [[block]] struct Buf {
+ struct Buf {
value : vec2<u32>;
};
@@ -165,7 +165,7 @@
std::ostringstream cs;
std::string multipleNumber = isInheritedPipeline ? "2" : "1";
cs << R"(
- [[block]] struct Buf {
+ struct Buf {
value : vec2<u32>;
};
@@ -453,7 +453,7 @@
switch (GetParam().mReadBufferUsage) {
case wgpu::BufferUsage::Uniform:
shader << R"(
- [[block]] struct Src {
+ struct Src {
values : array<vec4<u32>, kArrayLength>;
};
[[group(0), binding(0)]] var<uniform> src : Src;
@@ -461,7 +461,7 @@
break;
case wgpu::BufferUsage::Storage:
shader << R"(
- [[block]] struct Src {
+ struct Src {
values : array<vec4<u32>>;
};
[[group(0), binding(0)]] var<storage, read> src : Src;
@@ -472,7 +472,7 @@
}
shader << R"(
- [[block]] struct Dst {
+ struct Dst {
values : array<vec4<u32>>;
};
[[group(0), binding(1)]] var<storage, read_write> dst : Dst;
diff --git a/src/tests/end2end/EntryPointTests.cpp b/src/tests/end2end/EntryPointTests.cpp
index 5b760c5..5eb356b 100644
--- a/src/tests/end2end/EntryPointTests.cpp
+++ b/src/tests/end2end/EntryPointTests.cpp
@@ -78,7 +78,7 @@
wgpu::PipelineLayout pipelineLayout = device.CreatePipelineLayout(&pipelineLayoutDesc);
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct Data {
+ struct Data {
data : u32;
};
[[binding(0), group(0)]] var<storage, read_write> data : Data;
diff --git a/src/tests/end2end/FirstIndexOffsetTests.cpp b/src/tests/end2end/FirstIndexOffsetTests.cpp
index 5ab3ca3..2fc6672 100644
--- a/src/tests/end2end/FirstIndexOffsetTests.cpp
+++ b/src/tests/end2end/FirstIndexOffsetTests.cpp
@@ -127,7 +127,7 @@
})";
std::string fragmentShader = R"(
-[[block]] struct IndexVals {
+struct IndexVals {
vertex_index : atomic<u32>;
instance_index : atomic<u32>;
};
diff --git a/src/tests/end2end/GpuMemorySynchronizationTests.cpp b/src/tests/end2end/GpuMemorySynchronizationTests.cpp
index a6fe141..3c9d273 100644
--- a/src/tests/end2end/GpuMemorySynchronizationTests.cpp
+++ b/src/tests/end2end/GpuMemorySynchronizationTests.cpp
@@ -36,7 +36,7 @@
std::tuple<wgpu::ComputePipeline, wgpu::BindGroup> CreatePipelineAndBindGroupForCompute(
const wgpu::Buffer& buffer) {
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
- [[block]] struct Data {
+ struct Data {
a : i32;
};
[[group(0), binding(0)]] var<storage, read_write> data : Data;
@@ -63,7 +63,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct Data {
+ struct Data {
i : i32;
};
[[group(0), binding(0)]] var<storage, read_write> data : Data;
@@ -243,7 +243,7 @@
std::tuple<wgpu::ComputePipeline, wgpu::BindGroup> CreatePipelineAndBindGroupForCompute() {
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
- [[block]] struct Data {
+ struct Data {
a : f32;
};
[[group(0), binding(0)]] var<storage, read_write> data : Data;
@@ -269,7 +269,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct Contents {
+ struct Contents {
color : f32;
};
[[group(0), binding(0)]] var<uniform> contents : Contents;
@@ -440,17 +440,17 @@
TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) {
// Create pipeline, bind group, and different buffers for compute pass.
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
- [[block]] struct VBContents {
+ struct VBContents {
pos : array<vec4<f32>, 4>;
};
[[group(0), binding(0)]] var<storage, read_write> vbContents : VBContents;
- [[block]] struct IBContents {
+ struct IBContents {
indices : array<vec4<i32>, 2>;
};
[[group(0), binding(1)]] var<storage, read_write> ibContents : IBContents;
- [[block]] struct ColorContents {
+ struct ColorContents {
color : f32;
};
[[group(0), binding(2)]] var<storage, read_write> uniformContents : ColorContents;
@@ -503,7 +503,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct Buf {
+ struct Buf {
color : f32;
};
@@ -562,7 +562,7 @@
// Create pipeline, bind group, and a complex buffer for compute pass.
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
- [[block]] struct Contents {
+ struct Contents {
[[align(256)]] pos : array<vec4<f32>, 4>;
[[align(256)]] indices : array<vec4<i32>, 2>;
[[align(256)]] color0 : f32;
@@ -620,7 +620,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct Buf {
+ struct Buf {
color : f32;
};
[[group(0), binding(0)]] var<uniform> uniformBuffer : Buf;
diff --git a/src/tests/end2end/MaxLimitTests.cpp b/src/tests/end2end/MaxLimitTests.cpp
index dd24bd7..52d3216 100644
--- a/src/tests/end2end/MaxLimitTests.cpp
+++ b/src/tests/end2end/MaxLimitTests.cpp
@@ -33,7 +33,7 @@
GetSupportedLimits().limits.maxComputeWorkgroupStorageSize;
std::string shader = R"(
- [[block]] struct Dst {
+ struct Dst {
value0 : u32;
value1 : u32;
};
@@ -129,11 +129,11 @@
std::min(maxBufferBindingSize, uint64_t(512) * 1024 * 1024);
}
shader = R"(
- [[block]] struct Buf {
+ struct Buf {
values : array<u32>;
};
- [[block]] struct Result {
+ struct Result {
value0 : u32;
value1 : u32;
};
@@ -156,7 +156,7 @@
uint64_t(std::numeric_limits<int32_t>::max()) + 8);
shader = R"(
- [[block]] struct Buf {
+ struct Buf {
value0 : u32;
// padding such that value0 and value1 are the first and last bytes of the memory.
[[size()" +
@@ -164,7 +164,7 @@
value1 : u32;
};
- [[block]] struct Result {
+ struct Result {
value0 : u32;
value1 : u32;
};
diff --git a/src/tests/end2end/MultisampledRenderingTests.cpp b/src/tests/end2end/MultisampledRenderingTests.cpp
index e97efe8..3b7564d 100644
--- a/src/tests/end2end/MultisampledRenderingTests.cpp
+++ b/src/tests/end2end/MultisampledRenderingTests.cpp
@@ -45,7 +45,7 @@
bool alphaToCoverageEnabled = false,
bool flipTriangle = false) {
const char* kFsOneOutputWithDepth = R"(
- [[block]] struct U {
+ struct U {
color : vec4<f32>;
depth : f32;
};
@@ -64,7 +64,7 @@
})";
const char* kFsOneOutputWithoutDepth = R"(
- [[block]] struct U {
+ struct U {
color : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> uBuffer : U;
@@ -83,7 +83,7 @@
uint32_t sampleMask = 0xFFFFFFFF,
bool alphaToCoverageEnabled = false) {
const char* kFsTwoOutputs = R"(
- [[block]] struct U {
+ struct U {
color0 : vec4<f32>;
color1 : vec4<f32>;
};
@@ -777,7 +777,7 @@
constexpr float kMSAACoverage = 0.25f;
constexpr uint32_t kSampleMask = kFirstSampleMaskBit | kThirdSampleMaskBit;
const char* fs = R"(
- [[block]] struct U {
+ struct U {
color : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> uBuffer : U;
@@ -838,7 +838,7 @@
// only the first one is covered by the triangle.
constexpr float kMSAACoverage = 0.25f;
const char* fs = R"(
- [[block]] struct U {
+ struct U {
color0 : vec4<f32>;
color1 : vec4<f32>;
};
diff --git a/src/tests/end2end/MultisampledSamplingTests.cpp b/src/tests/end2end/MultisampledSamplingTests.cpp
index 160555d..f2251c1 100644
--- a/src/tests/end2end/MultisampledSamplingTests.cpp
+++ b/src/tests/end2end/MultisampledSamplingTests.cpp
@@ -99,7 +99,7 @@
[[group(0), binding(0)]] var texture0 : texture_multisampled_2d<f32>;
[[group(0), binding(1)]] var texture1 : texture_depth_multisampled_2d;
- [[block]] struct Results {
+ struct Results {
colorSamples : array<f32, 4>;
depthSamples : array<f32, 4>;
};
diff --git a/src/tests/end2end/OpArrayLengthTests.cpp b/src/tests/end2end/OpArrayLengthTests.cpp
index 105a754..6a3cc1f 100644
--- a/src/tests/end2end/OpArrayLengthTests.cpp
+++ b/src/tests/end2end/OpArrayLengthTests.cpp
@@ -53,7 +53,7 @@
// Common shader code to use these buffers in shaders, assuming they are in bindgroup index
// 0.
mShaderInterface = R"(
- [[block]] struct DataBuffer {
+ struct DataBuffer {
data : [[stride(4)]] array<f32>;
};
@@ -70,7 +70,7 @@
b : i32;
};
- [[block]] struct Buffer3 {
+ struct Buffer3 {
[[size(64)]] garbage : mat4x4<f32>;
data : [[stride(8)]] array<Buffer3Data>;
};
@@ -120,7 +120,7 @@
pipelineDesc.layout = pl;
pipelineDesc.compute.entryPoint = "main";
pipelineDesc.compute.module = utils::CreateShaderModule(device, (R"(
- [[block]] struct ResultBuffer {
+ struct ResultBuffer {
data : [[stride(4)]] array<u32, 3>;
};
[[group(1), binding(0)]] var<storage, read_write> result : ResultBuffer;
diff --git a/src/tests/end2end/PrimitiveStateTests.cpp b/src/tests/end2end/PrimitiveStateTests.cpp
index c9a4c16..5bf00b7 100644
--- a/src/tests/end2end/PrimitiveStateTests.cpp
+++ b/src/tests/end2end/PrimitiveStateTests.cpp
@@ -45,7 +45,7 @@
depthTextureView = depthTexture.CreateView();
vsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct UBO {
+ struct UBO {
color : vec3<f32>;
depth : f32;
};
@@ -56,7 +56,7 @@
})");
fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct UBO {
+ struct UBO {
color : vec3<f32>;
depth : f32;
};
diff --git a/src/tests/end2end/RenderBundleTests.cpp b/src/tests/end2end/RenderBundleTests.cpp
index 723002b..cc966ba 100644
--- a/src/tests/end2end/RenderBundleTests.cpp
+++ b/src/tests/end2end/RenderBundleTests.cpp
@@ -38,7 +38,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct Ubo {
+ struct Ubo {
color : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> fragmentUniformBuffer : Ubo;
diff --git a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp
index 22679d3..424ae70 100644
--- a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp
+++ b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp
@@ -38,7 +38,7 @@
mRenderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct Uniforms {
+ struct Uniforms {
matrix : mat4x4<f32>;
};
diff --git a/src/tests/end2end/ShaderTests.cpp b/src/tests/end2end/ShaderTests.cpp
index 2902a35..4a06917 100644
--- a/src/tests/end2end/ShaderTests.cpp
+++ b/src/tests/end2end/ShaderTests.cpp
@@ -50,7 +50,7 @@
wgpu::Buffer buffer = CreateBuffer(kSteps);
std::string shader = R"(
-[[block]] struct Buf {
+struct Buf {
data : array<u32, 19>;
};
@@ -335,7 +335,7 @@
};
// [1] a binding point that conflicts with the regitster
-[[block]] struct S1 { data : array<vec4<u32>, 20>; };
+struct S1 { data : array<vec4<u32>, 20>; };
[[group(0), binding(1)]] var<uniform> providedData1 : S1;
[[stage(vertex)]] fn vsMain(input : Inputs) -> [[builtin(position)]] vec4<f32> {
@@ -412,7 +412,7 @@
[[override]] let c9: u32 = 0u; // default override
[[override]] let c10: u32 = 10u; // default
-[[block]] struct Buf {
+struct Buf {
data : array<u32, 11>;
};
@@ -482,7 +482,7 @@
[[override(1003)]] let c3: u32 = 3u; // default
[[override(1004)]] let c4: u32; // default unspecified
-[[block]] struct Buf {
+struct Buf {
data : array<u32, 4>;
};
@@ -539,7 +539,7 @@
[[override(1001)]] let c1: f32;
[[override(1002)]] let c2: f32;
-[[block]] struct Buf {
+struct Buf {
data : array<f32, 2>;
};
@@ -593,7 +593,7 @@
[[override(1001)]] let c1: u32;
[[override(1002)]] let c2: u32;
-[[block]] struct Buf {
+struct Buf {
data : array<u32, 1>;
};
diff --git a/src/tests/end2end/TextureZeroInitTests.cpp b/src/tests/end2end/TextureZeroInitTests.cpp
index fd22849..55f7b53 100644
--- a/src/tests/end2end/TextureZeroInitTests.cpp
+++ b/src/tests/end2end/TextureZeroInitTests.cpp
@@ -983,7 +983,7 @@
wgpu::ProgrammableStageDescriptor compute;
const char* cs = R"(
[[group(0), binding(0)]] var tex : texture_2d<f32>;
- [[block]] struct Result {
+ struct Result {
value : vec4<f32>;
};
[[group(0), binding(1)]] var<storage, read_write> result : Result;
diff --git a/src/tests/perf_tests/DrawCallPerf.cpp b/src/tests/perf_tests/DrawCallPerf.cpp
index 7999a5a..79955be 100644
--- a/src/tests/perf_tests/DrawCallPerf.cpp
+++ b/src/tests/perf_tests/DrawCallPerf.cpp
@@ -39,7 +39,7 @@
})";
constexpr char kFragmentShaderA[] = R"(
- [[block]] struct Uniforms {
+ struct Uniforms {
color : vec3<f32>;
};
[[group(0), binding(0)]] var<uniform> uniforms : Uniforms;
@@ -48,10 +48,10 @@
})";
constexpr char kFragmentShaderB[] = R"(
- [[block]] struct Constants {
+ struct Constants {
color : vec3<f32>;
};
- [[block]] struct Uniforms {
+ struct Uniforms {
color : vec3<f32>;
};
[[group(0), binding(0)]] var<uniform> constants : Constants;
diff --git a/src/tests/perf_tests/ShaderRobustnessPerf.cpp b/src/tests/perf_tests/ShaderRobustnessPerf.cpp
index 4d8e8c2..64353c4 100644
--- a/src/tests/perf_tests/ShaderRobustnessPerf.cpp
+++ b/src/tests/perf_tests/ShaderRobustnessPerf.cpp
@@ -20,12 +20,12 @@
constexpr uint32_t kTileSize = 32u;
const std::string& kMatMulFloatHeader = R"(
- [[block]] struct Uniforms {
+ struct Uniforms {
dimAOuter : u32;
dimInner : u32;
dimBOuter : u32;
};
- [[block]] struct Matrix {
+ struct Matrix {
numbers: array<f32>;
};
@@ -187,12 +187,12 @@
// The vec4 version requires that dimInner and dimBOuter are divisible by 4.
const std::string& kMatMulVec4Header = R"(
- [[block]] struct Uniforms {
+ struct Uniforms {
dimAOuter : u32;
dimInner : u32;
dimBOuter : u32;
};
- [[block]] struct Matrix {
+ struct Matrix {
numbers: array<vec4<f32>>;
};
diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp
index 7c00ff8..4051aca 100644
--- a/src/tests/unittests/validation/BindGroupValidationTests.cpp
+++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp
@@ -1419,7 +1419,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
value : vec2<f32>;
};
@@ -1443,7 +1443,7 @@
wgpu::ComputePipeline CreateComputePipeline() {
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
value : vec2<f32>;
};
@@ -1871,7 +1871,7 @@
device.CreatePipelineLayout(&pipelineLayoutDescriptor);
std::stringstream ss;
- ss << "[[block]] struct S { value : vec2<f32>; };";
+ ss << "struct S { value : vec2<f32>; };";
// Build a shader which has bindings that match the pipeline layout.
for (uint32_t l = 0; l < layouts.size(); ++l) {
@@ -2051,7 +2051,7 @@
wgpu::RenderPipeline CreateRenderPipeline(std::vector<wgpu::BindGroupLayout> bindGroupLayouts) {
return CreateFSRenderPipeline(R"(
- [[block]] struct S {
+ struct S {
value : vec2<f32>;
};
@@ -2086,7 +2086,7 @@
wgpu::ComputePipeline CreateComputePipeline(
std::vector<wgpu::BindGroupLayout> bindGroupLayouts) {
return CreateComputePipeline(R"(
- [[block]] struct S {
+ struct S {
value : vec2<f32>;
};
diff --git a/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp b/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp
index 23d01ab..62ccab9 100644
--- a/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp
+++ b/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp
@@ -46,7 +46,7 @@
DAWN_SKIP_TEST_IF(UsesWire());
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> uniform0 : S;
@@ -59,12 +59,12 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct S2 {
+ struct S2 {
pos : vec4<f32>;
};
[[group(2), binding(0)]] var<uniform> uniform2 : S2;
- [[block]] struct S3 {
+ struct S3 {
pos : mat4x4<f32>;
};
[[group(3), binding(0)]] var<storage, read_write> storage3 : S3;
@@ -98,7 +98,7 @@
// Test that default BindGroupLayouts cannot be used in the creation of a new PipelineLayout
TEST_F(GetBindGroupLayoutTests, DefaultBindGroupLayoutPipelineCompatibility) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
@@ -120,7 +120,7 @@
DAWN_SKIP_TEST_IF(UsesWire());
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
@@ -290,7 +290,7 @@
DAWN_SKIP_TEST_IF(UsesWire());
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
@@ -343,7 +343,7 @@
binding.visibility = wgpu::ShaderStage::Fragment;
binding.buffer.type = wgpu::BufferBindingType::Storage;
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<storage, read_write> ssbo : S;
@@ -357,7 +357,7 @@
{
binding.buffer.type = wgpu::BufferBindingType::Uniform;
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
@@ -372,7 +372,7 @@
{
binding.buffer.type = wgpu::BufferBindingType::ReadOnlyStorage;
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<storage, read> ssbo : S;
@@ -612,7 +612,7 @@
{
binding.binding = 0;
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
@@ -627,7 +627,7 @@
{
binding.binding = 1;
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(1)]] var<uniform> uniforms : S;
@@ -642,7 +642,7 @@
{
binding.binding = 2;
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(1)]] var<uniform> uniforms : S;
@@ -658,7 +658,7 @@
// Test it is valid to have duplicate bindings in the shaders.
TEST_F(GetBindGroupLayoutTests, DuplicateBinding) {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> uniform0 : S;
@@ -671,7 +671,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(1), binding(0)]] var<uniform> uniforms : S;
@@ -697,7 +697,7 @@
DAWN_SKIP_TEST_IF(UsesWire());
wgpu::ShaderModule vsModule4 = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
pos : f32;
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
@@ -708,7 +708,7 @@
})");
wgpu::ShaderModule vsModule64 = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
pos : mat4x4<f32>;
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
@@ -719,7 +719,7 @@
})");
wgpu::ShaderModule fsModule4 = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
pos : f32;
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
@@ -729,7 +729,7 @@
})");
wgpu::ShaderModule fsModule64 = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
pos : mat4x4<f32>;
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
@@ -864,7 +864,7 @@
// Test it is invalid to have conflicting binding types in the shaders.
TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> ubo : S;
@@ -875,7 +875,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<storage, read_write> ssbo : S;
@@ -988,7 +988,7 @@
DAWN_SKIP_TEST_IF(UsesWire());
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> uniforms0 : S;
@@ -1041,7 +1041,7 @@
wgpu::PipelineLayout pipelineLayout = device.CreatePipelineLayout(&pipelineLayoutDesc);
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
pos : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
@@ -1082,7 +1082,7 @@
// Test that fragment output validation is for the correct entryPoint
TEST_F(GetBindGroupLayoutTests, FromCorrectEntryPoint) {
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct Data {
+ struct Data {
data : f32;
};
[[group(0), binding(0)]] var<storage, read_write> data0 : Data;
diff --git a/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp b/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp
index e673361..4fa95ab 100644
--- a/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp
+++ b/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp
@@ -73,7 +73,7 @@
std::ostringstream ostream;
size_t index = 0;
for (const BindingDescriptor& b : bindings) {
- ostream << "[[block]] struct S" << index << " { " << b.decl << "};\n";
+ ostream << "struct S" << index << " { " << b.decl << "};\n";
ostream << "[[group(" << b.group << "), binding(" << b.binding << ")]] ";
switch (b.type) {
case wgpu::BufferBindingType::Uniform:
diff --git a/src/tests/unittests/validation/RenderBundleValidationTests.cpp b/src/tests/unittests/validation/RenderBundleValidationTests.cpp
index bb3a01a..0799f90 100644
--- a/src/tests/unittests/validation/RenderBundleValidationTests.cpp
+++ b/src/tests/unittests/validation/RenderBundleValidationTests.cpp
@@ -28,7 +28,7 @@
ValidationTest::SetUp();
vsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct S {
+ struct S {
transform : mat2x2<f32>;
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
@@ -38,12 +38,12 @@
})");
fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct Uniforms {
+ struct Uniforms {
color : vec4<f32>;
};
[[group(1), binding(0)]] var<uniform> uniforms : Uniforms;
- [[block]] struct Storage {
+ struct Storage {
dummy : array<f32>;
};
[[group(1), binding(1)]] var<storage, read_write> ssbo : Storage;
diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp
index d7d2d13..ea403d8 100644
--- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp
+++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp
@@ -765,7 +765,7 @@
// cause crash.
TEST_F(RenderPipelineValidationTest, StorageBufferInVertexShaderNoLayout) {
wgpu::ShaderModule vsModuleWithStorageBuffer = utils::CreateShaderModule(device, R"(
- [[block]] struct Dst {
+ struct Dst {
data : array<u32, 100>;
};
[[group(0), binding(0)]] var<storage, read_write> dst : Dst;
@@ -1124,7 +1124,7 @@
// Test that fragment output validation is for the correct entryPoint
TEST_F(RenderPipelineValidationTest, BindingsFromCorrectEntryPoint) {
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct Uniforms {
+ struct Uniforms {
data : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> var0 : Uniforms;
diff --git a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
index fcc98ce..29c3da0 100644
--- a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
+++ b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
@@ -761,7 +761,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
- [[block]] struct RBuffer {
+ struct RBuffer {
value : f32;
};
[[group(0), binding(0)]] var<storage, read> rBuffer : RBuffer;
diff --git a/src/tests/unittests/validation/ShaderModuleValidationTests.cpp b/src/tests/unittests/validation/ShaderModuleValidationTests.cpp
index fecb6dd3..4ff0edb 100644
--- a/src/tests/unittests/validation/ShaderModuleValidationTests.cpp
+++ b/src/tests/unittests/validation/ShaderModuleValidationTests.cpp
@@ -503,7 +503,7 @@
[[override(1234)]] let c0: u32;
[[override(1234)]] let c1: u32;
-[[block]] struct Buf {
+struct Buf {
data : array<u32, 2>;
};
diff --git a/src/tests/white_box/D3D12DescriptorHeapTests.cpp b/src/tests/white_box/D3D12DescriptorHeapTests.cpp
index 513a165..14bf526 100644
--- a/src/tests/white_box/D3D12DescriptorHeapTests.cpp
+++ b/src/tests/white_box/D3D12DescriptorHeapTests.cpp
@@ -53,7 +53,7 @@
})");
mSimpleFSModule = utils::CreateShaderModule(device, R"(
- [[block]] struct U {
+ struct U {
color : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> colorBuffer : U;
@@ -444,7 +444,7 @@
pipelineDescriptor.vertex.module = mSimpleVSModule;
pipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"(
- [[block]] struct U {
+ struct U {
heapSize : f32;
};
[[group(0), binding(0)]] var<uniform> buffer0 : U;
@@ -777,7 +777,7 @@
utils::ComboRenderPipelineDescriptor pipelineDescriptor;
pipelineDescriptor.vertex.module = utils::CreateShaderModule(device, R"(
- [[block]] struct U {
+ struct U {
transform : mat2x2<f32>;
};
[[group(0), binding(0)]] var<uniform> buffer0 : U;
@@ -793,7 +793,7 @@
return vec4<f32>(buffer0.transform * (pos[VertexIndex]), 0.0, 1.0);
})");
pipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"(
- [[block]] struct U {
+ struct U {
color : vec4<f32>;
};
[[group(0), binding(1)]] var sampler0 : sampler;
diff --git a/src/tests/white_box/D3D12ResidencyTests.cpp b/src/tests/white_box/D3D12ResidencyTests.cpp
index ec60e79..6622db1 100644
--- a/src/tests/white_box/D3D12ResidencyTests.cpp
+++ b/src/tests/white_box/D3D12ResidencyTests.cpp
@@ -353,7 +353,7 @@
})");
renderPipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"(
- [[block]] struct U {
+ struct U {
color : vec4<f32>;
};
[[group(0), binding(0)]] var<uniform> colorBuffer : U;
diff --git a/src/tests/white_box/InternalStorageBufferBindingTests.cpp b/src/tests/white_box/InternalStorageBufferBindingTests.cpp
index fc9c18f..8ee4f1a 100644
--- a/src/tests/white_box/InternalStorageBufferBindingTests.cpp
+++ b/src/tests/white_box/InternalStorageBufferBindingTests.cpp
@@ -31,7 +31,7 @@
wgpu::ComputePipeline CreateComputePipelineWithInternalStorage() {
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
- [[block]] struct Buf {
+ struct Buf {
data : array<u32, 4>;
};