35 if (!primaryCmdBuffer) {
43GrVkCommandPool::GrVkCommandPool(
GrVkGpu* gpu, VkCommandPool commandPool,
46 , fCommandPool(commandPool)
47 , fPrimaryCommandBuffer(primaryCmdBuffer)
48 , fMaxCachedSecondaryCommandBuffers(
49 gpu->vkCaps().maxPerPoolCachedSecondaryCommandBuffers()) {
54 std::unique_ptr<GrVkSecondaryCommandBuffer>
result;
55 if (!fAvailableSecondaryBuffers.
empty()) {
56 result = std::move(fAvailableSecondaryBuffers.
back());
57 fAvailableSecondaryBuffers.
pop_back();
65 std::unique_ptr<GrVkSecondaryCommandBuffer> scb(
buffer);
66 if (fAvailableSecondaryBuffers.
size() < fMaxCachedSecondaryCommandBuffers) {
67 fAvailableSecondaryBuffers.
push_back(std::move(scb));
69 VkCommandBuffer vkBuffer =
buffer->vkCommandBuffer();
71 FreeCommandBuffers(
fGpu->
device(), fCommandPool, 1, &vkBuffer));
86 ResetCommandPool(gpu->
device(), fCommandPool, 0));
96 this->releaseResources();
101void GrVkCommandPool::releaseResources() {
104 fPrimaryCommandBuffer->releaseResources();
105 fPrimaryCommandBuffer->recycleSecondaryCommandBuffers(
this);
108void GrVkCommandPool::freeGPUData()
const {
113 nonConstThis->
close();
114 nonConstThis->releaseResources();
115 fPrimaryCommandBuffer->freeGPUData(
fGpu, fCommandPool);
116 for (
const auto&
buffer : fAvailableSecondaryBuffers) {
121 DestroyCommandPool(
fGpu->
device(), fCommandPool,
nullptr));
#define GR_VK_CALL(IFACE, X)
#define GR_VK_CALL_RESULT(GPU, RESULT, X)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
void recycleSecondaryCommandBuffer(GrVkSecondaryCommandBuffer *buffer)
static GrVkCommandPool * Create(GrVkGpu *gpu)
std::unique_ptr< GrVkSecondaryCommandBuffer > findOrCreateSecondaryCommandBuffer(GrVkGpu *gpu)
uint32_t queueIndex() const
const skgpu::VulkanInterface * vkInterface() const
bool protectedContext() const
static GrVkPrimaryCommandBuffer * Create(GrVkGpu *gpu, VkCommandPool cmdPool)
static GrVkSecondaryCommandBuffer * Create(GrVkGpu *gpu, GrVkCommandPool *cmdPool)
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
#define TRACE_EVENT0(category_group, name)
VkFlags VkCommandPoolCreateFlags
@ VK_COMMAND_POOL_CREATE_TRANSIENT_BIT
@ VK_COMMAND_POOL_CREATE_PROTECTED_BIT
@ VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO