Remove wgpu::TextureUsage::Present

This is an internal usage only used for barriers management in some
backends, and doesn't need to be exposed publicly.

Fixed: dawn:1535
Change-Id: I0474977227230acbf7dd3cfa91bf589ffd9464fd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133460
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2023-05-23 08:16:01 +00:00 committed by Dawn LUCI CQ
parent 7aed27a2b0
commit 47245bc33f
4 changed files with 10 additions and 13 deletions

View File

@ -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": {

View File

@ -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<wgpu::TextureUsage>(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<wgpu::TextureUsage>(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<wgpu::BufferBindingType>(0xFFFFFFFF);
} // namespace dawn::native

View File

@ -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<wgpu::TextureUsage, 6> kTextureUsages = {
wgpu::TextureUsage::CopySrc, wgpu::TextureUsage::CopyDst,
wgpu::TextureUsage::TextureBinding, wgpu::TextureUsage::StorageBinding,
wgpu::TextureUsage::RenderAttachment, wgpu::TextureUsage::Present};
constexpr std::array<wgpu::TextureUsage, 5> 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.

View File

@ -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) {