Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit c797483

Browse files
SenorBlancoSkia Commit-Bot
authored andcommitted
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>
1 parent d4db6da commit c797483

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/gpu/dawn/GrDawnOpsRenderPass.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ dawn::RenderPassEncoder GrDawnOpsRenderPass::beginRenderPass(dawn::LoadOp colorO
5959
dawn::Texture texture = static_cast<GrDawnRenderTarget*>(fRenderTarget)->texture();
6060
auto stencilAttachment = static_cast<GrDawnStencilAttachment*>(
6161
fRenderTarget->renderTargetPriv().getStencilAttachment());
62-
dawn::TextureView colorView = texture.CreateView();
62+
dawn::TextureViewDescriptor desc;
63+
desc.mipLevelCount = 1;
64+
dawn::TextureView colorView = texture.CreateView(&desc);
6365
const float *c = fColorInfo.fClearColor.vec();
6466

6567
dawn::RenderPassColorAttachmentDescriptor colorAttachment;

0 commit comments

Comments
 (0)