Refactor/remove dawn-defined buffer and texture usages

This change refactors dawn-defined buffer and texture usages.
It groups buffer usages together, and groups texture usages
together, in order to avoid values conflict. It also removes
kReadOnlyStorageTexture because its definition has already been
removed.

Bug: dawn:485
Change-Id: I8c772ebadd3d276905fbcdb3283f0d5d89f74dd6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65680
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This commit is contained in:
Yunchao He 2021-10-01 16:20:35 +00:00 committed by Dawn LUCI CQ
parent d85bbb6128
commit 698bb821c7
2 changed files with 10 additions and 5 deletions

View File

@ -165,7 +165,6 @@ namespace dawn_native {
case tint::inspector::ResourceBinding::ResourceType::kDepthTexture:
case tint::inspector::ResourceBinding::ResourceType::kDepthMultisampledTexture:
return BindingInfoType::Texture;
case tint::inspector::ResourceBinding::ResourceType::kReadOnlyStorageTexture:
case tint::inspector::ResourceBinding::ResourceType::kWriteOnlyStorageTexture:
return BindingInfoType::StorageTexture;
case tint::inspector::ResourceBinding::ResourceType::kExternalTexture:

View File

@ -23,9 +23,19 @@
#include <dawn_native/wgpu_structs_autogen.h>
namespace dawn_native {
// Extra buffer usages
// Add an extra buffer usage and an extra binding type for binding the buffers with QueryResolve
// usage as storage buffer in the internal pipeline.
static constexpr wgpu::BufferUsage kInternalStorageBuffer =
static_cast<wgpu::BufferUsage>(0x40000000);
// Add an extra buffer usage (readonly storage buffer usage) for render pass resource tracking
static constexpr wgpu::BufferUsage kReadOnlyStorageBuffer =
static_cast<wgpu::BufferUsage>(0x80000000);
// Extra texture usages
// Add an extra texture usage (readonly render attachment usage) for render pass resource
// tracking
static constexpr wgpu::TextureUsage kReadOnlyRenderAttachment =
static_cast<wgpu::TextureUsage>(0x40000000);
@ -40,10 +50,6 @@ namespace dawn_native {
// some bit when wgpu::TextureUsage::Present is removed.
static constexpr wgpu::TextureUsage kPresentTextureUsage = wgpu::TextureUsage::Present;
// Add an extra buffer usage and an extra binding type for binding the buffers with QueryResolve
// usage as storage buffer in the internal pipeline.
static constexpr wgpu::BufferUsage kInternalStorageBuffer =
static_cast<wgpu::BufferUsage>(0x40000000);
static constexpr wgpu::BufferBindingType kInternalStorageBufferBinding =
static_cast<wgpu::BufferBindingType>(0xFFFFFFFF);
} // namespace dawn_native