Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2146)

Unified Diff: src/gpu/vk/GrVkGpu.cpp

Issue 2115993002: Add resource tracking output and command buffer recycling (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove from the end of the array Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/vk/GrVkGpu.cpp
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index ab6761cc32b5ccda141ca310bdd8215ed9065ed8..4ebe4998b3a15d999db7453a0793230fa6411ce9 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -119,17 +119,18 @@ GrVkGpu::GrVkGpu(GrContext* context, const GrContextOptions& options,
VK_CALL(GetPhysicalDeviceMemoryProperties(backendCtx->fPhysicalDevice, &fPhysDevMemProps));
const VkCommandPoolCreateInfo cmdPoolInfo = {
- VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // sType
- nullptr, // pNext
- VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, // CmdPoolCreateFlags
- backendCtx->fGraphicsQueueIndex, // queueFamilyIndex
+ VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, // sType
+ nullptr, // pNext
+ VK_COMMAND_POOL_CREATE_TRANSIENT_BIT |
+ VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, // CmdPoolCreateFlags
+ backendCtx->fGraphicsQueueIndex, // queueFamilyIndex
};
GR_VK_CALL_ERRCHECK(this->vkInterface(), CreateCommandPool(fDevice, &cmdPoolInfo, nullptr,
&fCmdPool));
// must call this after creating the CommandPool
fResourceProvider.init();
- fCurrentCmdBuffer = fResourceProvider.createPrimaryCommandBuffer();
+ fCurrentCmdBuffer = fResourceProvider.findOrCreatePrimaryCommandBuffer();
SkASSERT(fCurrentCmdBuffer);
fCurrentCmdBuffer->begin(this);
@@ -205,7 +206,7 @@ void GrVkGpu::submitCommandBuffer(SyncQueue sync) {
// Release old command buffer and create a new one
fCurrentCmdBuffer->unref(this);
- fCurrentCmdBuffer = fResourceProvider.createPrimaryCommandBuffer();
+ fCurrentCmdBuffer = fResourceProvider.findOrCreatePrimaryCommandBuffer();
SkASSERT(fCurrentCmdBuffer);
fCurrentCmdBuffer->begin(this);
@@ -1482,7 +1483,7 @@ bool GrVkGpu::onReadPixels(GrSurface* surface,
return true;
}
-void GrVkGpu::submitSecondaryCommandBuffer(const GrVkSecondaryCommandBuffer* buffer,
+void GrVkGpu::submitSecondaryCommandBuffer(GrVkSecondaryCommandBuffer* buffer,
const GrVkRenderPass* renderPass,
const VkClearValue* colorClear,
GrVkRenderTarget* target,

Powered by Google App Engine
This is Rietveld 408576698