Fix vk framebuffer attachment views to only have 1 mip level.
Bug: skia:10979 Change-Id: Ib7329056a72d2dd2255758ee992dbf93578ee12b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347858 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
b5d30dc414
commit
831e13324a
@ -199,16 +199,18 @@ sk_sp<GrVkRenderTarget> GrVkRenderTarget::MakeWrappedRenderTarget(
|
||||
|
||||
colorAttachmentView = sk_ref_sp<const GrVkImageView>(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());
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ static Views create_views(GrVkGpu* gpu, SkISize dimensions, int sampleCnt,
|
||||
auto rp = gpu->getContext()->priv().resourceProvider();
|
||||
sk_sp<GrAttachment> 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<const GrVkImageView>(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());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user