blob: 24f128f71d94f725fea7fa9f7fb68d67926a71b0 [file] [log] [blame]
Greg Danielc2dd5ed2017-05-05 13:49:11 -04001/*
2 * Copyright 2017 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#ifndef GrVkBufferView_DEFINED
9#define GrVkBufferView_DEFINED
10
Greg Daniel54bfb182018-11-20 17:12:36 -050011#include "GrVkVulkan.h"
12
Greg Danielc2dd5ed2017-05-05 13:49:11 -040013#include "GrTypes.h"
Greg Danielc2dd5ed2017-05-05 13:49:11 -040014#include "GrVkResource.h"
15
Greg Danielc2dd5ed2017-05-05 13:49:11 -040016class GrVkBufferView : public GrVkResource {
17public:
18 static const GrVkBufferView* Create(const GrVkGpu* gpu, VkBuffer buffer, VkFormat format,
19 VkDeviceSize offset, VkDeviceSize range);
20
21 VkBufferView bufferView() const { return fBufferView; }
22
23#ifdef SK_TRACE_VK_RESOURCES
24 void dumpInfo() const override {
25 SkDebugf("GrVkBufferView: %d (%d refs)\n", fBufferView, this->getRefCnt());
26 }
27#endif
28
29private:
30 GrVkBufferView(VkBufferView bufferView) : INHERITED(), fBufferView(bufferView) {}
31
Greg Danielc2dd5ed2017-05-05 13:49:11 -040032 void freeGPUData(const GrVkGpu* gpu) const override;
33
34 VkBufferView fBufferView;
35
36 typedef GrVkResource INHERITED;
37};
38
39#endif