diff --git a/src/gpu/vk/GrVkRenderTarget.cpp b/src/gpu/vk/GrVkRenderTarget.cpp index 32dbb3f026..e19f669387 100644 --- a/src/gpu/vk/GrVkRenderTarget.cpp +++ b/src/gpu/vk/GrVkRenderTarget.cpp @@ -199,16 +199,18 @@ sk_sp GrVkRenderTarget::MakeWrappedRenderTarget( colorAttachmentView = sk_ref_sp(vkMSAAAttachment->view()); - // Create Resolve attachment view + // Create Resolve attachment view. Attachment views on framebuffers must have a single mip + // level. resolveAttachmentView = - GrVkImageView::Make(gpu, info.fImage, pixelFormat, GrVkImageView::kColor_Type, 1, - GrVkYcbcrConversionInfo()); + GrVkImageView::Make(gpu, info.fImage, pixelFormat, GrVkImageView::kColor_Type, + /*miplevels=*/1, GrVkYcbcrConversionInfo()); if (!resolveAttachmentView) { return nullptr; } } else { + // Attachment views on framebuffers must have a single mip level. colorAttachmentView = GrVkImageView::Make(gpu, info.fImage, pixelFormat, - GrVkImageView::kColor_Type, 1, + GrVkImageView::kColor_Type, /*miplevels=*/1, GrVkYcbcrConversionInfo()); } diff --git a/src/gpu/vk/GrVkTextureRenderTarget.cpp b/src/gpu/vk/GrVkTextureRenderTarget.cpp index 2d0030254b..de5828bbee 100644 --- a/src/gpu/vk/GrVkTextureRenderTarget.cpp +++ b/src/gpu/vk/GrVkTextureRenderTarget.cpp @@ -130,7 +130,7 @@ static Views create_views(GrVkGpu* gpu, SkISize dimensions, int sampleCnt, auto rp = gpu->getContext()->priv().resourceProvider(); sk_sp msaaAttachment = rp->makeMSAAAttachment(dimensions, GrBackendFormat::MakeVk(info.fFormat), - sampleCnt, info.fProtected); + sampleCnt, info.fProtected); if (!msaaAttachment) { return {}; } @@ -140,16 +140,18 @@ static Views create_views(GrVkGpu* gpu, SkISize dimensions, int sampleCnt, views.colorAttachmentView = sk_ref_sp(views.msaaAttachment->view()); - // Create resolve attachment view. + // Create resolve attachment view. Attachment views on framebuffers must have a single mip + // level. views.resolveAttachmentView = GrVkImageView::Make(gpu, image, pixelFormat, GrVkImageView::kColor_Type, - info.fLevelCount, GrVkYcbcrConversionInfo()); + /*miplevels=*/1, GrVkYcbcrConversionInfo()); if (!views.resolveAttachmentView) { return {}; } } else { + //Attachment views on framebuffers must have a single mip level. views.colorAttachmentView = GrVkImageView::Make( - gpu, info.fImage, pixelFormat, GrVkImageView::kColor_Type, 1, + gpu, info.fImage, pixelFormat, GrVkImageView::kColor_Type, /*miplevels=*/1, GrVkYcbcrConversionInfo()); }