diff --git a/dawn.json b/dawn.json index 0a809c2e30..746e1f4244 100644 --- a/dawn.json +++ b/dawn.json @@ -93,7 +93,6 @@ {"name": "type", "type": "binding type"}, {"name": "has dynamic offset", "type": "bool", "default": "false"}, {"name": "multisampled", "type": "bool", "default": "false"}, - {"name": "texture dimension", "type": "texture view dimension", "default": "undefined"}, {"name": "view dimension", "type": "texture view dimension", "default": "undefined"}, {"name": "texture component type", "type": "texture component type", "default": "float"}, {"name": "storage texture format", "type": "texture format", "default": "undefined"} diff --git a/src/dawn_native/BindGroupLayout.cpp b/src/dawn_native/BindGroupLayout.cpp index 35e7f2e55b..8fb923a2ff 100644 --- a/src/dawn_native/BindGroupLayout.cpp +++ b/src/dawn_native/BindGroupLayout.cpp @@ -112,20 +112,6 @@ namespace dawn_native { if (entry.viewDimension != wgpu::TextureViewDimension::Undefined) { DAWN_TRY(ValidateTextureViewDimension(entry.viewDimension)); - - // TODO(dawn:22): Remove this once users use viewDimension - if (entry.textureDimension != wgpu::TextureViewDimension::Undefined) { - return DAWN_VALIDATION_ERROR( - "Cannot use both viewDimension and textureDimension"); - } - } else { - // TODO(dawn:22): Remove this once users use viewDimension - if (entry.textureDimension != wgpu::TextureViewDimension::Undefined) { - DAWN_TRY(ValidateTextureViewDimension(entry.textureDimension)); - device->EmitDeprecationWarning( - "BindGroupLayoutEntry::textureDimension is deprecated, use viewDimension " - "instead"); - } } if (bindingsSet.count(bindingNumber) != 0) { @@ -304,12 +290,7 @@ namespace dawn_native { } if (binding.viewDimension == wgpu::TextureViewDimension::Undefined) { - // TODO(dawn:22): Remove this once users use viewDimension - if (binding.textureDimension != wgpu::TextureViewDimension::Undefined) { - mBindingInfo[i].viewDimension = binding.textureDimension; - } else { mBindingInfo[i].viewDimension = wgpu::TextureViewDimension::e2D; - } } else { mBindingInfo[i].viewDimension = binding.viewDimension; } diff --git a/src/tests/end2end/DeprecatedAPITests.cpp b/src/tests/end2end/DeprecatedAPITests.cpp index e95c7e1a50..106fd9a213 100644 --- a/src/tests/end2end/DeprecatedAPITests.cpp +++ b/src/tests/end2end/DeprecatedAPITests.cpp @@ -71,87 +71,6 @@ TEST_P(DeprecationTests, CreateQueueReturnsFunctionalQueue) { q.Submit(0, nullptr); } -// Tests for BindGroupLayoutEntry::textureDimension -> viewDimension - -// Test that creating a BGL with textureDimension produces a deprecation warning. -TEST_P(DeprecationTests, BGLEntryTextureDimensionIsDeprecated) { - wgpu::BindGroupLayoutEntry entryDesc; - entryDesc.binding = 0; - entryDesc.visibility = wgpu::ShaderStage::None; - entryDesc.type = wgpu::BindingType::SampledTexture; - entryDesc.textureDimension = wgpu::TextureViewDimension::e2D; - - wgpu::BindGroupLayoutDescriptor bglDesc; - bglDesc.entryCount = 1; - bglDesc.entries = &entryDesc; - EXPECT_DEPRECATION_WARNING(device.CreateBindGroupLayout(&bglDesc)); -} - -// Test that creating a BGL with default viewDimension and textureDimension doesn't emit a warning -TEST_P(DeprecationTests, BGLEntryTextureDimensionAndViewUndefinedEmitsNoWarning) { - wgpu::BindGroupLayoutEntry entryDesc; - entryDesc.binding = 0; - entryDesc.visibility = wgpu::ShaderStage::None; - entryDesc.type = wgpu::BindingType::Sampler; - - wgpu::BindGroupLayoutDescriptor bglDesc; - bglDesc.entryCount = 1; - bglDesc.entries = &entryDesc; - device.CreateBindGroupLayout(&bglDesc); -} -// Test that creating a BGL with both textureDimension and viewDimension is an error -TEST_P(DeprecationTests, BGLEntryTextureAndViewDimensionIsInvalid) { - wgpu::BindGroupLayoutEntry entryDesc; - entryDesc.binding = 0; - entryDesc.visibility = wgpu::ShaderStage::None; - entryDesc.type = wgpu::BindingType::SampledTexture; - entryDesc.textureDimension = wgpu::TextureViewDimension::e2D; - entryDesc.viewDimension = wgpu::TextureViewDimension::e2D; - - wgpu::BindGroupLayoutDescriptor bglDesc; - bglDesc.entryCount = 1; - bglDesc.entries = &entryDesc; - ASSERT_DEVICE_ERROR(device.CreateBindGroupLayout(&bglDesc)); -} - -// Test that creating a BGL with both textureDimension still does correct state tracking -TEST_P(DeprecationTests, BGLEntryTextureDimensionStateTracking) { - // Create a BGL that expects a cube map - wgpu::BindGroupLayoutEntry entryDesc = {}; - entryDesc.binding = 0; - entryDesc.visibility = wgpu::ShaderStage::None; - entryDesc.type = wgpu::BindingType::SampledTexture; - entryDesc.textureDimension = wgpu::TextureViewDimension::Cube; - - wgpu::BindGroupLayoutDescriptor bglDesc = {}; - bglDesc.entryCount = 1; - bglDesc.entries = &entryDesc; - wgpu::BindGroupLayout layout; - EXPECT_DEPRECATION_WARNING(layout = device.CreateBindGroupLayout(&bglDesc)); - - // Create a 2D array view and a cube view - wgpu::TextureDescriptor textureDesc = {}; - textureDesc.usage = wgpu::TextureUsage::Sampled; - textureDesc.size = {1, 1, 1}; - textureDesc.arrayLayerCount = 6; - textureDesc.format = wgpu::TextureFormat::RGBA8Unorm; - wgpu::Texture texture = device.CreateTexture(&textureDesc); - - wgpu::TextureViewDescriptor viewDesc = {}; - viewDesc.dimension = wgpu::TextureViewDimension::e2DArray; - viewDesc.baseArrayLayer = 0; - viewDesc.arrayLayerCount = 6; - wgpu::TextureView arrayView = texture.CreateView(&viewDesc); - - viewDesc.dimension = wgpu::TextureViewDimension::Cube; - wgpu::TextureView cubeView = texture.CreateView(&viewDesc); - - // textureDimension is correctly taken into account and only the BindGroup with the Cube view is - // valid. - utils::MakeBindGroup(device, layout, {{0, cubeView}}); - ASSERT_DEVICE_ERROR(utils::MakeBindGroup(device, layout, {{0, arrayView}})); -} - // Tests for ShaderModuleDescriptor.code/codeSize -> ShaderModuleSPIRVDescriptor static const char kEmptyShader[] = R"(#version 450 diff --git a/src/tests/end2end/ObjectCachingTests.cpp b/src/tests/end2end/ObjectCachingTests.cpp index 50309bb9dc..4db3f11615 100644 --- a/src/tests/end2end/ObjectCachingTests.cpp +++ b/src/tests/end2end/ObjectCachingTests.cpp @@ -54,7 +54,6 @@ TEST_P(ObjectCachingTest, BindGroupLayoutTextureComponentType) { wgpu::BindingType::SampledTexture, false, false, - {}, wgpu::TextureViewDimension::e2D, wgpu::TextureComponentType::Float}}); wgpu::BindGroupLayout sameBgl = @@ -63,7 +62,6 @@ TEST_P(ObjectCachingTest, BindGroupLayoutTextureComponentType) { wgpu::BindingType::SampledTexture, false, false, - {}, wgpu::TextureViewDimension::e2D, wgpu::TextureComponentType::Float}}); wgpu::BindGroupLayout otherBgl = @@ -72,7 +70,6 @@ TEST_P(ObjectCachingTest, BindGroupLayoutTextureComponentType) { wgpu::BindingType::SampledTexture, false, false, - {}, wgpu::TextureViewDimension::e2D, wgpu::TextureComponentType::Uint}}); @@ -89,7 +86,6 @@ TEST_P(ObjectCachingTest, BindGroupLayoutViewDimension) { wgpu::BindingType::SampledTexture, false, false, - {}, wgpu::TextureViewDimension::e2D, wgpu::TextureComponentType::Float}}); wgpu::BindGroupLayout sameBgl = @@ -98,7 +94,6 @@ TEST_P(ObjectCachingTest, BindGroupLayoutViewDimension) { wgpu::BindingType::SampledTexture, false, false, - {}, wgpu::TextureViewDimension::e2D, wgpu::TextureComponentType::Float}}); wgpu::BindGroupLayout otherBgl = @@ -107,7 +102,6 @@ TEST_P(ObjectCachingTest, BindGroupLayoutViewDimension) { wgpu::BindingType::SampledTexture, false, false, - {}, wgpu::TextureViewDimension::e2DArray, wgpu::TextureComponentType::Float}}); diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp index 8e211ceb8d..f84e07c5bb 100644 --- a/src/tests/unittests/validation/BindGroupValidationTests.cpp +++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp @@ -310,7 +310,6 @@ TEST_F(BindGroupValidationTest, TextureComponentType) { wgpu::BindingType::SampledTexture, false, false, - {}, wgpu::TextureViewDimension::e2D, wgpu::TextureComponentType::Float}}); @@ -333,7 +332,6 @@ TEST_F(BindGroupValidationTest, TextureDimension) { wgpu::BindingType::SampledTexture, false, false, - {}, wgpu::TextureViewDimension::e2D, wgpu::TextureComponentType::Float}}); diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp index 369b0dac6c..7d20b1506c 100644 --- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -399,7 +399,6 @@ TEST_F(RenderPipelineValidationTest, TextureComponentTypeCompatibility) { wgpu::BindingType::SampledTexture, false, false, - {}, wgpu::TextureViewDimension::e2D, kTextureComponentTypes[j]}}); descriptor.layout = utils::MakeBasicPipelineLayout(device, &bgl); @@ -455,7 +454,6 @@ TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) { wgpu::BindingType::SampledTexture, false, false, - {}, kTextureViewDimensions[j], wgpu::TextureComponentType::Float}}); descriptor.layout = utils::MakeBasicPipelineLayout(device, &bgl); diff --git a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp index 33727fe8e1..9fddf897a3 100644 --- a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp +++ b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp @@ -864,12 +864,12 @@ namespace { // Create a bind group to use the texture as sampled and readonly storage bindings wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout( - device, {{0, wgpu::ShaderStage::Fragment | wgpu::ShaderStage::Compute, - wgpu::BindingType::SampledTexture}, - {1, wgpu::ShaderStage::Fragment | wgpu::ShaderStage::Compute, - wgpu::BindingType::ReadonlyStorageTexture, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}}); + device, + {{0, wgpu::ShaderStage::Fragment | wgpu::ShaderStage::Compute, + wgpu::BindingType::SampledTexture}, + {1, wgpu::ShaderStage::Fragment | wgpu::ShaderStage::Compute, + wgpu::BindingType::ReadonlyStorageTexture, false, false, + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bg = utils::MakeBindGroup(device, bgl, {{0, view}, {1, view}}); // Test render pass @@ -932,8 +932,7 @@ namespace { device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::SampledTexture}, {1, wgpu::ShaderStage::Compute, wgpu::BindingType::WriteonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bg = utils::MakeBindGroup(device, bgl, {{0, view}, {1, view}}); // Create a no-op compute pipeline @@ -978,8 +977,7 @@ namespace { wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::WriteonlyStorageTexture, false, - false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, + false, wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bg = utils::MakeBindGroup(device, bgl, {{0, view}}); @@ -1020,12 +1018,10 @@ namespace { wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::WriteonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}, + wgpu::TextureComponentType::Float, kFormat}, {1, wgpu::ShaderStage::Compute, wgpu::BindingType::WriteonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bg = utils::MakeBindGroup(device, bgl, {{0, view}, {1, view}}); // Create a no-op compute pipeline @@ -1104,13 +1100,11 @@ namespace { wgpu::BindGroupLayout readBGL = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::ReadonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroupLayout writeBGL = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::WriteonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup readBG = utils::MakeBindGroup(device, readBGL, {{0, view}}); wgpu::BindGroup writeBG = utils::MakeBindGroup(device, writeBGL, {{0, view}}); @@ -1138,13 +1132,11 @@ namespace { wgpu::BindGroupLayout writeBGL = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::WriteonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroupLayout readBGL = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::ReadonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup writeBG = utils::MakeBindGroup(device, writeBGL, {{0, view}}); wgpu::BindGroup readBG = utils::MakeBindGroup(device, readBGL, {{0, view}}); @@ -1182,8 +1174,7 @@ namespace { wgpu::BindGroupLayout writeBGL = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::WriteonlyStorageTexture, false, - false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, + false, wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup sampledBG = utils::MakeBindGroup(device, sampledBGL, {{0, view}}); wgpu::BindGroup writeBG = utils::MakeBindGroup(device, writeBGL, {{0, view}}); @@ -1214,13 +1205,11 @@ namespace { wgpu::BindGroupLayout readBGL = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::ReadonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroupLayout writeBGL = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::WriteonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup readBG = utils::MakeBindGroup(device, readBGL, {{0, view}}); wgpu::BindGroup writeBG = utils::MakeBindGroup(device, writeBGL, {{0, view}}); @@ -1260,8 +1249,7 @@ namespace { wgpu::BindGroupLayout writeBGL = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::WriteonlyStorageTexture, false, - false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, + false, wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup sampledBG = utils::MakeBindGroup(device, sampledBGL, {{0, view}}); wgpu::BindGroup writeBG = utils::MakeBindGroup(device, writeBGL, {{0, view}}); @@ -1290,13 +1278,11 @@ namespace { wgpu::BindGroupLayout readBGL = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::ReadonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroupLayout writeBGL = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::WriteonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup readBG = utils::MakeBindGroup(device, readBGL, {{0, view}}); wgpu::BindGroup writeBG = utils::MakeBindGroup(device, writeBGL, {{0, view}}); @@ -1419,14 +1405,12 @@ namespace { wgpu::BindGroupLayout writeBGL = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::WriteonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroupLayout readBGL = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::ReadonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup writeBG0 = utils::MakeBindGroup(device, writeBGL, {{0, view0}}); wgpu::BindGroup readBG0 = utils::MakeBindGroup(device, readBGL, {{0, view0}}); @@ -1484,12 +1468,10 @@ namespace { wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::ReadonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}, + wgpu::TextureComponentType::Float, kFormat}, {1, wgpu::ShaderStage::None, wgpu::BindingType::WriteonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bg = utils::MakeBindGroup(device, bgl, {{0, view}, {1, view}}); // These two bindings are invisible in render pass. But we still track these bindings. @@ -1508,12 +1490,10 @@ namespace { wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::ReadonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}, + wgpu::TextureComponentType::Float, kFormat}, {1, wgpu::ShaderStage::None, wgpu::BindingType::WriteonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bg = utils::MakeBindGroup(device, bgl, {{0, view}, {1, view}}); // Create a no-op compute pipeline. @@ -1549,8 +1529,7 @@ namespace { wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::ReadonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bg = utils::MakeBindGroup(device, bgl, {{0, view}}); // Texture usage in compute stage in bind group conflicts with render target. And @@ -1569,12 +1548,10 @@ namespace { wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::ReadonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}, + wgpu::TextureComponentType::Float, kFormat}, {1, wgpu::ShaderStage::Compute, wgpu::BindingType::WriteonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bg = utils::MakeBindGroup(device, bgl, {{0, view}, {1, view}}); // Create a no-op compute pipeline. @@ -1604,15 +1581,15 @@ namespace { // Create bind groups. wgpu::BindGroupLayout readBGL = utils::MakeBindGroupLayout( - device, {{0, wgpu::ShaderStage::Fragment | wgpu::ShaderStage::Compute, - wgpu::BindingType::ReadonlyStorageTexture, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}}); + device, + {{0, wgpu::ShaderStage::Fragment | wgpu::ShaderStage::Compute, + wgpu::BindingType::ReadonlyStorageTexture, false, false, + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroupLayout writeBGL = utils::MakeBindGroupLayout( - device, {{0, wgpu::ShaderStage::Fragment | wgpu::ShaderStage::Compute, - wgpu::BindingType::WriteonlyStorageTexture, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}}); + device, + {{0, wgpu::ShaderStage::Fragment | wgpu::ShaderStage::Compute, + wgpu::BindingType::WriteonlyStorageTexture, false, false, + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup readBG = utils::MakeBindGroup(device, readBGL, {{0, view}}); wgpu::BindGroup writeBG = utils::MakeBindGroup(device, writeBGL, {{0, view}}); diff --git a/src/tests/unittests/validation/StorageTextureValidationTests.cpp b/src/tests/unittests/validation/StorageTextureValidationTests.cpp index 2530162d82..bb1f09e2b0 100644 --- a/src/tests/unittests/validation/StorageTextureValidationTests.cpp +++ b/src/tests/unittests/validation/StorageTextureValidationTests.cpp @@ -877,9 +877,9 @@ TEST_F(StorageTextureValidationTests, StorageTextureInRenderPass) { for (wgpu::BindingType storageTextureType : kSupportedStorageTextureBindingTypes) { // Create a bind group that contains a storage texture. wgpu::BindGroupLayout bindGroupLayout = utils::MakeBindGroupLayout( - device, {{0, wgpu::ShaderStage::Fragment, storageTextureType, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}}); + device, + {{0, wgpu::ShaderStage::Fragment, storageTextureType, false, false, + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bindGroupWithStorageTexture = utils::MakeBindGroup(device, bindGroupLayout, {{0, storageTexture.CreateView()}}); @@ -912,11 +912,9 @@ TEST_F(StorageTextureValidationTests, StorageTextureAndSampledTextureInOneRender wgpu::BindGroupLayout bindGroupLayout = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Fragment, storageTextureType, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}, + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}, {1, wgpu::ShaderStage::Fragment, wgpu::BindingType::SampledTexture, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}}); + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bindGroup = utils::MakeBindGroup( device, bindGroupLayout, {{0, storageTexture.CreateView()}, {1, storageTexture.CreateView()}}); @@ -953,9 +951,9 @@ TEST_F(StorageTextureValidationTests, StorageTextureAndOutputAttachmentInOneRend for (wgpu::BindingType storageTextureType : kSupportedStorageTextureBindingTypes) { // Create a bind group that contains a storage texture. wgpu::BindGroupLayout bindGroupLayout = utils::MakeBindGroupLayout( - device, {{0, wgpu::ShaderStage::Fragment, storageTextureType, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}}); + device, + {{0, wgpu::ShaderStage::Fragment, storageTextureType, false, false, + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bindGroupWithStorageTexture = utils::MakeBindGroup(device, bindGroupLayout, {{0, storageTexture.CreateView()}}); @@ -980,11 +978,9 @@ TEST_F(StorageTextureValidationTests, ReadOnlyAndWriteOnlyStorageTextureInOneRen wgpu::BindGroupLayout bindGroupLayout = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::ReadonlyStorageTexture, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}, + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}, {1, wgpu::ShaderStage::Fragment, wgpu::BindingType::WriteonlyStorageTexture, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}}); + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bindGroup = utils::MakeBindGroup(device, bindGroupLayout, {{0, storageTexture.CreateView()}, {1, storageTexture.CreateView()}}); @@ -1013,11 +1009,9 @@ TEST_F(StorageTextureValidationTests, StorageTextureAndSampledTextureInOneComput wgpu::BindGroupLayout bindGroupLayout = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, storageTextureType, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}, + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}, {1, wgpu::ShaderStage::Compute, wgpu::BindingType::SampledTexture, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}}); + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bindGroup = utils::MakeBindGroup( device, bindGroupLayout, {{0, storageTexture.CreateView()}, {1, storageTexture.CreateView()}}); @@ -1043,11 +1037,9 @@ TEST_F(StorageTextureValidationTests, ReadOnlyAndWriteOnlyStorageTextureInOneCom wgpu::BindGroupLayout bindGroupLayout = utils::MakeBindGroupLayout( device, {{0, wgpu::ShaderStage::Compute, wgpu::BindingType::ReadonlyStorageTexture, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}, + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}, {1, wgpu::ShaderStage::Compute, wgpu::BindingType::WriteonlyStorageTexture, false, false, - wgpu::TextureViewDimension::Undefined, wgpu::TextureViewDimension::Undefined, - wgpu::TextureComponentType::Float, kFormat}}); + wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bindGroup = utils::MakeBindGroup(device, bindGroupLayout, {{0, storageTexture.CreateView()}, {1, storageTexture.CreateView()}}); diff --git a/src/tests/unittests/validation/TextureSubresourceTests.cpp b/src/tests/unittests/validation/TextureSubresourceTests.cpp index bab0544f5f..132544633c 100644 --- a/src/tests/unittests/validation/TextureSubresourceTests.cpp +++ b/src/tests/unittests/validation/TextureSubresourceTests.cpp @@ -77,8 +77,7 @@ namespace { device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::ReadonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bindGroup1 = utils::MakeBindGroup(device, bgl1, {{0, samplerView}}); @@ -109,8 +108,7 @@ namespace { device, {{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::WriteonlyStorageTexture, false, false, wgpu::TextureViewDimension::Undefined, - wgpu::TextureViewDimension::Undefined, wgpu::TextureComponentType::Float, - kFormat}}); + wgpu::TextureComponentType::Float, kFormat}}); wgpu::BindGroup bindGroup1 = utils::MakeBindGroup(device, bgl1, {{0, samplerView}}); wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); diff --git a/src/tests/unittests/wire/WireArgumentTests.cpp b/src/tests/unittests/wire/WireArgumentTests.cpp index 359f28fd9f..d2266b8d48 100644 --- a/src/tests/unittests/wire/WireArgumentTests.cpp +++ b/src/tests/unittests/wire/WireArgumentTests.cpp @@ -313,7 +313,6 @@ TEST_F(WireArgumentTests, StructureOfStructureArrayArgument) { WGPUBindingType_Sampler, false, false, - {}, WGPUTextureViewDimension_2D, WGPUTextureComponentType_Float, WGPUTextureFormat_RGBA8Unorm}, @@ -322,7 +321,6 @@ TEST_F(WireArgumentTests, StructureOfStructureArrayArgument) { WGPUBindingType_SampledTexture, false, false, - {}, WGPUTextureViewDimension_2D, WGPUTextureComponentType_Float, WGPUTextureFormat_RGBA8Unorm}, @@ -331,7 +329,6 @@ TEST_F(WireArgumentTests, StructureOfStructureArrayArgument) { WGPUBindingType_UniformBuffer, false, false, - {}, WGPUTextureViewDimension_2D, WGPUTextureComponentType_Float, WGPUTextureFormat_RGBA8Unorm},