|
|
|
@ -55,7 +55,7 @@ static void ApplyTextureDefaults(GLuint texture, u32 max_mip_level) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SurfaceParams::InitCacheParameters(Tegra::GPUVAddr gpu_addr_) {
|
|
|
|
|
void SurfaceParams::InitCacheParameters(GPUVAddr gpu_addr_) {
|
|
|
|
|
auto& memory_manager{Core::System::GetInstance().GPU().MemoryManager()};
|
|
|
|
|
|
|
|
|
|
gpu_addr = gpu_addr_;
|
|
|
|
@ -222,7 +222,7 @@ std::size_t SurfaceParams::InnerMemorySize(bool force_gl, bool layer_only,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*static*/ SurfaceParams SurfaceParams::CreateForDepthBuffer(
|
|
|
|
|
u32 zeta_width, u32 zeta_height, Tegra::GPUVAddr zeta_address, Tegra::DepthFormat format,
|
|
|
|
|
u32 zeta_width, u32 zeta_height, GPUVAddr zeta_address, Tegra::DepthFormat format,
|
|
|
|
|
u32 block_width, u32 block_height, u32 block_depth,
|
|
|
|
|
Tegra::Engines::Maxwell3D::Regs::InvMemoryLayout type) {
|
|
|
|
|
SurfaceParams params{};
|
|
|
|
@ -980,11 +980,11 @@ void RasterizerCacheOpenGL::FastLayeredCopySurface(const Surface& src_surface,
|
|
|
|
|
const auto& init_params{src_surface->GetSurfaceParams()};
|
|
|
|
|
const auto& dst_params{dst_surface->GetSurfaceParams()};
|
|
|
|
|
auto& memory_manager{Core::System::GetInstance().GPU().MemoryManager()};
|
|
|
|
|
Tegra::GPUVAddr address{init_params.gpu_addr};
|
|
|
|
|
GPUVAddr address{init_params.gpu_addr};
|
|
|
|
|
const std::size_t layer_size{dst_params.LayerMemorySize()};
|
|
|
|
|
for (u32 layer = 0; layer < dst_params.depth; layer++) {
|
|
|
|
|
for (u32 mipmap = 0; mipmap < dst_params.max_mip_level; mipmap++) {
|
|
|
|
|
const Tegra::GPUVAddr sub_address{address + dst_params.GetMipmapLevelOffset(mipmap)};
|
|
|
|
|
const GPUVAddr sub_address{address + dst_params.GetMipmapLevelOffset(mipmap)};
|
|
|
|
|
const Surface& copy{TryGet(memory_manager.GetPointer(sub_address))};
|
|
|
|
|
if (!copy) {
|
|
|
|
|
continue;
|
|
|
|
@ -1244,10 +1244,9 @@ static std::optional<u32> TryFindBestMipMap(std::size_t memory, const SurfacePar
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static std::optional<u32> TryFindBestLayer(Tegra::GPUVAddr addr, const SurfaceParams params,
|
|
|
|
|
u32 mipmap) {
|
|
|
|
|
static std::optional<u32> TryFindBestLayer(GPUVAddr addr, const SurfaceParams params, u32 mipmap) {
|
|
|
|
|
const std::size_t size{params.LayerMemorySize()};
|
|
|
|
|
Tegra::GPUVAddr start{params.gpu_addr + params.GetMipmapLevelOffset(mipmap)};
|
|
|
|
|
GPUVAddr start{params.gpu_addr + params.GetMipmapLevelOffset(mipmap)};
|
|
|
|
|
for (u32 i = 0; i < params.depth; i++) {
|
|
|
|
|
if (start == addr) {
|
|
|
|
|
return {i};
|
|
|
|
|