Skip to content

Commit

Permalink
vk: Improve spec compliance (#9748)
Browse files Browse the repository at this point in the history
- Always comply when running under strict mode
- Only allow hacky transport for known-to-work GPUs
  • Loading branch information
kd-11 committed Feb 8, 2021
1 parent 78811b8 commit 2d62f9c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rpcs3/Emu/RSX/VK/VKTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,14 +574,17 @@ namespace vk
const u32 typeless_w = std::max(dst_rect.width(), src_rect.width());
const u32 typeless_h = src_rect.height() + dst_rect.height();

const auto gpu_family = vk::get_chip_family();
const bool use_unsafe_transport = !g_cfg.video.strict_rendering_mode && (gpu_family != chip_class::NV_generic && gpu_family < chip_class::NV_turing);

switch (src->format())
{
case VK_FORMAT_D16_UNORM:
{
auto typeless = vk::get_typeless_helper(VK_FORMAT_R16_UNORM, RSX_FORMAT_CLASS_COLOR, typeless_w, typeless_h);
change_image_layout(cmd, typeless, VK_IMAGE_LAYOUT_GENERAL);

if (vk::get_chip_family() < vk::chip_class::NV_ampere)
if (use_unsafe_transport)
{
stretch_image_typeless_unsafe(src, dst, typeless, src_rect, dst_rect, VK_IMAGE_ASPECT_DEPTH_BIT);
}
Expand All @@ -602,8 +605,7 @@ namespace vk
case VK_FORMAT_D24_UNORM_S8_UINT:
{
const VkImageAspectFlags depth_stencil = VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
if (const auto chip_family = vk::get_chip_family();
chip_family > vk::chip_class::NV_generic && chip_family < vk::chip_class::NV_turing)
if (use_unsafe_transport)
{
auto typeless = vk::get_typeless_helper(VK_FORMAT_B8G8R8A8_UNORM, RSX_FORMAT_CLASS_COLOR, typeless_w, typeless_h);
change_image_layout(cmd, typeless, VK_IMAGE_LAYOUT_GENERAL);
Expand Down

0 comments on commit 2d62f9c

Please sign in to comment.