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