texture_cache: detiler: change staging to faster stream buffer

This commit is contained in:
psucien 2024-06-05 18:16:31 +02:00
parent bee444b6da
commit b59e525408
3 changed files with 12 additions and 8 deletions

View File

@ -64,10 +64,9 @@ static constexpr u64 PageShift = 12;
TextureCache::TextureCache(const Vulkan::Instance& instance_, Vulkan::Scheduler& scheduler_) TextureCache::TextureCache(const Vulkan::Instance& instance_, Vulkan::Scheduler& scheduler_)
: instance{instance_}, scheduler{scheduler_}, : instance{instance_}, scheduler{scheduler_},
staging{instance, scheduler, staging{instance, scheduler, vk::BufferUsageFlagBits::eTransferSrc, StreamBufferSize,
vk::BufferUsageFlagBits::eTransferSrc | vk::BufferUsageFlagBits::eStorageBuffer, Vulkan::BufferType::Upload},
StreamBufferSize, Vulkan::BufferType::Upload}, tile_manager{instance, scheduler, *this} {
tile_manager{instance, scheduler, *this, staging} {
#ifndef _WIN64 #ifndef _WIN64
sigset_t signal_mask; sigset_t signal_mask;

View File

@ -202,9 +202,14 @@ const DetilerContext* TileManager::GetDetiler(const Image& image) const {
return nullptr; return nullptr;
} }
static constexpr vk::BufferUsageFlags StagingFlags = vk::BufferUsageFlagBits::eTransferDst |
vk::BufferUsageFlagBits::eUniformBuffer |
vk::BufferUsageFlagBits::eStorageBuffer;
TileManager::TileManager(const Vulkan::Instance& instance, Vulkan::Scheduler& scheduler, TileManager::TileManager(const Vulkan::Instance& instance, Vulkan::Scheduler& scheduler,
TextureCache& texture_cache, Vulkan::StreamBuffer& staging) TextureCache& texture_cache)
: instance{instance}, scheduler{scheduler}, texture_cache{texture_cache}, staging{staging} { : instance{instance}, scheduler{scheduler}, texture_cache{texture_cache},
staging{instance, scheduler, StagingFlags, 64_MB} {
static const std::array detiler_shaders{ static const std::array detiler_shaders{
HostShaders::DETILE_M8X1_COMP, HostShaders::DETILE_M8X1_COMP,

View File

@ -32,7 +32,7 @@ struct DetilerContext {
class TileManager { class TileManager {
public: public:
TileManager(const Vulkan::Instance& instance, Vulkan::Scheduler& scheduler, TileManager(const Vulkan::Instance& instance, Vulkan::Scheduler& scheduler,
TextureCache& texture_cache, Vulkan::StreamBuffer& staging); TextureCache& texture_cache);
~TileManager(); ~TileManager();
bool TryDetile(Image& image); bool TryDetile(Image& image);
@ -44,7 +44,7 @@ private:
const Vulkan::Instance& instance; const Vulkan::Instance& instance;
Vulkan::Scheduler& scheduler; Vulkan::Scheduler& scheduler;
TextureCache& texture_cache; TextureCache& texture_cache;
Vulkan::StreamBuffer& staging; Vulkan::StreamBuffer staging;
std::array<DetilerContext, DetilerType::Max> detilers; std::array<DetilerContext, DetilerType::Max> detilers;
}; };