Update deprecated WebGPU TextureUsage flags

Updates TextureUsage::Sampled -> TextureBinding in all cases.
Sampled has been deprecated and this change will allow it's eventual
removal from Dawn.

Bug: dawn:1035
Change-Id: I3d802f49b035092d43b81315afeaae7a6b67531e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438616
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This commit is contained in:
Brandon Jones 2021-08-11 10:20:55 -07:00 committed by SkCQ
parent 8d11654c13
commit 319c70a3c0
2 changed files with 5 additions and 10 deletions

View File

@ -318,10 +318,8 @@ GrBackendTexture GrDawnGpu::onCreateBackendTexture(SkISize dimensions,
}
wgpu::TextureDescriptor desc;
desc.usage =
wgpu::TextureUsage::Sampled |
wgpu::TextureUsage::CopySrc |
wgpu::TextureUsage::CopyDst;
desc.usage = wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopySrc |
wgpu::TextureUsage::CopyDst;
if (GrRenderable::kYes == renderable) {
desc.usage |= wgpu::TextureUsage::RenderAttachment;
@ -682,8 +680,7 @@ bool GrDawnGpu::onRegenerateMipMapLevels(GrTexture* tex) {
// We have to do this even for renderable textures, since GrDawnRenderTarget currently only
// contains a view, not a texture.
wgpu::TextureDescriptor texDesc;
texDesc.usage = wgpu::TextureUsage::Sampled |
wgpu::TextureUsage::CopySrc |
texDesc.usage = wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopySrc |
wgpu::TextureUsage::RenderAttachment;
texDesc.size.width = (tex->width() + 1) / 2;
texDesc.size.height = (tex->height() + 1) / 2;

View File

@ -27,10 +27,8 @@ sk_sp<GrDawnTexture> GrDawnTexture::Make(GrDawnGpu* gpu, SkISize dimensions,
bool renderTarget = renderable == GrRenderable::kYes;
wgpu::TextureDescriptor textureDesc;
textureDesc.usage =
wgpu::TextureUsage::Sampled |
wgpu::TextureUsage::CopySrc |
wgpu::TextureUsage::CopyDst;
textureDesc.usage = wgpu::TextureUsage::TextureBinding | wgpu::TextureUsage::CopySrc |
wgpu::TextureUsage::CopyDst;
if (renderTarget) {
textureDesc.usage |= wgpu::TextureUsage::RenderAttachment;