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

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: Address comments Created 4 years, 5 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
« no previous file with comments | « src/gpu/vk/GrVkGpu.h ('k') | src/gpu/vk/GrVkGpuCommandBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkGpu.cpp
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index c1cec9d96fa7ea77fc4d829566b56dd34bd6e0c0..ff6ef0c387d3065451c4fe8538bd462aa2fac166 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -127,17 +127,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);
@@ -217,7 +218,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);
@@ -1494,7 +1495,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,
« no previous file with comments | « src/gpu/vk/GrVkGpu.h ('k') | src/gpu/vk/GrVkGpuCommandBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698