aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/vk/GrVkBufferView.h
blob: 5f0192529897e94900e84a447c082a7fdb21095b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * Copyright 2017 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrVkBufferView_DEFINED
#define GrVkBufferView_DEFINED

#include "GrTypes.h"

#include "GrVkResource.h"

#include "vk/GrVkDefines.h"

class GrVkBufferView : public GrVkResource {
public:
    static const GrVkBufferView* Create(const GrVkGpu* gpu, VkBuffer buffer, VkFormat format,
                                        VkDeviceSize offset, VkDeviceSize range);

    VkBufferView bufferView() const { return fBufferView; }

#ifdef SK_TRACE_VK_RESOURCES
    void dumpInfo() const override {
        SkDebugf("GrVkBufferView: %d (%d refs)\n", fBufferView, this->getRefCnt());
    }
#endif

private:
    GrVkBufferView(VkBufferView bufferView) : INHERITED(), fBufferView(bufferView) {}

    void freeGPUData(const GrVkGpu* gpu) const override;

    VkBufferView  fBufferView;

    typedef GrVkResource INHERITED;
};

#endif