Dawn: fix rendering to mipmapped textures.
Use a texture view with a mipLevelCount of 1 when using a texture
as an attachment.
Dawn validation will fail if the view has more than one mip.
Change-Id: I6a3594dade9f65fa8e713d433797414c6ba8ecec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249423
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
diff --git a/src/gpu/dawn/GrDawnOpsRenderPass.cpp b/src/gpu/dawn/GrDawnOpsRenderPass.cpp
index 48fc8a7..144f16b 100644
--- a/src/gpu/dawn/GrDawnOpsRenderPass.cpp
+++ b/src/gpu/dawn/GrDawnOpsRenderPass.cpp
@@ -59,7 +59,9 @@
dawn::Texture texture = static_cast<GrDawnRenderTarget*>(fRenderTarget)->texture();
auto stencilAttachment = static_cast<GrDawnStencilAttachment*>(
fRenderTarget->renderTargetPriv().getStencilAttachment());
- dawn::TextureView colorView = texture.CreateView();
+ dawn::TextureViewDescriptor desc;
+ desc.mipLevelCount = 1;
+ dawn::TextureView colorView = texture.CreateView(&desc);
const float *c = fColorInfo.fClearColor.vec();
dawn::RenderPassColorAttachmentDescriptor colorAttachment;