diff --git a/examples/Animometer.cpp b/examples/Animometer.cpp index badca6b3cc..488ce53b1e 100644 --- a/examples/Animometer.cpp +++ b/examples/Animometer.cpp @@ -58,7 +58,7 @@ void init() { 640, 480); wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( - [[block]] struct Constants { + struct Constants { scale : f32; time : f32; offsetX : f32; diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp index c302fb15c5..4418348757 100644 --- a/examples/ComputeBoids.cpp +++ b/examples/ComputeBoids.cpp @@ -151,7 +151,7 @@ void initSim() { pos : vec2; vel : vec2; }; - [[block]] struct SimParams { + struct SimParams { deltaT : f32; rule1Distance : f32; rule2Distance : f32; @@ -161,7 +161,7 @@ void initSim() { rule3Scale : f32; particleCount : u32; }; - [[block]] struct Particles { + struct Particles { particles : array; }; [[binding(0), group(0)]] var params : SimParams; diff --git a/src/dawn_native/ComputePassEncoder.cpp b/src/dawn_native/ComputePassEncoder.cpp index 383186892e..f7b9aa7150 100644 --- a/src/dawn_native/ComputePassEncoder.cpp +++ b/src/dawn_native/ComputePassEncoder.cpp @@ -45,18 +45,18 @@ namespace dawn_native { // Type 'bool' cannot be used in storage class 'uniform' as it is non-host-shareable. Ref 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; }; - [[block]] struct ValidatedParams { + struct ValidatedParams { data: array; }; diff --git a/src/dawn_native/CopyTextureForBrowserHelper.cpp b/src/dawn_native/CopyTextureForBrowserHelper.cpp index f9ab3fd766..90dfa7b201 100644 --- a/src/dawn_native/CopyTextureForBrowserHelper.cpp +++ b/src/dawn_native/CopyTextureForBrowserHelper.cpp @@ -48,7 +48,7 @@ namespace dawn_native { padding: u32; }; - [[block]] struct Uniforms { // offset align size + struct Uniforms { // offset align size scale: vec2; // 0 8 8 offset: vec2; // 8 8 8 steps_mask: u32; // 16 4 4 diff --git a/src/dawn_native/IndirectDrawValidationEncoder.cpp b/src/dawn_native/IndirectDrawValidationEncoder.cpp index a58f9b03cb..36c8d0a766 100644 --- a/src/dawn_native/IndirectDrawValidationEncoder.cpp +++ b/src/dawn_native/IndirectDrawValidationEncoder.cpp @@ -53,7 +53,7 @@ namespace dawn_native { let kBaseVertexEntry = 3u; let kFirstInstanceEntry = 4u; - [[block]] struct BatchInfo { + struct BatchInfo { numIndexBufferElementsLow: u32; numIndexBufferElementsHigh: u32; numDraws: u32; @@ -61,7 +61,7 @@ namespace dawn_native { indirectOffsets: array; }; - [[block]] struct IndirectParams { + struct IndirectParams { data: array; }; diff --git a/src/dawn_native/QueryHelper.cpp b/src/dawn_native/QueryHelper.cpp index 03d21943be..ef8e206ee1 100644 --- a/src/dawn_native/QueryHelper.cpp +++ b/src/dawn_native/QueryHelper.cpp @@ -40,15 +40,15 @@ namespace dawn_native { high : u32; }; - [[block]] struct TimestampArr { + struct TimestampArr { t : array; }; - [[block]] struct AvailabilityArr { + struct AvailabilityArr { v : array; }; - [[block]] struct TimestampParams { + struct TimestampParams { first : u32; count : u32; offset : u32; diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp index 57ed3f7c22..490b2cad23 100644 --- a/src/tests/DawnTest.cpp +++ b/src/tests/DawnTest.cpp @@ -1146,7 +1146,7 @@ std::ostringstream& DawnTestBase::ExpectSampledFloatDataImpl(wgpu::TextureView t 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; }; [[group(0), binding(1)]] var result : Result; diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp index f6693b861a..b364e0abe6 100644 --- a/src/tests/end2end/BindGroupTests.cpp +++ b/src/tests/end2end/BindGroupTests.cpp @@ -67,7 +67,7 @@ class BindGroupTests : public DawnTest { 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; };)"; @@ -129,7 +129,7 @@ class BindGroupTests : public DawnTest { // 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 contents: Contents; @@ -164,7 +164,7 @@ TEST_P(BindGroupTests, ReusedUBO) { 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; }; @@ -182,7 +182,7 @@ TEST_P(BindGroupTests, ReusedUBO) { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct FragmentUniformBuffer { + struct FragmentUniformBuffer { color : vec4; }; [[group(0), binding(1)]] var fragmentUbo : FragmentUniformBuffer; @@ -242,7 +242,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) { 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; }; [[group(0), binding(0)]] var vertexUbo : VertexUniformBuffer; @@ -345,7 +345,7 @@ TEST_P(BindGroupTests, MultipleBindLayouts) { 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; }; @@ -366,7 +366,7 @@ TEST_P(BindGroupTests, MultipleBindLayouts) { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct FragmentUniformBuffer { + struct FragmentUniformBuffer { color : vec4; }; @@ -435,7 +435,7 @@ TEST_P(BindGroupTests, MultipleBindLayouts) { // 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 contents0: Contents; @@ -1035,11 +1035,11 @@ TEST_P(BindGroupTests, DynamicOffsetOrder) { wgpu::ComputePipelineDescriptor pipelineDescriptor; pipelineDescriptor.compute.module = utils::CreateShaderModule(device, R"( - [[block]] struct Buffer { + struct Buffer { value : u32; }; - [[block]] struct OutputBuffer { + struct OutputBuffer { value : vec3; }; @@ -1118,11 +1118,11 @@ TEST_P(BindGroupTests, DynamicAndNonDynamicBindingsDoNotConflictAfterRemapping) wgpu::ComputePipelineDescriptor pipelineDescriptor; pipelineDescriptor.compute.module = utils::CreateShaderModule(device, R"( - [[block]] struct Buffer { + struct Buffer { value : u32; }; - [[block]] struct OutputBuffer { + struct OutputBuffer { value : vec2; }; @@ -1244,7 +1244,7 @@ TEST_P(BindGroupTests, ArbitraryBindingNumbers) { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct Ubo { + struct Ubo { color : vec4; }; @@ -1386,7 +1386,7 @@ TEST_P(BindGroupTests, ReadonlyStorage) { })"); pipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"( - [[block]] struct Buffer0 { + struct Buffer0 { color : vec4; }; [[group(0), binding(0)]] var buffer0 : Buffer0; @@ -1501,7 +1501,7 @@ TEST_P(BindGroupTests, ReallyLargeBindGroup) { 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 @@ TEST_P(BindGroupTests, ReallyLargeBindGroup) { 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 @@ TEST_P(BindGroupTests, ReallyLargeBindGroup) { 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 d559d61ca2..63df6b8c52 100644 --- a/src/tests/end2end/BufferZeroInitTests.cpp +++ b/src/tests/end2end/BufferZeroInitTests.cpp @@ -997,7 +997,7 @@ TEST_P(BufferZeroInitTest, BoundAsUniformBuffer) { constexpr uint32_t kBoundBufferSize = 16u; wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( - [[block]] struct UBO { + struct UBO { value : vec4; }; [[group(0), binding(0)]] var ubo : UBO; @@ -1036,7 +1036,7 @@ TEST_P(BufferZeroInitTest, BoundAsReadonlyStorageBuffer) { constexpr uint32_t kBoundBufferSize = 16u; wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( - [[block]] struct SSBO { + struct SSBO { value : vec4; }; [[group(0), binding(0)]] var ssbo : SSBO; @@ -1075,7 +1075,7 @@ TEST_P(BufferZeroInitTest, BoundAsStorageBuffer) { constexpr uint32_t kBoundBufferSize = 32u; wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( - [[block]] struct SSBO { + struct SSBO { value : array, 2>; }; [[group(0), binding(0)]] var ssbo : SSBO; diff --git a/src/tests/end2end/ColorStateTests.cpp b/src/tests/end2end/ColorStateTests.cpp index 478d61a491..1fd384533c 100644 --- a/src/tests/end2end/ColorStateTests.cpp +++ b/src/tests/end2end/ColorStateTests.cpp @@ -61,7 +61,7 @@ class ColorStateTest : public DawnTest { // attachment. basePipeline has no blending void SetupSingleSourcePipelines(wgpu::ColorTargetState colorTargetState) { wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct MyBlock { + struct MyBlock { color : vec4; }; @@ -791,7 +791,7 @@ TEST_P(ColorStateTest, IndependentColorState) { {renderTargetViews[0], renderTargetViews[1], renderTargetViews[2], renderTargetViews[3]}); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct MyBlock { + struct MyBlock { color0 : vec4; color1 : vec4; color2 : vec4; @@ -915,7 +915,7 @@ TEST_P(ColorStateTest, IndependentColorState) { // 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; }; @@ -1041,7 +1041,7 @@ TEST_P(ColorStateTest, DefaultBlendColor) { // attachment. TEST_P(ColorStateTest, ColorWriteMaskDoesNotAffectRenderPassLoadOpClear) { wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct MyBlock { + struct MyBlock { color : vec4; }; diff --git a/src/tests/end2end/ComputeCopyStorageBufferTests.cpp b/src/tests/end2end/ComputeCopyStorageBufferTests.cpp index 6b60a0e701..8739c23982 100644 --- a/src/tests/end2end/ComputeCopyStorageBufferTests.cpp +++ b/src/tests/end2end/ComputeCopyStorageBufferTests.cpp @@ -88,7 +88,7 @@ void ComputeCopyStorageBufferTests::BasicTest(const char* shader) { // Test that a trivial compute-shader memcpy implementation works. TEST_P(ComputeCopyStorageBufferTests, SizedArrayOfBasic) { BasicTest(R"( - [[block]] struct Buf { + struct Buf { s : array, 4>; }; @@ -111,7 +111,7 @@ TEST_P(ComputeCopyStorageBufferTests, SizedArrayOfStruct) { b : vec2; }; - [[block]] struct Buf { + struct Buf { s : array; }; @@ -129,7 +129,7 @@ TEST_P(ComputeCopyStorageBufferTests, SizedArrayOfStruct) { // Test that a trivial compute-shader memcpy implementation works. TEST_P(ComputeCopyStorageBufferTests, UnsizedArrayOfBasic) { BasicTest(R"( - [[block]] struct Buf { + struct Buf { s : array>; }; diff --git a/src/tests/end2end/ComputeDispatchTests.cpp b/src/tests/end2end/ComputeDispatchTests.cpp index f335f26a6b..727d88fb72 100644 --- a/src/tests/end2end/ComputeDispatchTests.cpp +++ b/src/tests/end2end/ComputeDispatchTests.cpp @@ -28,7 +28,7 @@ class ComputeDispatchTests : public DawnTest { // 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; }; @@ -54,10 +54,10 @@ class ComputeDispatchTests : public DawnTest { // 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; }; - [[block]] struct OutputBuf { + struct OutputBuf { workGroups : vec3; }; diff --git a/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp b/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp index eeacf7006c..93f47d3d42 100644 --- a/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp +++ b/src/tests/end2end/ComputeLayoutMemoryBufferTests.cpp @@ -174,17 +174,17 @@ struct Data { 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 7519e6838f..ee27977dea 100644 --- a/src/tests/end2end/ComputeSharedMemoryTests.cpp +++ b/src/tests/end2end/ComputeSharedMemoryTests.cpp @@ -74,7 +74,7 @@ TEST_P(ComputeSharedMemoryTests, Basic) { let kTileSize : u32 = 4u; let kInstances : u32 = 11u; - [[block]] struct Dst { + struct Dst { x : u32; }; @@ -110,7 +110,7 @@ TEST_P(ComputeSharedMemoryTests, AssortedTypes) { m: mat2x2; }; - [[block]] struct Dst { + struct Dst { d_struct : StructValues; d_matrix : mat2x2; d_array : array; diff --git a/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp b/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp index ccf65fda8c..12fa33dfa5 100644 --- a/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp +++ b/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp @@ -32,7 +32,7 @@ TEST_P(ComputeStorageBufferBarrierTests, AddIncrement) { device, data.data(), bufferSize, wgpu::BufferUsage::Storage | wgpu::BufferUsage::CopySrc); wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( - [[block]] struct Buf { + struct Buf { data : array; }; @@ -82,7 +82,7 @@ TEST_P(ComputeStorageBufferBarrierTests, AddPingPong) { device, data.data(), bufferSize, wgpu::BufferUsage::Storage | wgpu::BufferUsage::CopySrc); wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( - [[block]] struct Buf { + struct Buf { data : array; }; @@ -148,7 +148,7 @@ TEST_P(ComputeStorageBufferBarrierTests, StorageAndReadonlyStoragePingPongInOneP device, data.data(), bufferSize, wgpu::BufferUsage::Storage | wgpu::BufferUsage::CopySrc); wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( - [[block]] struct Buf { + struct Buf { data : array; }; @@ -216,7 +216,7 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPong) { wgpu::BufferUsage::Storage | wgpu::BufferUsage::Uniform | wgpu::BufferUsage::CopySrc); wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( - [[block]] struct Buf { + struct Buf { data : array, 25>; }; @@ -284,7 +284,7 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPongInOnePass) { wgpu::BufferUsage::Storage | wgpu::BufferUsage::Uniform | wgpu::BufferUsage::CopySrc); wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( - [[block]] struct Buf { + struct Buf { data : array, 25>; }; @@ -342,7 +342,7 @@ TEST_P(ComputeStorageBufferBarrierTests, IndirectBufferCorrectBarrier) { wgpu::ComputePipelineDescriptor step2PipelineDesc; step2PipelineDesc.compute.entryPoint = "main"; step2PipelineDesc.compute.module = utils::CreateShaderModule(device, R"( - [[block]] struct Buf { + struct Buf { data : array; }; [[group(0), binding(0)]] var buf : Buf; @@ -356,12 +356,12 @@ TEST_P(ComputeStorageBufferBarrierTests, IndirectBufferCorrectBarrier) { wgpu::ComputePipelineDescriptor step3PipelineDesc; step3PipelineDesc.compute.entryPoint = "main"; step3PipelineDesc.compute.module = utils::CreateShaderModule(device, R"( - [[block]] struct Buf { + struct Buf { data : array; }; [[group(0), binding(0)]] var buf : Buf; - [[block]] struct Result { + struct Result { data : u32; }; [[group(0), binding(1)]] var result : Result; diff --git a/src/tests/end2end/CopyTextureForBrowserTests.cpp b/src/tests/end2end/CopyTextureForBrowserTests.cpp index f0284e4328..2da9062b37 100644 --- a/src/tests/end2end/CopyTextureForBrowserTests.cpp +++ b/src/tests/end2end/CopyTextureForBrowserTests.cpp @@ -247,7 +247,7 @@ class CopyTextureForBrowserTests : public Parent { // 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; @@ -255,7 +255,7 @@ class CopyTextureForBrowserTests : public Parent { copySize : vec2; alphaOp : u32; }; - [[block]] struct OutputBuf { + struct OutputBuf { result : array; }; [[group(0), binding(0)]] var src : texture_2d; diff --git a/src/tests/end2end/CreatePipelineAsyncTests.cpp b/src/tests/end2end/CreatePipelineAsyncTests.cpp index 4a6d2b7e35..4344e996a6 100644 --- a/src/tests/end2end/CreatePipelineAsyncTests.cpp +++ b/src/tests/end2end/CreatePipelineAsyncTests.cpp @@ -133,7 +133,7 @@ class CreatePipelineAsyncTest : public DawnTest { 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 ssbo : SSBO; @@ -163,7 +163,7 @@ TEST_P(CreatePipelineAsyncTest, BasicUseOfCreateComputePipelineAsync) { 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 ssbo : SSBO; @@ -202,7 +202,7 @@ TEST_P(CreatePipelineAsyncTest, CreateComputePipelineFailed) { wgpu::ComputePipelineDescriptor csDesc; csDesc.compute.module = utils::CreateShaderModule(device, R"( - [[block]] struct SSBO { + struct SSBO { value : u32; }; [[group(0), binding(0)]] var ssbo : SSBO; @@ -482,7 +482,7 @@ TEST_P(CreatePipelineAsyncTest, DestroyDeviceBeforeCallbackOfCreateRenderPipelin 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 ssbo : SSBO; @@ -541,7 +541,7 @@ TEST_P(CreatePipelineAsyncTest, CreateSameComputePipelineTwiceAtSameTime) { 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 ssbo : SSBO; diff --git a/src/tests/end2end/D3D12CachingTests.cpp b/src/tests/end2end/D3D12CachingTests.cpp index 00eab66cb5..b2cab47027 100644 --- a/src/tests/end2end/D3D12CachingTests.cpp +++ b/src/tests/end2end/D3D12CachingTests.cpp @@ -208,7 +208,7 @@ TEST_P(D3D12CachingTests, ReuseShaderWithMultipleEntryPointsPerStage) { // 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 data : Data; diff --git a/src/tests/end2end/DepthStencilSamplingTests.cpp b/src/tests/end2end/DepthStencilSamplingTests.cpp index e916e6d5ee..7ac870a48f 100644 --- a/src/tests/end2end/DepthStencilSamplingTests.cpp +++ b/src/tests/end2end/DepthStencilSamplingTests.cpp @@ -70,10 +70,10 @@ class DepthStencilSamplingTest : public DawnTest { std::ostringstream& shaderBody) { shaderSource << "type StencilValues = array;\n"; shaderSource << R"( - [[block]] struct DepthResult { + struct DepthResult { value : f32; }; - [[block]] struct StencilResult { + struct StencilResult { values : StencilValues; };)"; shaderSource << "\n"; @@ -181,7 +181,7 @@ class DepthStencilSamplingTest : public DawnTest { 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 uniforms : Uniforms; @@ -203,12 +203,12 @@ class DepthStencilSamplingTest : public DawnTest { 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 uniforms : Uniforms; - [[block]] struct SamplerResult { + struct SamplerResult { value : f32; }; [[group(0), binding(3)]] var samplerResult : SamplerResult; diff --git a/src/tests/end2end/DepthStencilStateTests.cpp b/src/tests/end2end/DepthStencilStateTests.cpp index efe3e53bd7..73e9aad237 100644 --- a/src/tests/end2end/DepthStencilStateTests.cpp +++ b/src/tests/end2end/DepthStencilStateTests.cpp @@ -56,7 +56,7 @@ class DepthStencilStateTest : public DawnTest { depthTextureView = depthTexture.CreateView(); vsModule = utils::CreateShaderModule(device, R"( - [[block]] struct UBO { + struct UBO { color : vec3; depth : f32; }; @@ -75,7 +75,7 @@ class DepthStencilStateTest : public DawnTest { })"); fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct UBO { + struct UBO { color : vec3; depth : f32; }; diff --git a/src/tests/end2end/DeviceLostTests.cpp b/src/tests/end2end/DeviceLostTests.cpp index 91bdabe973..57a4bffd1f 100644 --- a/src/tests/end2end/DeviceLostTests.cpp +++ b/src/tests/end2end/DeviceLostTests.cpp @@ -112,7 +112,7 @@ TEST_P(DeviceLostTest, CreateBindGroupLayoutFails) { // 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; }; [[group(0), binding(0)]] var ubo : UniformBuffer; diff --git a/src/tests/end2end/DrawIndexedIndirectTests.cpp b/src/tests/end2end/DrawIndexedIndirectTests.cpp index 0a8a83f941..6f56904b0e 100644 --- a/src/tests/end2end/DrawIndexedIndirectTests.cpp +++ b/src/tests/end2end/DrawIndexedIndirectTests.cpp @@ -595,8 +595,8 @@ TEST_P(DrawIndexedIndirectTest, ValidateReusedBundleWithChangingParams) { 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 77f1e7e4a7..a83b86cc16 100644 --- a/src/tests/end2end/DynamicBufferOffsetTests.cpp +++ b/src/tests/end2end/DynamicBufferOffsetTests.cpp @@ -115,7 +115,7 @@ class DynamicBufferOffsetTests : public DawnTest { std::ostringstream fs; std::string multipleNumber = isInheritedPipeline ? "2" : "1"; fs << R"( - [[block]] struct Buf { + struct Buf { value : vec2; }; @@ -165,7 +165,7 @@ class DynamicBufferOffsetTests : public DawnTest { std::ostringstream cs; std::string multipleNumber = isInheritedPipeline ? "2" : "1"; cs << R"( - [[block]] struct Buf { + struct Buf { value : vec2; }; @@ -453,7 +453,7 @@ TEST_P(ClampedOOBDynamicBufferOffsetTests, CheckOOBAccess) { switch (GetParam().mReadBufferUsage) { case wgpu::BufferUsage::Uniform: shader << R"( - [[block]] struct Src { + struct Src { values : array, kArrayLength>; }; [[group(0), binding(0)]] var src : Src; @@ -461,7 +461,7 @@ TEST_P(ClampedOOBDynamicBufferOffsetTests, CheckOOBAccess) { break; case wgpu::BufferUsage::Storage: shader << R"( - [[block]] struct Src { + struct Src { values : array>; }; [[group(0), binding(0)]] var src : Src; @@ -472,7 +472,7 @@ TEST_P(ClampedOOBDynamicBufferOffsetTests, CheckOOBAccess) { } shader << R"( - [[block]] struct Dst { + struct Dst { values : array>; }; [[group(0), binding(1)]] var dst : Dst; diff --git a/src/tests/end2end/EntryPointTests.cpp b/src/tests/end2end/EntryPointTests.cpp index 5b760c5d17..5eb356b177 100644 --- a/src/tests/end2end/EntryPointTests.cpp +++ b/src/tests/end2end/EntryPointTests.cpp @@ -78,7 +78,7 @@ TEST_P(EntryPointTests, TwoComputeInModule) { 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 data : Data; diff --git a/src/tests/end2end/FirstIndexOffsetTests.cpp b/src/tests/end2end/FirstIndexOffsetTests.cpp index 5ab3ca3452..2fc667244f 100644 --- a/src/tests/end2end/FirstIndexOffsetTests.cpp +++ b/src/tests/end2end/FirstIndexOffsetTests.cpp @@ -127,7 +127,7 @@ struct VertexOutputs { })"; std::string fragmentShader = R"( -[[block]] struct IndexVals { +struct IndexVals { vertex_index : atomic; instance_index : atomic; }; diff --git a/src/tests/end2end/GpuMemorySynchronizationTests.cpp b/src/tests/end2end/GpuMemorySynchronizationTests.cpp index a6fe1418d4..3c9d273726 100644 --- a/src/tests/end2end/GpuMemorySynchronizationTests.cpp +++ b/src/tests/end2end/GpuMemorySynchronizationTests.cpp @@ -36,7 +36,7 @@ class GpuMemorySyncTests : public DawnTest { std::tuple CreatePipelineAndBindGroupForCompute( const wgpu::Buffer& buffer) { wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"( - [[block]] struct Data { + struct Data { a : i32; }; [[group(0), binding(0)]] var data : Data; @@ -63,7 +63,7 @@ class GpuMemorySyncTests : public DawnTest { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct Data { + struct Data { i : i32; }; [[group(0), binding(0)]] var data : Data; @@ -243,7 +243,7 @@ class StorageToUniformSyncTests : public DawnTest { std::tuple CreatePipelineAndBindGroupForCompute() { wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"( - [[block]] struct Data { + struct Data { a : f32; }; [[group(0), binding(0)]] var data : Data; @@ -269,7 +269,7 @@ class StorageToUniformSyncTests : public DawnTest { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct Contents { + struct Contents { color : f32; }; [[group(0), binding(0)]] var contents : Contents; @@ -440,17 +440,17 @@ class MultipleWriteThenMultipleReadTests : public DawnTest { 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, 4>; }; [[group(0), binding(0)]] var vbContents : VBContents; - [[block]] struct IBContents { + struct IBContents { indices : array, 2>; }; [[group(0), binding(1)]] var ibContents : IBContents; - [[block]] struct ColorContents { + struct ColorContents { color : f32; }; [[group(0), binding(2)]] var uniformContents : ColorContents; @@ -503,7 +503,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct Buf { + struct Buf { color : f32; }; @@ -562,7 +562,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) { // 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, 4>; [[align(256)]] indices : array, 2>; [[align(256)]] color0 : f32; @@ -620,7 +620,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct Buf { + struct Buf { color : f32; }; [[group(0), binding(0)]] var uniformBuffer : Buf; diff --git a/src/tests/end2end/MaxLimitTests.cpp b/src/tests/end2end/MaxLimitTests.cpp index dd24bd7a76..52d3216a91 100644 --- a/src/tests/end2end/MaxLimitTests.cpp +++ b/src/tests/end2end/MaxLimitTests.cpp @@ -33,7 +33,7 @@ TEST_P(MaxLimitTests, MaxComputeWorkgroupStorageSize) { GetSupportedLimits().limits.maxComputeWorkgroupStorageSize; std::string shader = R"( - [[block]] struct Dst { + struct Dst { value0 : u32; value1 : u32; }; @@ -129,11 +129,11 @@ TEST_P(MaxLimitTests, MaxBufferBindingSize) { std::min(maxBufferBindingSize, uint64_t(512) * 1024 * 1024); } shader = R"( - [[block]] struct Buf { + struct Buf { values : array; }; - [[block]] struct Result { + struct Result { value0 : u32; value1 : u32; }; @@ -156,7 +156,7 @@ TEST_P(MaxLimitTests, MaxBufferBindingSize) { uint64_t(std::numeric_limits::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 @@ TEST_P(MaxLimitTests, MaxBufferBindingSize) { 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 e97efe8c28..3b7564df42 100644 --- a/src/tests/end2end/MultisampledRenderingTests.cpp +++ b/src/tests/end2end/MultisampledRenderingTests.cpp @@ -45,7 +45,7 @@ class MultisampledRenderingTest : public DawnTest { bool alphaToCoverageEnabled = false, bool flipTriangle = false) { const char* kFsOneOutputWithDepth = R"( - [[block]] struct U { + struct U { color : vec4; depth : f32; }; @@ -64,7 +64,7 @@ class MultisampledRenderingTest : public DawnTest { })"; const char* kFsOneOutputWithoutDepth = R"( - [[block]] struct U { + struct U { color : vec4; }; [[group(0), binding(0)]] var uBuffer : U; @@ -83,7 +83,7 @@ class MultisampledRenderingTest : public DawnTest { uint32_t sampleMask = 0xFFFFFFFF, bool alphaToCoverageEnabled = false) { const char* kFsTwoOutputs = R"( - [[block]] struct U { + struct U { color0 : vec4; color1 : vec4; }; @@ -777,7 +777,7 @@ TEST_P(MultisampledRenderingTest, ResolveInto2DTextureWithSampleMaskAndShaderOut constexpr float kMSAACoverage = 0.25f; constexpr uint32_t kSampleMask = kFirstSampleMaskBit | kThirdSampleMaskBit; const char* fs = R"( - [[block]] struct U { + struct U { color : vec4; }; [[group(0), binding(0)]] var uBuffer : U; @@ -838,7 +838,7 @@ TEST_P(MultisampledRenderingTest, ResolveIntoMultipleResolveTargetsWithShaderOut // 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; color1 : vec4; }; diff --git a/src/tests/end2end/MultisampledSamplingTests.cpp b/src/tests/end2end/MultisampledSamplingTests.cpp index 160555dc6a..f2251c1bfe 100644 --- a/src/tests/end2end/MultisampledSamplingTests.cpp +++ b/src/tests/end2end/MultisampledSamplingTests.cpp @@ -99,7 +99,7 @@ class MultisampledSamplingTest : public DawnTest { [[group(0), binding(0)]] var texture0 : texture_multisampled_2d; [[group(0), binding(1)]] var texture1 : texture_depth_multisampled_2d; - [[block]] struct Results { + struct Results { colorSamples : array; depthSamples : array; }; diff --git a/src/tests/end2end/OpArrayLengthTests.cpp b/src/tests/end2end/OpArrayLengthTests.cpp index 105a75403a..6a3cc1f74c 100644 --- a/src/tests/end2end/OpArrayLengthTests.cpp +++ b/src/tests/end2end/OpArrayLengthTests.cpp @@ -53,7 +53,7 @@ class OpArrayLengthTest : public DawnTest { // 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; }; @@ -70,7 +70,7 @@ class OpArrayLengthTest : public DawnTest { b : i32; }; - [[block]] struct Buffer3 { + struct Buffer3 { [[size(64)]] garbage : mat4x4; data : [[stride(8)]] array; }; @@ -120,7 +120,7 @@ TEST_P(OpArrayLengthTest, Compute) { pipelineDesc.layout = pl; pipelineDesc.compute.entryPoint = "main"; pipelineDesc.compute.module = utils::CreateShaderModule(device, (R"( - [[block]] struct ResultBuffer { + struct ResultBuffer { data : [[stride(4)]] array; }; [[group(1), binding(0)]] var result : ResultBuffer; diff --git a/src/tests/end2end/PrimitiveStateTests.cpp b/src/tests/end2end/PrimitiveStateTests.cpp index c9a4c16149..5bf00b740c 100644 --- a/src/tests/end2end/PrimitiveStateTests.cpp +++ b/src/tests/end2end/PrimitiveStateTests.cpp @@ -45,7 +45,7 @@ class DepthClampingTest : public DawnTest { depthTextureView = depthTexture.CreateView(); vsModule = utils::CreateShaderModule(device, R"( - [[block]] struct UBO { + struct UBO { color : vec3; depth : f32; }; @@ -56,7 +56,7 @@ class DepthClampingTest : public DawnTest { })"); fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct UBO { + struct UBO { color : vec3; depth : f32; }; diff --git a/src/tests/end2end/RenderBundleTests.cpp b/src/tests/end2end/RenderBundleTests.cpp index 723002b22f..cc966ba24e 100644 --- a/src/tests/end2end/RenderBundleTests.cpp +++ b/src/tests/end2end/RenderBundleTests.cpp @@ -38,7 +38,7 @@ class RenderBundleTest : public DawnTest { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct Ubo { + struct Ubo { color : vec4; }; [[group(0), binding(0)]] var fragmentUniformBuffer : Ubo; diff --git a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp index 22679d30e7..424ae70cef 100644 --- a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp +++ b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp @@ -38,7 +38,7 @@ class SamplerFilterAnisotropicTest : public DawnTest { mRenderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize); wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( - [[block]] struct Uniforms { + struct Uniforms { matrix : mat4x4; }; diff --git a/src/tests/end2end/ShaderTests.cpp b/src/tests/end2end/ShaderTests.cpp index 2902a35799..4a0691776b 100644 --- a/src/tests/end2end/ShaderTests.cpp +++ b/src/tests/end2end/ShaderTests.cpp @@ -50,7 +50,7 @@ TEST_P(ShaderTests, ComputeLog2) { wgpu::Buffer buffer = CreateBuffer(kSteps); std::string shader = R"( -[[block]] struct Buf { +struct Buf { data : array; }; @@ -335,7 +335,7 @@ struct Inputs { }; // [1] a binding point that conflicts with the regitster -[[block]] struct S1 { data : array, 20>; }; +struct S1 { data : array, 20>; }; [[group(0), binding(1)]] var providedData1 : S1; [[stage(vertex)]] fn vsMain(input : Inputs) -> [[builtin(position)]] vec4 { @@ -412,7 +412,7 @@ TEST_P(ShaderTests, OverridableConstants) { [[override]] let c9: u32 = 0u; // default override [[override]] let c10: u32 = 10u; // default -[[block]] struct Buf { +struct Buf { data : array; }; @@ -482,7 +482,7 @@ TEST_P(ShaderTests, OverridableConstantsNumericIdentifiers) { [[override(1003)]] let c3: u32 = 3u; // default [[override(1004)]] let c4: u32; // default unspecified -[[block]] struct Buf { +struct Buf { data : array; }; @@ -539,7 +539,7 @@ TEST_P(ShaderTests, OverridableConstantsPrecision) { [[override(1001)]] let c1: f32; [[override(1002)]] let c2: f32; -[[block]] struct Buf { +struct Buf { data : array; }; @@ -593,7 +593,7 @@ TEST_P(ShaderTests, OverridableConstantsMultipleEntryPoints) { [[override(1001)]] let c1: u32; [[override(1002)]] let c2: u32; -[[block]] struct Buf { +struct Buf { data : array; }; diff --git a/src/tests/end2end/TextureZeroInitTests.cpp b/src/tests/end2end/TextureZeroInitTests.cpp index fd22849e64..55f7b53fd4 100644 --- a/src/tests/end2end/TextureZeroInitTests.cpp +++ b/src/tests/end2end/TextureZeroInitTests.cpp @@ -983,7 +983,7 @@ TEST_P(TextureZeroInitTest, ComputePassSampledTextureClear) { wgpu::ProgrammableStageDescriptor compute; const char* cs = R"( [[group(0), binding(0)]] var tex : texture_2d; - [[block]] struct Result { + struct Result { value : vec4; }; [[group(0), binding(1)]] var result : Result; diff --git a/src/tests/perf_tests/DrawCallPerf.cpp b/src/tests/perf_tests/DrawCallPerf.cpp index 7999a5a852..79955bec4a 100644 --- a/src/tests/perf_tests/DrawCallPerf.cpp +++ b/src/tests/perf_tests/DrawCallPerf.cpp @@ -39,7 +39,7 @@ namespace { })"; constexpr char kFragmentShaderA[] = R"( - [[block]] struct Uniforms { + struct Uniforms { color : vec3; }; [[group(0), binding(0)]] var uniforms : Uniforms; @@ -48,10 +48,10 @@ namespace { })"; constexpr char kFragmentShaderB[] = R"( - [[block]] struct Constants { + struct Constants { color : vec3; }; - [[block]] struct Uniforms { + struct Uniforms { color : vec3; }; [[group(0), binding(0)]] var constants : Constants; diff --git a/src/tests/perf_tests/ShaderRobustnessPerf.cpp b/src/tests/perf_tests/ShaderRobustnessPerf.cpp index 4d8e8c2162..64353c44fb 100644 --- a/src/tests/perf_tests/ShaderRobustnessPerf.cpp +++ b/src/tests/perf_tests/ShaderRobustnessPerf.cpp @@ -20,12 +20,12 @@ namespace { 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; }; @@ -187,12 +187,12 @@ namespace { // 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>; }; diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp index 7c00ff8196..4051acafb0 100644 --- a/src/tests/unittests/validation/BindGroupValidationTests.cpp +++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp @@ -1419,7 +1419,7 @@ class SetBindGroupValidationTest : public ValidationTest { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct S { + struct S { value : vec2; }; @@ -1443,7 +1443,7 @@ class SetBindGroupValidationTest : public ValidationTest { wgpu::ComputePipeline CreateComputePipeline() { wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"( - [[block]] struct S { + struct S { value : vec2; }; @@ -1871,7 +1871,7 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest { device.CreatePipelineLayout(&pipelineLayoutDescriptor); std::stringstream ss; - ss << "[[block]] struct S { value : vec2; };"; + ss << "struct S { value : vec2; };"; // Build a shader which has bindings that match the pipeline layout. for (uint32_t l = 0; l < layouts.size(); ++l) { @@ -2051,7 +2051,7 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest { wgpu::RenderPipeline CreateRenderPipeline(std::vector bindGroupLayouts) { return CreateFSRenderPipeline(R"( - [[block]] struct S { + struct S { value : vec2; }; @@ -2086,7 +2086,7 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest { wgpu::ComputePipeline CreateComputePipeline( std::vector bindGroupLayouts) { return CreateComputePipeline(R"( - [[block]] struct S { + struct S { value : vec2; }; diff --git a/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp b/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp index 23d01ab7d0..62ccab97b8 100644 --- a/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp +++ b/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp @@ -46,7 +46,7 @@ TEST_F(GetBindGroupLayoutTests, SameObject) { DAWN_SKIP_TEST_IF(UsesWire()); wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(0), binding(0)]] var uniform0 : S; @@ -59,12 +59,12 @@ TEST_F(GetBindGroupLayoutTests, SameObject) { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct S2 { + struct S2 { pos : vec4; }; [[group(2), binding(0)]] var uniform2 : S2; - [[block]] struct S3 { + struct S3 { pos : mat4x4; }; [[group(3), binding(0)]] var storage3 : S3; @@ -98,7 +98,7 @@ TEST_F(GetBindGroupLayoutTests, SameObject) { // 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; }; [[group(0), binding(0)]] var uniforms : S; @@ -120,7 +120,7 @@ TEST_F(GetBindGroupLayoutTests, DefaultShaderStageAndDynamicOffsets) { DAWN_SKIP_TEST_IF(UsesWire()); wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(0), binding(0)]] var uniforms : S; @@ -290,7 +290,7 @@ TEST_F(GetBindGroupLayoutTests, ComputePipeline) { DAWN_SKIP_TEST_IF(UsesWire()); wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(0), binding(0)]] var uniforms : S; @@ -343,7 +343,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { binding.visibility = wgpu::ShaderStage::Fragment; binding.buffer.type = wgpu::BufferBindingType::Storage; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(0), binding(0)]] var ssbo : S; @@ -357,7 +357,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { { binding.buffer.type = wgpu::BufferBindingType::Uniform; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(0), binding(0)]] var uniforms : S; @@ -372,7 +372,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { { binding.buffer.type = wgpu::BufferBindingType::ReadOnlyStorage; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(0), binding(0)]] var ssbo : S; @@ -612,7 +612,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { { binding.binding = 0; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(0), binding(0)]] var uniforms : S; @@ -627,7 +627,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { { binding.binding = 1; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(0), binding(1)]] var uniforms : S; @@ -642,7 +642,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { { binding.binding = 2; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(0), binding(1)]] var uniforms : S; @@ -658,7 +658,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { // 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; }; [[group(0), binding(0)]] var uniform0 : S; @@ -671,7 +671,7 @@ TEST_F(GetBindGroupLayoutTests, DuplicateBinding) { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(1), binding(0)]] var uniforms : S; @@ -697,7 +697,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { DAWN_SKIP_TEST_IF(UsesWire()); wgpu::ShaderModule vsModule4 = utils::CreateShaderModule(device, R"( - [[block]] struct S { + struct S { pos : f32; }; [[group(0), binding(0)]] var uniforms : S; @@ -708,7 +708,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { })"); wgpu::ShaderModule vsModule64 = utils::CreateShaderModule(device, R"( - [[block]] struct S { + struct S { pos : mat4x4; }; [[group(0), binding(0)]] var uniforms : S; @@ -719,7 +719,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { })"); wgpu::ShaderModule fsModule4 = utils::CreateShaderModule(device, R"( - [[block]] struct S { + struct S { pos : f32; }; [[group(0), binding(0)]] var uniforms : S; @@ -729,7 +729,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { })"); wgpu::ShaderModule fsModule64 = utils::CreateShaderModule(device, R"( - [[block]] struct S { + struct S { pos : mat4x4; }; [[group(0), binding(0)]] var uniforms : S; @@ -864,7 +864,7 @@ TEST_F(GetBindGroupLayoutTests, StageAggregation) { // 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; }; [[group(0), binding(0)]] var ubo : S; @@ -875,7 +875,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(0), binding(0)]] var ssbo : S; @@ -988,7 +988,7 @@ TEST_F(GetBindGroupLayoutTests, UnusedIndex) { DAWN_SKIP_TEST_IF(UsesWire()); wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(0), binding(0)]] var uniforms0 : S; @@ -1041,7 +1041,7 @@ TEST_F(GetBindGroupLayoutTests, Reflection) { wgpu::PipelineLayout pipelineLayout = device.CreatePipelineLayout(&pipelineLayoutDesc); wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"( - [[block]] struct S { + struct S { pos : vec4; }; [[group(0), binding(0)]] var uniforms : S; @@ -1082,7 +1082,7 @@ TEST_F(GetBindGroupLayoutTests, Reflection) { // 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 data0 : Data; diff --git a/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp b/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp index e67336108a..4fa95abf69 100644 --- a/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp +++ b/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp @@ -73,7 +73,7 @@ namespace { 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 bb3a01aa5d..0799f90b31 100644 --- a/src/tests/unittests/validation/RenderBundleValidationTests.cpp +++ b/src/tests/unittests/validation/RenderBundleValidationTests.cpp @@ -28,7 +28,7 @@ namespace { ValidationTest::SetUp(); vsModule = utils::CreateShaderModule(device, R"( - [[block]] struct S { + struct S { transform : mat2x2; }; [[group(0), binding(0)]] var uniforms : S; @@ -38,12 +38,12 @@ namespace { })"); fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct Uniforms { + struct Uniforms { color : vec4; }; [[group(1), binding(0)]] var uniforms : Uniforms; - [[block]] struct Storage { + struct Storage { dummy : array; }; [[group(1), binding(1)]] var ssbo : Storage; diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp index d7d2d13d4b..ea403d83ee 100644 --- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -765,7 +765,7 @@ TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) { // cause crash. TEST_F(RenderPipelineValidationTest, StorageBufferInVertexShaderNoLayout) { wgpu::ShaderModule vsModuleWithStorageBuffer = utils::CreateShaderModule(device, R"( - [[block]] struct Dst { + struct Dst { data : array; }; [[group(0), binding(0)]] var dst : Dst; @@ -1124,7 +1124,7 @@ TEST_F(RenderPipelineValidationTest, UnwrittenFragmentOutputsMask0) { // 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; }; [[group(0), binding(0)]] var var0 : Uniforms; diff --git a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp index fcc98ce697..29c3da08a1 100644 --- a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp +++ b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp @@ -761,7 +761,7 @@ namespace { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"( - [[block]] struct RBuffer { + struct RBuffer { value : f32; }; [[group(0), binding(0)]] var rBuffer : RBuffer; diff --git a/src/tests/unittests/validation/ShaderModuleValidationTests.cpp b/src/tests/unittests/validation/ShaderModuleValidationTests.cpp index fecb6dd32a..4ff0edb0a4 100644 --- a/src/tests/unittests/validation/ShaderModuleValidationTests.cpp +++ b/src/tests/unittests/validation/ShaderModuleValidationTests.cpp @@ -503,7 +503,7 @@ TEST_F(ShaderModuleValidationTest, OverridableConstantsNumericIDConflicts) { [[override(1234)]] let c0: u32; [[override(1234)]] let c1: u32; -[[block]] struct Buf { +struct Buf { data : array; }; diff --git a/src/tests/white_box/D3D12DescriptorHeapTests.cpp b/src/tests/white_box/D3D12DescriptorHeapTests.cpp index 513a165a83..14bf526714 100644 --- a/src/tests/white_box/D3D12DescriptorHeapTests.cpp +++ b/src/tests/white_box/D3D12DescriptorHeapTests.cpp @@ -53,7 +53,7 @@ class D3D12DescriptorHeapTests : public DawnTest { })"); mSimpleFSModule = utils::CreateShaderModule(device, R"( - [[block]] struct U { + struct U { color : vec4; }; [[group(0), binding(0)]] var colorBuffer : U; @@ -444,7 +444,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeManyUBO) { pipelineDescriptor.vertex.module = mSimpleVSModule; pipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"( - [[block]] struct U { + struct U { heapSize : f32; }; [[group(0), binding(0)]] var buffer0 : U; @@ -777,7 +777,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeManyUBOAndSamplers) { utils::ComboRenderPipelineDescriptor pipelineDescriptor; pipelineDescriptor.vertex.module = utils::CreateShaderModule(device, R"( - [[block]] struct U { + struct U { transform : mat2x2; }; [[group(0), binding(0)]] var buffer0 : U; @@ -793,7 +793,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeManyUBOAndSamplers) { return vec4(buffer0.transform * (pos[VertexIndex]), 0.0, 1.0); })"); pipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"( - [[block]] struct U { + struct U { color : vec4; }; [[group(0), binding(1)]] var sampler0 : sampler; diff --git a/src/tests/white_box/D3D12ResidencyTests.cpp b/src/tests/white_box/D3D12ResidencyTests.cpp index ec60e7941d..6622db1af1 100644 --- a/src/tests/white_box/D3D12ResidencyTests.cpp +++ b/src/tests/white_box/D3D12ResidencyTests.cpp @@ -353,7 +353,7 @@ TEST_P(D3D12DescriptorResidencyTests, SwitchedViewHeapResidency) { })"); renderPipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"( - [[block]] struct U { + struct U { color : vec4; }; [[group(0), binding(0)]] var colorBuffer : U; diff --git a/src/tests/white_box/InternalStorageBufferBindingTests.cpp b/src/tests/white_box/InternalStorageBufferBindingTests.cpp index fc9c18fbe0..8ee4f1aaee 100644 --- a/src/tests/white_box/InternalStorageBufferBindingTests.cpp +++ b/src/tests/white_box/InternalStorageBufferBindingTests.cpp @@ -31,7 +31,7 @@ class InternalStorageBufferBindingTests : public DawnTest { wgpu::ComputePipeline CreateComputePipelineWithInternalStorage() { wgpu::ShaderModule module = utils::CreateShaderModule(device, R"( - [[block]] struct Buf { + struct Buf { data : array; };