aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkDescriptorPool.cpp
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2016-02-22 06:17:52 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-22 06:17:53 -0800
commitad3a13c4c34d300882b8f9a5fdb98ad34a9df55b (patch)
tree81916dad8832c11247a1ed0686bfb210a9c113bd /src/gpu/vk/GrVkDescriptorPool.cpp
parent48cf268defad66f58f1aa03b4835e5583be96b2f (diff)
Revert of Add vulkan files into skia repo. (patchset #2 id:20001 of https://codereview.chromium.org/1718693002/ )
Reason for revert: breaking builds Original issue's description: > Add vulkan files into skia repo. This is an incomplete backend with only partial functionality at this time. > > R=robertphillips@google.com > TBR=bsalomon@google.com > > BUG=skia:4955 > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1718693002 > > Committed: https://skia.googlesource.com/skia/+/48cf268defad66f58f1aa03b4835e5583be96b2f TBR=robertphillips@google.com,bsalomon@google.com,jvanverth@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4955 Review URL: https://codereview.chromium.org/1723503002
Diffstat (limited to 'src/gpu/vk/GrVkDescriptorPool.cpp')
-rw-r--r--src/gpu/vk/GrVkDescriptorPool.cpp79
1 files changed, 0 insertions, 79 deletions
diff --git a/src/gpu/vk/GrVkDescriptorPool.cpp b/src/gpu/vk/GrVkDescriptorPool.cpp
deleted file mode 100644
index d4dced6c32..0000000000
--- a/src/gpu/vk/GrVkDescriptorPool.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
-* Copyright 2016 Google Inc.
-*
-* Use of this source code is governed by a BSD-style license that can be
-* found in the LICENSE file.
-*/
-
-#include "GrVkDescriptorPool.h"
-
-#include "GrVkGpu.h"
-#include "SkTemplates.h"
-
-
-GrVkDescriptorPool::GrVkDescriptorPool(const GrVkGpu* gpu, const DescriptorTypeCounts& typeCounts)
- : INHERITED()
- , fTypeCounts(typeCounts) {
- uint32_t numPools = fTypeCounts.numPoolSizes();
- SkAutoTDeleteArray<VkDescriptorPoolSize> poolSizes(new VkDescriptorPoolSize[numPools]);
- int currentPool = 0;
- for (int i = VK_DESCRIPTOR_TYPE_BEGIN_RANGE; i < VK_DESCRIPTOR_TYPE_END_RANGE; ++i) {
- if (fTypeCounts.fDescriptorTypeCount[i]) {
- VkDescriptorPoolSize& poolSize = poolSizes.get()[currentPool++];
- poolSize.type = (VkDescriptorType)i;
- poolSize.descriptorCount = fTypeCounts.fDescriptorTypeCount[i];
- }
- }
- SkASSERT(currentPool == numPools);
-
- VkDescriptorPoolCreateInfo createInfo;
- memset(&createInfo, 0, sizeof(VkDescriptorPoolCreateInfo));
- createInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
- createInfo.pNext = nullptr;
- createInfo.flags = 0;
- createInfo.maxSets = 2; // Currently we allow one set for samplers and one set for uniforms
- createInfo.poolSizeCount = numPools;
- createInfo.pPoolSizes = poolSizes.get();
-
- GR_VK_CALL_ERRCHECK(gpu->vkInterface(), CreateDescriptorPool(gpu->device(),
- &createInfo,
- nullptr,
- &fDescPool));
-}
-
-bool GrVkDescriptorPool::isCompatible(const DescriptorTypeCounts& typeCounts) const {
- return fTypeCounts.isSuperSet(typeCounts);
-}
-
-void GrVkDescriptorPool::reset(const GrVkGpu* gpu) {
- GR_VK_CALL_ERRCHECK(gpu->vkInterface(), ResetDescriptorPool(gpu->device(), fDescPool, 0));
-}
-
-void GrVkDescriptorPool::freeGPUData(const GrVkGpu* gpu) const {
- // Destroying the VkDescriptorPool will automatically free and delete any VkDescriptorSets
- // allocated from the pool.
- GR_VK_CALL(gpu->vkInterface(), DestroyDescriptorPool(gpu->device(), fDescPool, nullptr));
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-uint32_t GrVkDescriptorPool::DescriptorTypeCounts::numPoolSizes() const {
- uint32_t count = 0;
- for (int i = VK_DESCRIPTOR_TYPE_BEGIN_RANGE; i < VK_DESCRIPTOR_TYPE_END_RANGE; ++i) {
- count += fDescriptorTypeCount[i] ? 1 : 0;
- }
- return count;
-}
-
-bool GrVkDescriptorPool::DescriptorTypeCounts::isSuperSet(const DescriptorTypeCounts& that) const {
- for (int i = VK_DESCRIPTOR_TYPE_BEGIN_RANGE; i < VK_DESCRIPTOR_TYPE_END_RANGE; ++i) {
- if (that.fDescriptorTypeCount[i] > fDescriptorTypeCount[i]) {
- return false;
- }
- }
- return true;
-}
-
-void GrVkDescriptorPool::DescriptorTypeCounts::setTypeCount(VkDescriptorType type, uint8_t count) {
- fDescriptorTypeCount[type] = count;
-}