| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "GrVkDescriptorPool.h" | 8 #include "GrVkDescriptorPool.h" |
| 9 | 9 |
| 10 #include "GrVkGpu.h" | 10 #include "GrVkGpu.h" |
| 11 #include "SkTemplates.h" | 11 #include "SkTemplates.h" |
| 12 | 12 |
| 13 | 13 |
| 14 GrVkDescriptorPool::GrVkDescriptorPool(const GrVkGpu* gpu, VkDescriptorType type
, uint32_t count) | 14 GrVkDescriptorPool::GrVkDescriptorPool(const GrVkGpu* gpu, VkDescriptorType type
, uint32_t count) |
| 15 : INHERITED() | 15 : INHERITED() |
| 16 , fType (type) | 16 , fType (type) |
| 17 , fCount(count) { | 17 , fCount(count) { |
| 18 VkDescriptorPoolSize poolSize; | 18 VkDescriptorPoolSize poolSize; |
| 19 memset(&poolSize, 0, sizeof(VkDescriptorPoolSize)); | 19 memset(&poolSize, 0, sizeof(VkDescriptorPoolSize)); |
| 20 poolSize.descriptorCount = count; | 20 poolSize.descriptorCount = count; |
| 21 poolSize.type = type; | 21 poolSize.type = type; |
| 22 | 22 |
| 23 VkDescriptorPoolCreateInfo createInfo; | 23 VkDescriptorPoolCreateInfo createInfo; |
| 24 memset(&createInfo, 0, sizeof(VkDescriptorPoolCreateInfo)); | 24 memset(&createInfo, 0, sizeof(VkDescriptorPoolCreateInfo)); |
| 25 createInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; | 25 createInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; |
| 26 createInfo.pNext = nullptr; | 26 createInfo.pNext = nullptr; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 42 | 42 |
| 43 void GrVkDescriptorPool::reset(const GrVkGpu* gpu) { | 43 void GrVkDescriptorPool::reset(const GrVkGpu* gpu) { |
| 44 GR_VK_CALL_ERRCHECK(gpu->vkInterface(), ResetDescriptorPool(gpu->device(), f
DescPool, 0)); | 44 GR_VK_CALL_ERRCHECK(gpu->vkInterface(), ResetDescriptorPool(gpu->device(), f
DescPool, 0)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void GrVkDescriptorPool::freeGPUData(const GrVkGpu* gpu) const { | 47 void GrVkDescriptorPool::freeGPUData(const GrVkGpu* gpu) const { |
| 48 // Destroying the VkDescriptorPool will automatically free and delete any Vk
DescriptorSets | 48 // Destroying the VkDescriptorPool will automatically free and delete any Vk
DescriptorSets |
| 49 // allocated from the pool. | 49 // allocated from the pool. |
| 50 GR_VK_CALL(gpu->vkInterface(), DestroyDescriptorPool(gpu->device(), fDescPoo
l, nullptr)); | 50 GR_VK_CALL(gpu->vkInterface(), DestroyDescriptorPool(gpu->device(), fDescPoo
l, nullptr)); |
| 51 } | 51 } |
| OLD | NEW |