Index: src/gpu/vk/GrVkResourceProvider.cpp |
diff --git a/src/gpu/vk/GrVkResourceProvider.cpp b/src/gpu/vk/GrVkResourceProvider.cpp |
index b1817cf3ea2e7ba1b626bdfb4fe71ab9a71986a4..e581384ddfb4800f9f688a3da9fddc2a95fdce1a 100644 |
--- a/src/gpu/vk/GrVkResourceProvider.cpp |
+++ b/src/gpu/vk/GrVkResourceProvider.cpp |
@@ -177,6 +177,22 @@ void GrVkResourceProvider::getSamplerDescriptorSetHandle(const GrVkUniformHandle |
*handle = GrVkDescriptorSetManager::Handle(fDescriptorSetManagers.count() - 1); |
} |
+void GrVkResourceProvider::getSamplerDescriptorSetHandle(const SkTArray<uint32_t>& visibilities, |
+ GrVkDescriptorSetManager::Handle* handle) { |
+ SkASSERT(handle); |
+ for (int i = 0; i < fDescriptorSetManagers.count(); ++i) { |
+ if (fDescriptorSetManagers[i].isCompatible(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, |
+ visibilities)) { |
+ *handle = GrVkDescriptorSetManager::Handle(i); |
+ return; |
+ } |
+ } |
+ |
+ fDescriptorSetManagers.emplace_back(fGpu, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, |
+ visibilities); |
+ *handle = GrVkDescriptorSetManager::Handle(fDescriptorSetManagers.count() - 1); |
+} |
+ |
VkDescriptorSetLayout GrVkResourceProvider::getUniformDSLayout() const { |
SkASSERT(fUniformDSHandle.isValid()); |
return fDescriptorSetManagers[fUniformDSHandle.toIndex()].layout(); |