mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-04-08 10:31:33 -06:00
vk: Fix crash when running CPU detiler path
This commit is contained in:
parent
59468f1e1e
commit
e0c3df5328
@ -71,10 +71,11 @@ namespace vk
|
||||
|
||||
enum image_upload_options
|
||||
{
|
||||
upload_contents_async = 1,
|
||||
initialize_image_layout = 2,
|
||||
preserve_image_layout = 4,
|
||||
source_is_gpu_resident = 8,
|
||||
upload_contents_async = 0x0001,
|
||||
initialize_image_layout = 0x0002,
|
||||
preserve_image_layout = 0x0004,
|
||||
source_is_gpu_resident = 0x0008,
|
||||
source_is_userptr = 0x0010,
|
||||
|
||||
// meta-flags
|
||||
upload_contents_inline = 0,
|
||||
|
||||
@ -724,6 +724,7 @@ namespace vk
|
||||
subres.height_in_block
|
||||
);
|
||||
subres.data = std::span(ext_data);
|
||||
upload_flags |= source_is_userptr;
|
||||
#else
|
||||
const auto [scratch_buf, linear_data_scratch_offset] = vk::detile_memory_block(cmd, tiled_region, range, subres.width_in_block, subres.height_in_block, get_bpp());
|
||||
|
||||
|
||||
@ -990,7 +990,7 @@ namespace vk
|
||||
auto pdev = vk::get_current_renderer();
|
||||
rsx::texture_uploader_capabilities caps{ .supports_dxt = pdev->get_texture_compression_bc_support(), .alignment = heap_align };
|
||||
rsx::texture_memory_info opt{};
|
||||
bool check_caps = true;
|
||||
bool check_hw_caps = !(image_setup_flags & source_is_userptr);
|
||||
|
||||
vk::buffer* scratch_buf = nullptr;
|
||||
u32 scratch_offset = 0;
|
||||
@ -1015,13 +1015,13 @@ namespace vk
|
||||
image_linear_size = row_pitch * layout.depth * (rsx::is_compressed_host_format(caps, format) ? layout.height_in_block : layout.height_in_texel);
|
||||
|
||||
// Only do GPU-side conversion if occupancy is good
|
||||
if (check_caps)
|
||||
if (check_hw_caps)
|
||||
{
|
||||
caps.supports_byteswap = (image_linear_size >= 1024) || (image_setup_flags & source_is_gpu_resident);
|
||||
caps.supports_hw_deswizzle = caps.supports_byteswap;
|
||||
caps.supports_zero_copy = caps.supports_byteswap;
|
||||
caps.supports_vtc_decoding = false;
|
||||
check_caps = false;
|
||||
check_hw_caps = false;
|
||||
}
|
||||
|
||||
auto buf_allocator = [&](usz) -> std::tuple<void*, usz>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user