mirror of
https://github.com/simple64/simple64.git
synced 2026-11-13 13:48:42 +01:00
update parallel rdp
This commit is contained in:
1 parent
6705d5e44e
commit
19445a0df4
62 files changed
+110819
-53611
No files matched your search
@@ -110,8 +110,6 @@ RenderPass::RenderPass(Hash hash, Device *device_, const VkRenderPassCreateInfo
|
||||
auto info = create_info;
|
||||
VkAttachmentDescription fixup_attachments[VULKAN_NUM_ATTACHMENTS + 1];
|
||||
fixup_render_pass_workaround(info, fixup_attachments);
|
||||
if (device->get_workarounds().wsi_acquire_barrier_is_expensive)
|
||||
fixup_wsi_barrier(info, fixup_attachments);
|
||||
|
||||
#ifdef VULKAN_DEBUG
|
||||
LOGI("Creating render pass.\n");
|
||||
@@ -812,8 +810,6 @@ RenderPass::RenderPass(Hash hash, Device *device_, const RenderPassInfo &info)
|
||||
// Fixup after, we want the Fossilize render pass to be generic.
|
||||
VkAttachmentDescription fixup_attachments[VULKAN_NUM_ATTACHMENTS + 1];
|
||||
fixup_render_pass_workaround(rp_info, fixup_attachments);
|
||||
if (device->get_workarounds().wsi_acquire_barrier_is_expensive)
|
||||
fixup_wsi_barrier(rp_info, fixup_attachments);
|
||||
|
||||
#ifdef VULKAN_DEBUG
|
||||
LOGI("Creating render pass.\n");
|
||||
@@ -827,24 +823,6 @@ RenderPass::RenderPass(Hash hash, Device *device_, const RenderPassInfo &info)
|
||||
#endif
|
||||
}
|
||||
|
||||
void RenderPass::fixup_wsi_barrier(VkRenderPassCreateInfo &create_info, VkAttachmentDescription *attachments)
|
||||
{
|
||||
// We have transitioned ahead of time in this case,
|
||||
// so make initialLayout COLOR_ATTACHMENT_OPTIMAL for any WSI-attachments.
|
||||
if (attachments != create_info.pAttachments)
|
||||
{
|
||||
memcpy(attachments, create_info.pAttachments, create_info.attachmentCount * sizeof(attachments[0]));
|
||||
create_info.pAttachments = attachments;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < create_info.attachmentCount; i++)
|
||||
{
|
||||
auto &att = attachments[i];
|
||||
if (att.initialLayout == VK_IMAGE_LAYOUT_UNDEFINED && att.finalLayout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR)
|
||||
att.initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
||||
}
|
||||
}
|
||||
|
||||
void RenderPass::fixup_render_pass_workaround(VkRenderPassCreateInfo &create_info, VkAttachmentDescription *attachments)
|
||||
{
|
||||
if (device->get_workarounds().force_store_in_render_pass)
|
||||
@@ -1024,18 +1002,18 @@ Framebuffer &FramebufferAllocator::request_framebuffer(const RenderPassInfo &inf
|
||||
return *framebuffers.emplace(hash, device, rp, info);
|
||||
}
|
||||
|
||||
void AttachmentAllocator::clear()
|
||||
void TransientAttachmentAllocator::clear()
|
||||
{
|
||||
attachments.clear();
|
||||
}
|
||||
|
||||
void AttachmentAllocator::begin_frame()
|
||||
void TransientAttachmentAllocator::begin_frame()
|
||||
{
|
||||
attachments.begin_frame();
|
||||
}
|
||||
|
||||
ImageView &AttachmentAllocator::request_attachment(unsigned width, unsigned height, VkFormat format,
|
||||
unsigned index, unsigned samples, unsigned layers)
|
||||
ImageHandle TransientAttachmentAllocator::request_attachment(unsigned width, unsigned height, VkFormat format,
|
||||
unsigned index, unsigned samples, unsigned layers)
|
||||
{
|
||||
Hasher h;
|
||||
h.u32(width);
|
||||
@@ -1050,19 +1028,9 @@ ImageView &AttachmentAllocator::request_attachment(unsigned width, unsigned heig
|
||||
LOCK();
|
||||
auto *node = attachments.request(hash);
|
||||
if (node)
|
||||
return node->handle->get_view();
|
||||
return node->handle;
|
||||
|
||||
ImageCreateInfo image_info;
|
||||
if (transient)
|
||||
{
|
||||
image_info = ImageCreateInfo::transient_render_target(width, height, format);
|
||||
}
|
||||
else
|
||||
{
|
||||
image_info = ImageCreateInfo::render_target(width, height, format);
|
||||
image_info.initial_layout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
image_info.usage |= VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
|
||||
}
|
||||
auto image_info = ImageCreateInfo::transient_render_target(width, height, format);
|
||||
|
||||
image_info.samples = static_cast<VkSampleCountFlagBits>(samples);
|
||||
image_info.layers = layers;
|
||||
@@ -1070,6 +1038,6 @@ ImageView &AttachmentAllocator::request_attachment(unsigned width, unsigned heig
|
||||
node->handle->set_internal_sync_object();
|
||||
node->handle->get_view().set_internal_sync_object();
|
||||
device->set_name(*node->handle, "AttachmentAllocator");
|
||||
return node->handle->get_view();
|
||||
return node->handle;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user