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

Unified Diff: src/gpu/vk/GrVkResourceProvider.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/GrVkResourceProvider.h ('k') | src/gpu/vk/GrVkSampler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkResourceProvider.cpp
diff --git a/src/gpu/vk/GrVkResourceProvider.cpp b/src/gpu/vk/GrVkResourceProvider.cpp
index 7def55d5551221b0586a297c6e5c0eed8eccf570..8ba5ade3336b1f349cddcbc6e5efce3cb1ac178f 100644
--- a/src/gpu/vk/GrVkResourceProvider.cpp
+++ b/src/gpu/vk/GrVkResourceProvider.cpp
@@ -85,10 +85,11 @@ GrVkDescriptorPool* GrVkResourceProvider::findOrCreateCompatibleDescriptorPool(
return new GrVkDescriptorPool(fGpu, type, count);
}
-GrVkSampler* GrVkResourceProvider::findOrCreateCompatibleSampler(const GrTextureParams& params) {
- GrVkSampler* sampler = fSamplers.find(GrVkSampler::GenerateKey(params));
+GrVkSampler* GrVkResourceProvider::findOrCreateCompatibleSampler(const GrTextureParams& params,
+ uint32_t mipLevels) {
+ GrVkSampler* sampler = fSamplers.find(GrVkSampler::GenerateKey(params, mipLevels));
if (!sampler) {
- sampler = GrVkSampler::Create(fGpu, params);
+ sampler = GrVkSampler::Create(fGpu, params, mipLevels);
fSamplers.add(sampler);
}
SkASSERT(sampler);
@@ -136,7 +137,7 @@ void GrVkResourceProvider::destroyResources() {
fSimpleRenderPasses.reset();
// Iterate through all store GrVkSamplers and unref them before resetting the hash.
- SkTDynamicHash<GrVkSampler, uint8_t>::Iter iter(&fSamplers);
+ SkTDynamicHash<GrVkSampler, uint16_t>::Iter iter(&fSamplers);
for (; !iter.done(); ++iter) {
(*iter).unref(fGpu);
}
@@ -166,7 +167,7 @@ void GrVkResourceProvider::abandonResources() {
fSimpleRenderPasses.reset();
// Iterate through all store GrVkSamplers and unrefAndAbandon them before resetting the hash.
- SkTDynamicHash<GrVkSampler, uint8_t>::Iter iter(&fSamplers);
+ SkTDynamicHash<GrVkSampler, uint16_t>::Iter iter(&fSamplers);
for (; !iter.done(); ++iter) {
(*iter).unrefAndAbandon();
}
« no previous file with comments | « src/gpu/vk/GrVkResourceProvider.h ('k') | src/gpu/vk/GrVkSampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698