mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 06:51:26 +12:00
vk: Restore CPU fallback on the upload path
This commit is contained in:
parent
603e549c85
commit
ab99400f9d
3 changed files with 25 additions and 6 deletions
|
@ -3,6 +3,9 @@
|
||||||
#include <util/types.hpp>
|
#include <util/types.hpp>
|
||||||
#include <cstdint>
|
#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
|
// 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
|
// For a high-level explanation, read https://envytools.readthedocs.io/en/latest/hw/memory/vram.html
|
||||||
namespace rsx
|
namespace rsx
|
||||||
|
|
|
@ -687,8 +687,28 @@ namespace vk
|
||||||
rsx::flags32_t upload_flags = upload_contents_inline;
|
rsx::flags32_t upload_flags = upload_contents_inline;
|
||||||
u32 heap_align = rsx_pitch;
|
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 (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 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 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);
|
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 };
|
subres.data = { scratch_buf, linear_data_scratch_offset };
|
||||||
upload_flags |= source_is_gpu_resident;
|
upload_flags |= source_is_gpu_resident;
|
||||||
heap_align = subres.width_in_block * get_bpp();
|
heap_align = subres.width_in_block * get_bpp();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_cfg.video.resolution_scale_percent == 100 && spp == 1) [[likely]]
|
if (g_cfg.video.resolution_scale_percent == 100 && spp == 1) [[likely]]
|
||||||
|
|
|
@ -8,18 +8,13 @@
|
||||||
#include "vkutils/image_helpers.h"
|
#include "vkutils/image_helpers.h"
|
||||||
|
|
||||||
#include "../Common/texture_cache.h"
|
#include "../Common/texture_cache.h"
|
||||||
|
#include "../Common/tiled_dma_copy.hpp"
|
||||||
|
|
||||||
#include "Emu/Cell/timers.hpp"
|
#include "Emu/Cell/timers.hpp"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define DEBUG_DMA_TILING 0
|
|
||||||
|
|
||||||
#if DEBUG_DMA_TILING
|
|
||||||
#include "../Common/tiled_dma_copy.hpp"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace vk
|
namespace vk
|
||||||
{
|
{
|
||||||
class cached_texture_section;
|
class cached_texture_section;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue