mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-10-12 02:09:17 +00:00
vk: Support multiple attachments on renderpass key generation
This commit is contained in:
@@ -209,7 +209,7 @@ namespace vk
|
||||
return key.encoded;
|
||||
}
|
||||
|
||||
u64 get_renderpass_key(VkFormat surface_format, u8 sample_count)
|
||||
u64 get_renderpass_key(VkFormat surface_format, u8 color_attachment_count, u8 sample_count)
|
||||
{
|
||||
renderpass_key_blob key(0);
|
||||
key.sample_count = sample_count;
|
||||
@@ -225,14 +225,17 @@ namespace vk
|
||||
break;
|
||||
default:
|
||||
key.color_format = static_cast<u64>(surface_format);
|
||||
key.layout_blob = static_cast<u64>(VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
||||
for (u8 i = 0; i < color_attachment_count; ++i)
|
||||
{
|
||||
key.set_layout(i, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return key.encoded;
|
||||
}
|
||||
|
||||
u64 get_renderpass_key(VkFormat color_format, VkFormat depth_format, u8 sample_count)
|
||||
u64 get_renderpass_key(VkFormat color_format, VkFormat depth_format, u8 color_attachment_count, u8 sample_count)
|
||||
{
|
||||
renderpass_key_blob key(0);
|
||||
key.sample_count = sample_count;
|
||||
@@ -241,7 +244,10 @@ namespace vk
|
||||
if (color_format != VK_FORMAT_UNDEFINED)
|
||||
{
|
||||
key.set_format(color_format);
|
||||
key.set_layout(image_index++, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
||||
for (u8 i = 0; i < color_attachment_count; ++i)
|
||||
{
|
||||
key.set_layout(image_index++, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
|
||||
}
|
||||
}
|
||||
|
||||
if (depth_format != VK_FORMAT_UNDEFINED)
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace vk
|
||||
|
||||
u64 get_renderpass_key(const std::vector<vk::image*>& images, const std::vector<u8>& input_attachment_ids = {});
|
||||
u64 get_renderpass_key(const std::vector<vk::image*>& images, u64 previous_key, const std::vector<u8>& input_attachment_ids = {});
|
||||
u64 get_renderpass_key(VkFormat surface_format, u8 sample_count = 1);
|
||||
u64 get_renderpass_key(VkFormat color_format, VkFormat depth_format, u8 sample_count = 1);
|
||||
u64 get_renderpass_key(VkFormat surface_format, u8 color_attachment_count = 1, u8 sample_count = 1);
|
||||
u64 get_renderpass_key(VkFormat color_format, VkFormat depth_format, u8 color_attachment_count = 1, u8 sample_count = 1);
|
||||
VkRenderPass get_renderpass(VkDevice dev, u64 renderpass_key);
|
||||
|
||||
bool renderpass_has_input_attachments(u64 renderpass_key);
|
||||
|
||||
Reference in New Issue
Block a user