Skip to content

Commit

Permalink
Remove unused GrVkDescriptorSetManager factor.
Browse files Browse the repository at this point in the history
Change-Id: I50476e8b8bc9796656cb87cdbd6ec0fe83819f0e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314496
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
  • Loading branch information
egdaniel authored and Skia Commit-Bot committed Sep 2, 2020
1 parent c0dd06d commit e9a9ad9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 56 deletions.
30 changes: 0 additions & 30 deletions src/gpu/vk/GrVkDescriptorSetManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ GrVkDescriptorSetManager* GrVkDescriptorSetManager::CreateSamplerManager(
return Create(gpu, type, visibilities, immutableSamplers);
}

GrVkDescriptorSetManager* GrVkDescriptorSetManager::CreateSamplerManager(
GrVkGpu* gpu, VkDescriptorType type, const SkTArray<uint32_t>& visibilities) {
SkSTArray<4, const GrVkSampler*> immutableSamplers;
SkASSERT(type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER);
for (int i = 0 ; i < visibilities.count(); ++i) {
immutableSamplers.push_back(nullptr);
}
return Create(gpu, type, visibilities, immutableSamplers);
}

VkShaderStageFlags visibility_to_vk_stage_flags(uint32_t visibility) {
VkShaderStageFlags flags = 0;

Expand Down Expand Up @@ -254,26 +244,6 @@ bool GrVkDescriptorSetManager::isCompatible(VkDescriptorType type,
return true;
}

bool GrVkDescriptorSetManager::isCompatible(VkDescriptorType type,
const SkTArray<uint32_t>& visibilities) const {
if (type != fPoolManager.fDescType) {
return false;
}

if (VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER == type ||
VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER == type) {
if (fBindingVisibilities.count() != visibilities.count()) {
return false;
}
for (int i = 0; i < visibilities.count(); ++i) {
if (visibilities[i] != fBindingVisibilities[i] || fImmutableSamplers[i] != nullptr) {
return false;
}
}
}
return true;
}

////////////////////////////////////////////////////////////////////////////////

GrVkDescriptorSetManager::DescriptorPoolManager::DescriptorPoolManager(
Expand Down
4 changes: 0 additions & 4 deletions src/gpu/vk/GrVkDescriptorSetManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class GrVkDescriptorSetManager {
static GrVkDescriptorSetManager* CreateUniformManager(GrVkGpu* gpu);
static GrVkDescriptorSetManager* CreateSamplerManager(GrVkGpu* gpu, VkDescriptorType type,
const GrVkUniformHandler&);
static GrVkDescriptorSetManager* CreateSamplerManager(GrVkGpu* gpu, VkDescriptorType type,
const SkTArray<uint32_t>& visibilities);

~GrVkDescriptorSetManager() {}

Expand All @@ -44,8 +42,6 @@ class GrVkDescriptorSetManager {
void recycleDescriptorSet(const GrVkDescriptorSet*);

bool isCompatible(VkDescriptorType type, const GrVkUniformHandler*) const;
bool isCompatible(VkDescriptorType type,
const SkTArray<uint32_t>& visibilities) const;

private:
struct DescriptorPoolManager {
Expand Down
19 changes: 0 additions & 19 deletions src/gpu/vk/GrVkResourceProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,25 +280,6 @@ void GrVkResourceProvider::getSamplerDescriptorSetHandle(VkDescriptorType type,
*handle = GrVkDescriptorSetManager::Handle(fDescriptorSetManagers.count() - 1);
}

void GrVkResourceProvider::getSamplerDescriptorSetHandle(VkDescriptorType type,
const SkTArray<uint32_t>& visibilities,
GrVkDescriptorSetManager::Handle* handle) {
SkASSERT(handle);
SkASSERT(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER == type ||
VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER == type);
for (int i = 0; i < fDescriptorSetManagers.count(); ++i) {
if (fDescriptorSetManagers[i]->isCompatible(type, visibilities)) {
*handle = GrVkDescriptorSetManager::Handle(i);
return;
}
}

GrVkDescriptorSetManager* dsm = GrVkDescriptorSetManager::CreateSamplerManager(fGpu, type,
visibilities);
fDescriptorSetManagers.emplace_back(dsm);
*handle = GrVkDescriptorSetManager::Handle(fDescriptorSetManagers.count() - 1);
}

VkDescriptorSetLayout GrVkResourceProvider::getUniformDSLayout() const {
SkASSERT(fUniformDSHandle.isValid());
return fDescriptorSetManagers[fUniformDSHandle.toIndex()]->layout();
Expand Down
3 changes: 0 additions & 3 deletions src/gpu/vk/GrVkResourceProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ class GrVkResourceProvider {
void getSamplerDescriptorSetHandle(VkDescriptorType type,
const GrVkUniformHandler&,
GrVkDescriptorSetManager::Handle* handle);
void getSamplerDescriptorSetHandle(VkDescriptorType type,
const SkTArray<uint32_t>& visibilities,
GrVkDescriptorSetManager::Handle* handle);

// Returns the compatible VkDescriptorSetLayout to use for uniform buffers. The caller does not
// own the VkDescriptorSetLayout and thus should not delete it. This function should be used
Expand Down

0 comments on commit e9a9ad9

Please sign in to comment.