Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GrVkCommandPool.h
Go to the documentation of this file.
1/*
2 * Copyright 2018 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 GrVkCommandPool_DEFINED
9#define GrVkCommandPool_DEFINED
10
14
15#include <cinttypes>
16
19class GrVkGpu;
20
22public:
23 static GrVkCommandPool* Create(GrVkGpu* gpu);
24
25 VkCommandPool vkCommandPool() const {
26 return fCommandPool;
27 }
28
29 void reset(GrVkGpu* gpu);
30
31
32 GrVkPrimaryCommandBuffer* getPrimaryCommandBuffer() { return fPrimaryCommandBuffer.get(); }
33
34 std::unique_ptr<GrVkSecondaryCommandBuffer> findOrCreateSecondaryCommandBuffer(GrVkGpu* gpu);
35
37
38 // marks that we are finished with this command pool; it is not legal to continue creating or
39 // writing to command buffers in a closed pool
40 void close();
41
42 // returns true if close() has not been called
43 bool isOpen() const { return fOpen; }
44
45#ifdef SK_TRACE_MANAGED_RESOURCES
46 void dumpInfo() const override {
47 SkDebugf("GrVkCommandPool: %" PRIdPTR " (%d refs)\n",
48 (intptr_t)fCommandPool, this->getRefCnt());
49 }
50#endif
51
52private:
53 GrVkCommandPool() = delete;
54
55 GrVkCommandPool(GrVkGpu* gpu, VkCommandPool commandPool, GrVkPrimaryCommandBuffer*);
56
57 void releaseResources();
58
59 void freeGPUData() const override;
60
61 bool fOpen = true;
62
63 VkCommandPool fCommandPool;
64
65 std::unique_ptr<GrVkPrimaryCommandBuffer> fPrimaryCommandBuffer;
66
67 // Array of available secondary command buffers that are not in flight
69 std::unique_ptr<GrVkSecondaryCommandBuffer>, true> fAvailableSecondaryBuffers;
70 int fMaxCachedSecondaryCommandBuffers;
71};
72
73#endif
m reset()
static sk_sp< Effect > Create()
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
GrVkPrimaryCommandBuffer * getPrimaryCommandBuffer()
void recycleSecondaryCommandBuffer(GrVkSecondaryCommandBuffer *buffer)
bool isOpen() const
VkCommandPool vkCommandPool() const
void freeGPUData() const override
std::unique_ptr< GrVkSecondaryCommandBuffer > findOrCreateSecondaryCommandBuffer(GrVkGpu *gpu)
static const uint8_t buffer[]