diff --git a/dawn.json b/dawn.json index 3d6d51bc11..d52b9d170f 100644 --- a/dawn.json +++ b/dawn.json @@ -2820,8 +2820,7 @@ {"value": 4, "name": "texture binding"}, {"value": 8, "name": "storage binding"}, {"value": 16, "name": "render attachment"}, - {"value": 32, "name": "present", "tags": ["dawn"]}, - {"value": 64, "name": "transient attachment", "tags": ["dawn"]} + {"value": 32, "name": "transient attachment", "tags": ["dawn"]} ] }, "texture view descriptor": { diff --git a/src/dawn/native/dawn_platform.h b/src/dawn/native/dawn_platform.h index 23388b500f..c5229aed85 100644 --- a/src/dawn/native/dawn_platform.h +++ b/src/dawn/native/dawn_platform.h @@ -42,6 +42,11 @@ static constexpr wgpu::BufferUsage kAllInternalBufferUsages = kInternalStorageBuffer | kReadOnlyStorageBuffer; // Extra texture usages +// Add an extra texture usage for textures that will be presented, for use in backends +// that needs to transition to present usage. +static constexpr wgpu::TextureUsage kPresentTextureUsage = + static_cast(0x20000000); + // Add an extra texture usage (readonly render attachment usage) for render pass resource // tracking static constexpr wgpu::TextureUsage kReadOnlyRenderAttachment = @@ -52,12 +57,6 @@ static constexpr wgpu::TextureUsage kReadOnlyRenderAttachment = static constexpr wgpu::TextureUsage kAgainAsRenderAttachment = static_cast(0x80000001); -// Add an extra texture usage for textures that will be presented, for use in backends -// that needs to transition to present usage. -// This currently aliases wgpu::TextureUsage::Present, we would assign it -// some bit when wgpu::TextureUsage::Present is removed. -static constexpr wgpu::TextureUsage kPresentTextureUsage = wgpu::TextureUsage::Present; - static constexpr wgpu::BufferBindingType kInternalStorageBufferBinding = static_cast(0xFFFFFFFF); } // namespace dawn::native diff --git a/src/dawn/tests/unittests/validation/StorageTextureValidationTests.cpp b/src/dawn/tests/unittests/validation/StorageTextureValidationTests.cpp index 030ab73fd5..b95129f3aa 100644 --- a/src/dawn/tests/unittests/validation/StorageTextureValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/StorageTextureValidationTests.cpp @@ -601,10 +601,10 @@ TEST_F(StorageTextureValidationTests, StorageTextureBindingTypeInBindGroup) { // created with the texture usage wgpu::TextureUsage::StorageBinding. TEST_F(StorageTextureValidationTests, StorageTextureUsageInBindGroup) { constexpr wgpu::TextureFormat kStorageTextureFormat = wgpu::TextureFormat::R32Float; - constexpr std::array kTextureUsages = { - wgpu::TextureUsage::CopySrc, wgpu::TextureUsage::CopyDst, - wgpu::TextureUsage::TextureBinding, wgpu::TextureUsage::StorageBinding, - wgpu::TextureUsage::RenderAttachment, wgpu::TextureUsage::Present}; + constexpr std::array kTextureUsages = { + wgpu::TextureUsage::CopySrc, wgpu::TextureUsage::CopyDst, + wgpu::TextureUsage::TextureBinding, wgpu::TextureUsage::StorageBinding, + wgpu::TextureUsage::RenderAttachment}; for (wgpu::StorageTextureAccess storageBindingType : kSupportedStorageTextureAccess) { // Create a bind group layout. diff --git a/src/dawn/tests/unittests/validation/TextureValidationTests.cpp b/src/dawn/tests/unittests/validation/TextureValidationTests.cpp index 4a512fda61..e48d4a96b1 100644 --- a/src/dawn/tests/unittests/validation/TextureValidationTests.cpp +++ b/src/dawn/tests/unittests/validation/TextureValidationTests.cpp @@ -755,7 +755,6 @@ TEST_F(CompressedTextureFormatsValidationTests, TextureUsage) { wgpu::TextureUsage invalidUsages[] = { wgpu::TextureUsage::RenderAttachment, wgpu::TextureUsage::StorageBinding, - wgpu::TextureUsage::Present, }; for (wgpu::TextureFormat format : utils::kCompressedFormats) { for (wgpu::TextureUsage usage : invalidUsages) {