Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vk] Check for BGRA8 linear image to support blitting #5092

Merged
merged 2 commits into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion rpcs3/Emu/RSX/VK/VKFormats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ namespace vk
&& !!(props.optimalTilingFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)
&& !!(props.optimalTilingFeatures & VK_FORMAT_FEATURE_BLIT_SRC_BIT);

//Hide d24_s8 if force high precision z buffer is enabled
// Hide d24_s8 if force high precision z buffer is enabled
if (g_cfg.video.force_high_precision_z_buffer && result.d32_sfloat_s8)
result.d24_unorm_s8 = false;

// Checks if BGRA8 images can be used for blitting
vkGetPhysicalDeviceFormatProperties(dev, VK_FORMAT_B8G8R8A8_UNORM, &props);
result.bgra8_linear = !!(props.linearTilingFeatures & VK_FORMAT_FEATURE_BLIT_SRC_BIT);

return result;
}

Expand Down
1 change: 1 addition & 0 deletions rpcs3/Emu/RSX/VK/VKHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ namespace vk
{
bool d24_unorm_s8;
bool d32_sfloat_s8;
bool bgra8_linear;
};

// Memory Allocator - base class
Expand Down
7 changes: 6 additions & 1 deletion rpcs3/Emu/RSX/VK/VKTextureCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,12 @@ namespace vk

vk::image *upload_image_simple(vk::command_buffer& cmd, u32 address, u32 width, u32 height)
{
//Uploads a linear memory range as a BGRA8 texture
if (!m_formats_support.bgra8_linear)
{
return nullptr;
}

// Uploads a linear memory range as a BGRA8 texture
auto image = std::make_unique<vk::image>(*m_device, m_memory_types.host_visible_coherent,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
VK_IMAGE_TYPE_2D,
Expand Down