Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: src/gpu/vk/GrVkTextureRenderTarget.cpp

Issue 1916563002: Add automatic generation of mipmaps to Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkTexture.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkTextureRenderTarget.cpp
diff --git a/src/gpu/vk/GrVkTextureRenderTarget.cpp b/src/gpu/vk/GrVkTextureRenderTarget.cpp
index 6bfdf3e8cf884792365cd216711caed1545355f8..6742a9195c856ca89d921e939bf449e7881983f7 100644
--- a/src/gpu/vk/GrVkTextureRenderTarget.cpp
+++ b/src/gpu/vk/GrVkTextureRenderTarget.cpp
@@ -12,6 +12,8 @@
#include "GrVkImageView.h"
#include "GrVkUtil.h"
+#include "SkMipmap.h"
+
#include "vk/GrVkTypes.h"
#define VK_CALL(GPU, X) GR_VK_CALL(GPU->vkInterface(), X)
@@ -24,8 +26,13 @@ GrVkTextureRenderTarget* GrVkTextureRenderTarget::Create(GrVkGpu* gpu,
const GrVkImage::Resource* imageResource) {
VkImage image = imageResource->fImage;
// Create the texture ImageView
+ uint32_t mipLevels = 1;
+ //TODO: does a mipmapped textureRenderTarget make sense?
+ //if (desc.fIsMipMapped) {
+ // mipLevels = SkMipMap::ComputeLevelCount(this->width(), this->height());
+ //}
const GrVkImageView* imageView = GrVkImageView::Create(gpu, image, format,
- GrVkImageView::kColor_Type);
+ GrVkImageView::kColor_Type, mipLevels);
if (!imageView) {
return nullptr;
}
@@ -67,7 +74,7 @@ GrVkTextureRenderTarget* GrVkTextureRenderTarget::Create(GrVkGpu* gpu,
resolveAttachmentView->ref();
} else {
resolveAttachmentView = GrVkImageView::Create(gpu, image, pixelFormat,
- GrVkImageView::kColor_Type);
+ GrVkImageView::kColor_Type, 1);
if (!resolveAttachmentView) {
msaaImageResource->unref(gpu);
imageView->unref(gpu);
@@ -88,7 +95,7 @@ GrVkTextureRenderTarget* GrVkTextureRenderTarget::Create(GrVkGpu* gpu,
colorAttachmentView->ref();
} else {
colorAttachmentView = GrVkImageView::Create(gpu, colorImage, pixelFormat,
- GrVkImageView::kColor_Type);
+ GrVkImageView::kColor_Type, 1);
if (!colorAttachmentView) {
if (msaaImageResource) {
resolveAttachmentView->unref(gpu);
« no previous file with comments | « src/gpu/vk/GrVkTexture.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698