Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
GrVkPrimaryCommandBuffer * getPrimaryCommandBuffer()
void recycleSecondaryCommandBuffer(GrVkSecondaryCommandBuffer *buffer)
bool isOpen() const
static GrVkCommandPool * Create(GrVkGpu *gpu)
VkCommandPool vkCommandPool() const
void reset(GrVkGpu *gpu)
std::unique_ptr< GrVkSecondaryCommandBuffer > findOrCreateSecondaryCommandBuffer(GrVkGpu *gpu)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126