Home | History | Annotate | Download | only in vk
      1 /*
      2 * Copyright 2016 Google Inc.
      3 *
      4 * Use of this source code is governed by a BSD-style license that can be
      5 * found in the LICENSE file.
      6 */
      7 
      8 #include "GrVkDescriptorSet.h"
      9 
     10 #include "GrVkDescriptorPool.h"
     11 #include "GrVkGpu.h"
     12 #include "GrVkResourceProvider.h"
     13 
     14 GrVkDescriptorSet::GrVkDescriptorSet(VkDescriptorSet descSet,
     15                                      GrVkDescriptorPool* pool,
     16                                      GrVkDescriptorSetManager::Handle handle)
     17     : fDescSet(descSet)
     18     , fPool(pool)
     19     , fHandle(handle) {
     20     fPool->ref();
     21 }
     22 
     23 void GrVkDescriptorSet::freeGPUData(const GrVkGpu* gpu) const {
     24     fPool->unref(gpu);
     25 }
     26 
     27 void GrVkDescriptorSet::onRecycle(GrVkGpu* gpu) const {
     28     gpu->resourceProvider().recycleDescriptorSet(this, fHandle);
     29 }
     30 
     31 void GrVkDescriptorSet::abandonGPUData() const {
     32     fPool->unrefAndAbandon();
     33 }
     34 
     35