}
else
{
- VkDeferredOperationKHR deferredOperation = DE_NULL;
-
- VK_CHECK(vk.createDeferredOperationKHR(device, DE_NULL, &deferredOperation));
+ const auto deferredOperationPtr = createDeferredOperationKHR(vk, device);
+ const auto deferredOperation = deferredOperationPtr.get();
VkResult result = vk.buildAccelerationStructuresKHR(device, deferredOperation, 1u, &accelerationStructureBuildGeometryInfoKHR, (const VkAccelerationStructureBuildRangeInfoKHR**)&accelerationStructureBuildRangeInfoKHRPtr);
}
else
{
- VkDeferredOperationKHR deferredOperation = DE_NULL;
-
- VK_CHECK(vk.createDeferredOperationKHR(device, DE_NULL, &deferredOperation));
+ const auto deferredOperationPtr = createDeferredOperationKHR(vk, device);
+ const auto deferredOperation = deferredOperationPtr.get();
VkResult result = vk.copyAccelerationStructureKHR(device, deferredOperation, ©AccelerationStructureInfo);
}
else
{
- VkDeferredOperationKHR deferredOperation = DE_NULL;
-
- VK_CHECK(vk.createDeferredOperationKHR(device, DE_NULL, &deferredOperation));
+ const auto deferredOperationPtr = createDeferredOperationKHR(vk, device);
+ const auto deferredOperation = deferredOperationPtr.get();
const VkResult result = vk.copyAccelerationStructureToMemoryKHR(device, deferredOperation, ©AccelerationStructureInfo);
}
else
{
- VkDeferredOperationKHR deferredOperation = DE_NULL;
-
- VK_CHECK(vk.createDeferredOperationKHR(device, DE_NULL, &deferredOperation));
+ const auto deferredOperationPtr = createDeferredOperationKHR(vk, device);
+ const auto deferredOperation = deferredOperationPtr.get();
const VkResult result = vk.copyMemoryToAccelerationStructureKHR(device, deferredOperation, ©AccelerationStructureInfo);
}
else
{
- VkDeferredOperationKHR deferredOperation = DE_NULL;
-
- VK_CHECK(vk.createDeferredOperationKHR(device, DE_NULL, &deferredOperation));
+ const auto deferredOperationPtr = createDeferredOperationKHR(vk, device);
+ const auto deferredOperation = deferredOperationPtr.get();
VkResult result = vk.buildAccelerationStructuresKHR(device, deferredOperation, 1u, &accelerationStructureBuildGeometryInfoKHR, (const VkAccelerationStructureBuildRangeInfoKHR**)&accelerationStructureBuildRangeInfoKHRPtr);
}
else
{
- VkDeferredOperationKHR deferredOperation = DE_NULL;
-
- VK_CHECK(vk.createDeferredOperationKHR(device, DE_NULL, &deferredOperation));
+ const auto deferredOperationPtr = createDeferredOperationKHR(vk, device);
+ const auto deferredOperation = deferredOperationPtr.get();
VkResult result = vk.copyAccelerationStructureKHR(device, deferredOperation, ©AccelerationStructureInfo);
}
else
{
- VkDeferredOperationKHR deferredOperation = DE_NULL;
-
- VK_CHECK(vk.createDeferredOperationKHR(device, DE_NULL, &deferredOperation));
+ const auto deferredOperationPtr = createDeferredOperationKHR(vk, device);
+ const auto deferredOperation = deferredOperationPtr.get();
const VkResult result = vk.copyAccelerationStructureToMemoryKHR(device, deferredOperation, ©AccelerationStructureInfo);
}
else
{
- VkDeferredOperationKHR deferredOperation = DE_NULL;
-
- VK_CHECK(vk.createDeferredOperationKHR(device, DE_NULL, &deferredOperation));
+ const auto deferredOperationPtr = createDeferredOperationKHR(vk, device);
+ const auto deferredOperation = deferredOperationPtr.get();
const VkResult result = vk.copyMemoryToAccelerationStructureKHR(device, deferredOperation, ©AccelerationStructureInfo);
const VkRayTracingPipelineInterfaceCreateInfoKHR* pipelineInterfaceCreateInfoPtr = addPipelineInterfaceCreateInfo ? &pipelineInterfaceCreateInfo : DE_NULL;
const VkPipelineLibraryCreateInfoKHR* librariesCreateInfoPtr = (vkPipelineLibraries.empty() ? nullptr : &librariesCreateInfo);
- VkDeferredOperationKHR deferredOperation = DE_NULL;
- if(m_deferredOperation)
- VK_CHECK(vk.createDeferredOperationKHR(device, DE_NULL, &deferredOperation));
+ Move<VkDeferredOperationKHR> deferredOperation;
+ if (m_deferredOperation)
+ deferredOperation = createDeferredOperationKHR(vk, device);
VkPipelineDynamicStateCreateInfo dynamicStateCreateInfo =
{
0, // deInt32 basePipelineIndex;
};
VkPipeline object = DE_NULL;
- VkResult result = vk.createRayTracingPipelinesKHR(device, deferredOperation, DE_NULL, 1u, &pipelineCreateInfo, DE_NULL, &object);
+ VkResult result = vk.createRayTracingPipelinesKHR(device, deferredOperation.get(), DE_NULL, 1u, &pipelineCreateInfo, DE_NULL, &object);
Move<VkPipeline> pipeline (check<VkPipeline>(object), Deleter<VkPipeline>(vk, device, DE_NULL));
if (m_deferredOperation)
DE_ASSERT(result == VK_OPERATION_DEFERRED_KHR || result == VK_OPERATION_NOT_DEFERRED_KHR || result == VK_SUCCESS);
DE_UNREF(result);
- finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount);
+ finishDeferredOperation(vk, device, deferredOperation.get(), m_workerThreadCount);
}
return pipeline;