Skip to content

Commit c4823a8

Browse files
committed
GPU Vulkan Display: Use in-memory pipeline cache
1 parent ea60209 commit c4823a8

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎GPU/GPUTracking/display/backend/GPUDisplayBackendVulkan.cxx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,11 +575,13 @@ void GPUDisplayBackendVulkan::createDevice()
575575
poolInfo.flags = vk::CommandPoolCreateFlagBits::eResetCommandBuffer;
576576
poolInfo.queueFamilyIndex = mGraphicsFamily;
577577
mCommandPool = mDevice.createCommandPool(poolInfo, nullptr);
578+
mPipelineCache = mDevice.createPipelineCache(vk::PipelineCacheCreateInfo{}, nullptr);
578579
}
579580

580581
void GPUDisplayBackendVulkan::clearDevice()
581582
{
582583
mDevice.destroyCommandPool(mCommandPool, nullptr);
584+
mDevice.destroyPipelineCache(mPipelineCache, nullptr);
583585
mDevice.destroy(nullptr);
584586
mInstance.destroySurfaceKHR(mSurface, nullptr);
585587
if (mEnableValidationLayers) {
@@ -1078,7 +1080,7 @@ void GPUDisplayBackendVulkan::createPipeline()
10781080
multisampling.rasterizationSamples = mMSAASampleCount;
10791081
}
10801082

1081-
CHKERR(mDevice.createGraphicsPipelines(VkPipelineCache(VK_NULL_HANDLE), 1, &pipelineInfo, nullptr, &mPipelines[i])); // TODO: multiple at once + cache?
1083+
CHKERR(mDevice.createGraphicsPipelines(mPipelineCache, 1, &pipelineInfo, nullptr, &mPipelines[i]));
10821084
}
10831085
}
10841086

‎GPU/GPUTracking/display/backend/GPUDisplayBackendVulkan.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ class GPUDisplayBackendVulkan : public GPUDisplayBackend
163163
vk::PipelineLayout mPipelineLayoutTexture;
164164
std::vector<vk::Pipeline> mPipelines;
165165
vk::CommandPool mCommandPool;
166+
vk::PipelineCache mPipelineCache;
166167

167168
bool mCommandInfrastructureCreated = false;
168169
uint32_t mImageCount = 0;
@@ -211,7 +212,7 @@ class GPUDisplayBackendVulkan : public GPUDisplayBackend
211212
bool mZActive = false;
212213
bool mSmoothLinesSupported = false; // Optional Vulkan 1.4 feature smoothLines, enabled if available
213214
bool mSmoothLines = false;
214-
bool mStrictLines = false; // Wide lines are rectangles, not parallelograms
215+
bool mStrictLines = false;
215216
bool mZSupported = false;
216217
bool mStencilSupported = false;
217218
bool mDownsampleFSAA = false;

0 commit comments

Comments
 (0)