mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +01:00
vk: Restore CPU fallback on the upload path
This commit is contained in:
parent
603e549c85
commit
ab99400f9d
@ -3,6 +3,9 @@
|
||||
#include <util/types.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
// Set this to 1 to force all decoding to be done on the CPU.
|
||||
#define DEBUG_DMA_TILING 0
|
||||
|
||||
// This is a 1:1 port of the GPU code for my own sanity when debugging misplaced bits
|
||||
// For a high-level explanation, read https://envytools.readthedocs.io/en/latest/hw/memory/vram.html
|
||||
namespace rsx
|
||||
|
@ -687,8 +687,28 @@ namespace vk
|
||||
rsx::flags32_t upload_flags = upload_contents_inline;
|
||||
u32 heap_align = rsx_pitch;
|
||||
|
||||
#if DEBUG_DMA_TILING
|
||||
std::vector<u8> ext_data;
|
||||
#endif
|
||||
|
||||
if (auto tiled_region = rsx::get_current_renderer()->get_tiled_memory_region(range))
|
||||
{
|
||||
#if DEBUG_DMA_TILING
|
||||
auto real_data = vm::get_super_ptr<u8>(range.start);
|
||||
ext_data.resize(tiled_region.tile->size);
|
||||
rsx::tile_texel_data<u32, true>(
|
||||
ext_data.data(),
|
||||
real_data,
|
||||
tiled_region.base_address,
|
||||
range.start - tiled_region.base_address,
|
||||
tiled_region.tile->size,
|
||||
tiled_region.tile->bank,
|
||||
tiled_region.tile->pitch,
|
||||
subres.width_in_block,
|
||||
subres.height_in_block
|
||||
);
|
||||
subres.data = std::span(ext_data);
|
||||
#else
|
||||
const auto available_tile_size = tiled_region.tile->size - (range.start - tiled_region.base_address);
|
||||
const auto max_content_size = tiled_region.tile->pitch * utils::align<u32>(subres.height_in_block, 64);
|
||||
const auto section_length = std::min(max_content_size, available_tile_size);
|
||||
@ -747,6 +767,7 @@ namespace vk
|
||||
subres.data = { scratch_buf, linear_data_scratch_offset };
|
||||
upload_flags |= source_is_gpu_resident;
|
||||
heap_align = subres.width_in_block * get_bpp();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (g_cfg.video.resolution_scale_percent == 100 && spp == 1) [[likely]]
|
||||
|
@ -8,18 +8,13 @@
|
||||
#include "vkutils/image_helpers.h"
|
||||
|
||||
#include "../Common/texture_cache.h"
|
||||
#include "../Common/tiled_dma_copy.hpp"
|
||||
|
||||
#include "Emu/Cell/timers.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#define DEBUG_DMA_TILING 0
|
||||
|
||||
#if DEBUG_DMA_TILING
|
||||
#include "../Common/tiled_dma_copy.hpp"
|
||||
#endif
|
||||
|
||||
namespace vk
|
||||
{
|
||||
class cached_texture_section;
|
||||
|
Loading…
Reference in New Issue
Block a user