rasterizer_cache: Explicit type in traits

This commit is contained in:
GPUCode
2023-02-15 21:24:34 +02:00
parent e67a4a739a
commit 234cfd25ed
4 changed files with 15 additions and 15 deletions

View File

@ -25,7 +25,7 @@ inline auto RangeFromInterval(auto& map, const auto& interval) {
}
template <class T>
RasterizerCache<T>::RasterizerCache(Memory::MemorySystem& memory_, TextureRuntime& runtime_)
RasterizerCache<T>::RasterizerCache(Memory::MemorySystem& memory_, Runtime& runtime_)
: memory{memory_}, runtime{runtime_}, resolution_scale_factor{
VideoCore::GetResolutionScaleFactor()} {
using TextureConfig = Pica::TexturingRegs::TextureConfig;
@ -198,7 +198,7 @@ bool RasterizerCache<T>::AccelerateFill(const GPU::Regs::MemoryFillConfig& confi
params.type = SurfaceType::Fill;
params.res_scale = std::numeric_limits<u16>::max();
Surface fill_surface = std::make_shared<typename T::SurfaceType>(params, runtime);
Surface fill_surface = std::make_shared<typename T::Surface>(params, runtime);
std::memcpy(&fill_surface->fill_data[0], &config.value_32bit, 4);
if (config.fill_32bit) {
@ -1146,7 +1146,7 @@ void RasterizerCache<T>::InvalidateRegion(PAddr addr, u32 size, const Surface& r
template <class T>
auto RasterizerCache<T>::CreateSurface(SurfaceParams& params) -> Surface {
Surface surface = std::make_shared<typename T::SurfaceType>(params, runtime);
Surface surface = std::make_shared<typename T::Surface>(params, runtime);
surface->invalid_regions.insert(surface->GetInterval());
return surface;
}

View File

@ -44,8 +44,8 @@ class RasterizerCache : NonCopyable {
/// Address shift for caching surfaces into a hash table
static constexpr u64 CITRA_PAGEBITS = 18;
using TextureRuntime = typename T::RuntimeType;
using Surface = std::shared_ptr<typename T::SurfaceType>;
using Runtime = typename T::Runtime;
using Surface = std::shared_ptr<typename T::Surface>;
using Sampler = typename T::Sampler;
using Framebuffer = typename T::Framebuffer;
@ -58,7 +58,7 @@ class RasterizerCache : NonCopyable {
using PageMap = boost::icl::interval_map<u32, int>;
public:
RasterizerCache(Memory::MemorySystem& memory, TextureRuntime& runtime);
RasterizerCache(Memory::MemorySystem& memory, Runtime& runtime);
~RasterizerCache();
/// Perform hardware accelerated texture copy according to the provided configuration
@ -184,7 +184,7 @@ private:
private:
Memory::MemorySystem& memory;
TextureRuntime& runtime;
Runtime& runtime;
PageMap cached_pages;
SurfaceMap dirty_regions;
std::vector<Surface> remove_surfaces;

View File

@ -179,10 +179,10 @@ private:
};
struct Traits {
using RuntimeType = TextureRuntime;
using SurfaceType = Surface;
using Sampler = Sampler;
using Framebuffer = Framebuffer;
using Runtime = OpenGL::TextureRuntime;
using Surface = OpenGL::Surface;
using Sampler = OpenGL::Sampler;
using Framebuffer = OpenGL::Framebuffer;
};
using RasterizerCache = VideoCore::RasterizerCache<Traits>;

View File

@ -299,10 +299,10 @@ private:
};
struct Traits {
using RuntimeType = TextureRuntime;
using SurfaceType = Surface;
using Sampler = Sampler;
using Framebuffer = Framebuffer;
using Runtime = Vulkan::TextureRuntime;
using Surface = Vulkan::Surface;
using Sampler = Vulkan::Sampler;
using Framebuffer = Vulkan::Framebuffer;
};
using RasterizerCache = VideoCore::RasterizerCache<Traits>;