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

Side by Side Diff: src/gpu/vk/GrVkStencilAttachment.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 unified diff | Download patch
« no previous file with comments | « src/gpu/vk/GrVkSampler.cpp ('k') | src/gpu/vk/GrVkTexture.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrVkStencilAttachment.h" 8 #include "GrVkStencilAttachment.h"
9 #include "GrVkGpu.h" 9 #include "GrVkGpu.h"
10 #include "GrVkImage.h" 10 #include "GrVkImage.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 VK_IMAGE_USAGE_TRANSFER_DST_BIT; 44 VK_IMAGE_USAGE_TRANSFER_DST_BIT;
45 imageDesc.fMemProps = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT; 45 imageDesc.fMemProps = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
46 46
47 const GrVkImage::Resource* imageResource = GrVkImage::CreateResource(gpu, im ageDesc); 47 const GrVkImage::Resource* imageResource = GrVkImage::CreateResource(gpu, im ageDesc);
48 if (!imageResource) { 48 if (!imageResource) {
49 return nullptr; 49 return nullptr;
50 } 50 }
51 51
52 const GrVkImageView* imageView = GrVkImageView::Create(gpu, imageResource->f Image, 52 const GrVkImageView* imageView = GrVkImageView::Create(gpu, imageResource->f Image,
53 format.fInternalForma t, 53 format.fInternalForma t,
54 GrVkImageView::kStenc il_Type); 54 GrVkImageView::kStenc il_Type, 1);
55 if (!imageView) { 55 if (!imageView) {
56 imageResource->unref(gpu); 56 imageResource->unref(gpu);
57 return nullptr; 57 return nullptr;
58 } 58 }
59 59
60 GrVkStencilAttachment* stencil = new GrVkStencilAttachment(gpu, format, imag eDesc, 60 GrVkStencilAttachment* stencil = new GrVkStencilAttachment(gpu, format, imag eDesc,
61 imageResource, im ageView); 61 imageResource, im ageView);
62 imageResource->unref(gpu); 62 imageResource->unref(gpu);
63 imageView->unref(gpu); 63 imageView->unref(gpu);
64 64
(...skipping 27 matching lines...) Expand all
92 this->abandonImage(); 92 this->abandonImage();
93 fStencilView->unrefAndAbandon(); 93 fStencilView->unrefAndAbandon();
94 fStencilView = nullptr; 94 fStencilView = nullptr;
95 GrStencilAttachment::onAbandon(); 95 GrStencilAttachment::onAbandon();
96 } 96 }
97 97
98 GrVkGpu* GrVkStencilAttachment::getVkGpu() const { 98 GrVkGpu* GrVkStencilAttachment::getVkGpu() const {
99 SkASSERT(!this->wasDestroyed()); 99 SkASSERT(!this->wasDestroyed());
100 return static_cast<GrVkGpu*>(this->getGpu()); 100 return static_cast<GrVkGpu*>(this->getGpu());
101 } 101 }
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkSampler.cpp ('k') | src/gpu/vk/GrVkTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698