dawn_native: Make CreateView's descriptor default to nullptr

This matches the defaults of webgpu.h and allows its use from inside
dawn_native for the implementations of SwapChain.

Bug: dawn:269
Change-Id: Icfe15f1775e78690fe4fb7b871bd0c0365d444e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33783
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Corentin Wallez 2020-11-25 09:39:44 +00:00 committed by Commit Bot service account
parent ce74d8256e
commit a66263753a
5 changed files with 6 additions and 6 deletions

View File

@ -189,7 +189,7 @@ namespace dawn_native {
// of dawn_native
mCurrentTexture = AcquireRef(GetNextTextureImpl(&descriptor));
mCurrentTextureView = mCurrentTexture->CreateView(nullptr);
mCurrentTextureView = mCurrentTexture->CreateView();
return mCurrentTextureView.Get();
}

View File

@ -139,7 +139,7 @@ namespace dawn_native {
const Extent3D& extent) const;
// Dawn API
TextureViewBase* CreateView(const TextureViewDescriptor* descriptor);
TextureViewBase* CreateView(const TextureViewDescriptor* descriptor = nullptr);
void Destroy();
protected:

View File

@ -129,7 +129,7 @@ namespace dawn_native { namespace metal {
mTexture = AcquireRef(
new Texture(ToBackend(GetDevice()), &textureDesc, [*mCurrentDrawable texture]));
return mTexture->CreateView(nullptr);
return mTexture->CreateView();
}
void SwapChain::DetachFromSurfaceImpl() {

View File

@ -383,7 +383,7 @@ namespace dawn_native { namespace null {
TextureDescriptor textureDesc = GetSwapChainBaseTextureDescriptor(this);
mTexture = AcquireRef(
new Texture(GetDevice(), &textureDesc, TextureBase::TextureState::OwnedInternal));
return mTexture->CreateView(nullptr);
return mTexture->CreateView();
}
void SwapChain::DetachFromSurfaceImpl() {

View File

@ -590,7 +590,7 @@ namespace dawn_native { namespace vulkan {
// In the happy path we can use the swapchain image directly.
if (!mConfig.needsBlit) {
return mTexture->CreateView(nullptr);
return mTexture->CreateView();
}
// The blit texture always perfectly matches what the user requested for the swapchain.
@ -598,7 +598,7 @@ namespace dawn_native { namespace vulkan {
TextureDescriptor desc = GetSwapChainBaseTextureDescriptor(this);
DAWN_TRY_ASSIGN(mBlitTexture,
Texture::Create(device, &desc, VK_IMAGE_USAGE_TRANSFER_SRC_BIT));
return mBlitTexture->CreateView(nullptr);
return mBlitTexture->CreateView();
}
void SwapChain::DetachFromSurfaceImpl() {