mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
vk: Update support for framebuffer loops to comply with current spec
This commit is contained in:
parent
5281a85b67
commit
102d30db2d
@ -153,9 +153,9 @@ namespace vk
|
|||||||
|
|
||||||
for (u32 i = 0, layout_offset = 0; i < 5; ++i, layout_offset += 3)
|
for (u32 i = 0, layout_offset = 0; i < 5; ++i, layout_offset += 3)
|
||||||
{
|
{
|
||||||
if (const auto layout = VkImageLayout((layout_blob >> layout_offset) & 0x7))
|
if (const auto layout_encoding = (layout_blob >> layout_offset) & 0x7)
|
||||||
{
|
{
|
||||||
result.push_back(layout);
|
result.push_back(decode_layout(layout_encoding));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -103,6 +103,12 @@ namespace vk
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we have driver support for FBO loops, set the usage flag for it.
|
||||||
|
if (vk::get_current_renderer()->get_framebuffer_loops_support())
|
||||||
|
{
|
||||||
|
return { VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT, 0 };
|
||||||
|
}
|
||||||
|
|
||||||
// Workarounds to force transition to GENERAL to decompress.
|
// Workarounds to force transition to GENERAL to decompress.
|
||||||
// Fixes corruption in FBO loops for ANV and RADV.
|
// Fixes corruption in FBO loops for ANV and RADV.
|
||||||
switch (vk::get_driver_vendor())
|
switch (vk::get_driver_vendor())
|
||||||
@ -117,8 +123,7 @@ namespace vk
|
|||||||
break;
|
break;
|
||||||
case driver_vendor::AMD:
|
case driver_vendor::AMD:
|
||||||
case driver_vendor::RADV:
|
case driver_vendor::RADV:
|
||||||
if ((vk::get_chip_family() >= chip_class::AMD_navi1x) &&
|
if (vk::get_chip_family() >= chip_class::AMD_navi1x)
|
||||||
!vk::get_current_renderer()->get_framebuffer_loops_support())
|
|
||||||
{
|
{
|
||||||
// Only needed for GFX10+
|
// Only needed for GFX10+
|
||||||
return { 0, VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT };
|
return { 0, VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT };
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#define VK_EXT_attachment_feedback_loop_layout 1
|
#define VK_EXT_attachment_feedback_loop_layout 1
|
||||||
#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME "VK_EXT_attachment_feedback_loop_layout"
|
#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME "VK_EXT_attachment_feedback_loop_layout"
|
||||||
#define VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT static_cast<VkImageLayout>(1000339000)
|
#define VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT static_cast<VkImageLayout>(1000339000)
|
||||||
|
#define VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT 0x00080000
|
||||||
#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT static_cast<VkStructureType>(1000339000)
|
#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT static_cast<VkStructureType>(1000339000)
|
||||||
|
|
||||||
typedef struct VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT {
|
typedef struct VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT {
|
||||||
|
@ -451,6 +451,11 @@ namespace vk
|
|||||||
requested_extensions.push_back(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME);
|
requested_extensions.push_back(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pgpu->framebuffer_loops_support)
|
||||||
|
{
|
||||||
|
requested_extensions.push_back(VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
enabled_features.robustBufferAccess = VK_TRUE;
|
enabled_features.robustBufferAccess = VK_TRUE;
|
||||||
enabled_features.fullDrawIndexUint32 = VK_TRUE;
|
enabled_features.fullDrawIndexUint32 = VK_TRUE;
|
||||||
enabled_features.independentBlend = VK_TRUE;
|
enabled_features.independentBlend = VK_TRUE;
|
||||||
@ -616,6 +621,15 @@ namespace vk
|
|||||||
device.pNext = &indexing_features;
|
device.pNext = &indexing_features;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT fbo_loop_features{};
|
||||||
|
if (pgpu->framebuffer_loops_support)
|
||||||
|
{
|
||||||
|
fbo_loop_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT;
|
||||||
|
fbo_loop_features.attachmentFeedbackLoopLayout = VK_TRUE;
|
||||||
|
fbo_loop_features.pNext = const_cast<void*>(device.pNext);
|
||||||
|
device.pNext = &fbo_loop_features;
|
||||||
|
}
|
||||||
|
|
||||||
CHECK_RESULT_EX(vkCreateDevice(*pgpu, &device, nullptr, &dev), message_on_error);
|
CHECK_RESULT_EX(vkCreateDevice(*pgpu, &device, nullptr, &dev), message_on_error);
|
||||||
|
|
||||||
// Initialize queues
|
// Initialize queues
|
||||||
|
Loading…
x
Reference in New Issue
Block a user