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:
parent
d85bbb6128
commit
698bb821c7
|
@ -165,7 +165,6 @@ namespace dawn_native {
|
||||||
case tint::inspector::ResourceBinding::ResourceType::kDepthTexture:
|
case tint::inspector::ResourceBinding::ResourceType::kDepthTexture:
|
||||||
case tint::inspector::ResourceBinding::ResourceType::kDepthMultisampledTexture:
|
case tint::inspector::ResourceBinding::ResourceType::kDepthMultisampledTexture:
|
||||||
return BindingInfoType::Texture;
|
return BindingInfoType::Texture;
|
||||||
case tint::inspector::ResourceBinding::ResourceType::kReadOnlyStorageTexture:
|
|
||||||
case tint::inspector::ResourceBinding::ResourceType::kWriteOnlyStorageTexture:
|
case tint::inspector::ResourceBinding::ResourceType::kWriteOnlyStorageTexture:
|
||||||
return BindingInfoType::StorageTexture;
|
return BindingInfoType::StorageTexture;
|
||||||
case tint::inspector::ResourceBinding::ResourceType::kExternalTexture:
|
case tint::inspector::ResourceBinding::ResourceType::kExternalTexture:
|
||||||
|
|
|
@ -23,9 +23,19 @@
|
||||||
#include <dawn_native/wgpu_structs_autogen.h>
|
#include <dawn_native/wgpu_structs_autogen.h>
|
||||||
|
|
||||||
namespace dawn_native {
|
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
|
// Add an extra buffer usage (readonly storage buffer usage) for render pass resource tracking
|
||||||
static constexpr wgpu::BufferUsage kReadOnlyStorageBuffer =
|
static constexpr wgpu::BufferUsage kReadOnlyStorageBuffer =
|
||||||
static_cast<wgpu::BufferUsage>(0x80000000);
|
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 constexpr wgpu::TextureUsage kReadOnlyRenderAttachment =
|
||||||
static_cast<wgpu::TextureUsage>(0x40000000);
|
static_cast<wgpu::TextureUsage>(0x40000000);
|
||||||
|
|
||||||
|
@ -40,10 +50,6 @@ namespace dawn_native {
|
||||||
// some bit when wgpu::TextureUsage::Present is removed.
|
// some bit when wgpu::TextureUsage::Present is removed.
|
||||||
static constexpr wgpu::TextureUsage kPresentTextureUsage = wgpu::TextureUsage::Present;
|
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 constexpr wgpu::BufferBindingType kInternalStorageBufferBinding =
|
||||||
static_cast<wgpu::BufferBindingType>(0xFFFFFFFF);
|
static_cast<wgpu::BufferBindingType>(0xFFFFFFFF);
|
||||||
} // namespace dawn_native
|
} // namespace dawn_native
|
||||||
|
|
Loading…
Reference in New Issue