@@ -2459,9 +2459,10 @@ Result Compiler::BuildGraphicsPipeline(const GraphicsPipelineBuildInfo *pipeline
24592459
24602460 if (!cacheAccessor || !cacheAccessor->isInCache ()) {
24612461 LLPC_OUTS (" Cache miss for graphics pipeline.\n " );
2462- GraphicsContext graphicsContext (m_gfxIp, m_apiName, pipelineInfo, &pipelineHash, &cacheHash);
2463- result = buildGraphicsPipelineInternal (& graphicsContext, shaderInfo, buildUsingRelocatableElf, &candidateElf,
2462+ GraphicsContext * graphicsContext = new GraphicsContext (m_gfxIp, m_apiName, pipelineInfo, &pipelineHash, &cacheHash);
2463+ result = buildGraphicsPipelineInternal (graphicsContext, shaderInfo, buildUsingRelocatableElf, &candidateElf,
24642464 pipelineOut->stageCacheAccesses );
2465+ delete graphicsContext;
24652466
24662467 if (result == Result::Success) {
24672468 elfBin.codeSize = candidateElf.size ();
@@ -2588,9 +2589,10 @@ Result Compiler::BuildComputePipeline(const ComputePipelineBuildInfo *pipelineIn
25882589 ElfPackage candidateElf;
25892590 if (!cacheAccessor || !cacheAccessor->isInCache ()) {
25902591 LLPC_OUTS (" Cache miss for compute pipeline.\n " );
2591- ComputeContext computeContext (m_gfxIp, m_apiName, pipelineInfo, &pipelineHash, &cacheHash);
2592- result = buildComputePipelineInternal (& computeContext, pipelineInfo, buildUsingRelocatableElf, &candidateElf,
2592+ ComputeContext * computeContext = new ComputeContext (m_gfxIp, m_apiName, pipelineInfo, &pipelineHash, &cacheHash);
2593+ result = buildComputePipelineInternal (computeContext, pipelineInfo, buildUsingRelocatableElf, &candidateElf,
25932594 &pipelineOut->stageCacheAccess );
2595+ delete computeContext;
25942596
25952597 if (cacheAccessor && pipelineOut->pipelineCacheAccess == CacheAccessInfo::CacheNotChecked)
25962598 pipelineOut->pipelineCacheAccess = CacheAccessInfo::CacheMiss;
0 commit comments