Renderer: Refactor transient resources (allow access at any time)
This commit is contained in:
committed by
Jérôme Leclercq
parent
de68033a0e
commit
4db5b59ec9
@@ -21,22 +21,6 @@ namespace Nz
|
||||
{
|
||||
VulkanDevice::~VulkanDevice() = default;
|
||||
|
||||
void VulkanDevice::Execute(const FunctionRef<void(CommandBufferBuilder& builder)>& callback, QueueType queueType)
|
||||
{
|
||||
Vk::AutoCommandBuffer commandBuffer = AllocateCommandBuffer(queueType);
|
||||
if (!commandBuffer->Begin(VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT))
|
||||
throw std::runtime_error("failed to begin command buffer: " + TranslateVulkanError(commandBuffer->GetLastErrorCode()));
|
||||
|
||||
VulkanCommandBufferBuilder builder(commandBuffer);
|
||||
callback(builder);
|
||||
|
||||
if (!commandBuffer->End())
|
||||
throw std::runtime_error("failed to build command buffer: " + TranslateVulkanError(commandBuffer->GetLastErrorCode()));
|
||||
|
||||
GetQueue(GetDefaultFamilyIndex(queueType), 0).Submit(commandBuffer);
|
||||
GetQueue(GetDefaultFamilyIndex(queueType), 0).WaitIdle();
|
||||
}
|
||||
|
||||
const RenderDeviceInfo& VulkanDevice::GetDeviceInfo() const
|
||||
{
|
||||
return m_renderDeviceInfo;
|
||||
|
||||
@@ -332,6 +332,11 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
|
||||
TransientResources& VulkanSwapchain::Transient()
|
||||
{
|
||||
return *m_concurrentImageData[m_currentFrame];
|
||||
}
|
||||
|
||||
bool VulkanSwapchain::SetupDepthBuffer()
|
||||
{
|
||||
VkImageCreateInfo imageCreateInfo = {
|
||||
|
||||
Reference in New Issue
Block a user