diff --git a/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h b/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h index c887f620..3526f0da 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h @@ -1772,17 +1772,21 @@ namespace skyline::gpu::interconnect { size_t size; //!< The size of the texture in bytes if (textureControl.headerType == TextureImageControl::HeaderType::Pitch) { - u32 pitch{static_cast(textureControl.tileConfig.pitchHigh) << TextureImageControl::TileConfig::PitchAlignmentBits}; guest.tileConfig = { .mode = texture::TileMode::Pitch, - .pitch = pitch, + .pitch = static_cast(textureControl.tileConfig.pitchHigh) << TextureImageControl::TileConfig::PitchAlignmentBits, + }; + } else if (textureControl.headerType == TextureImageControl::HeaderType::BlockLinear) { + guest.tileConfig = { + .mode = texture::TileMode::Block, + .blockHeight = static_cast(1U << textureControl.tileConfig.tileHeightGobsLog2), + .blockDepth = static_cast(1U << textureControl.tileConfig.tileDepthGobsLog2), }; - size = pitch * guest.dimensions.height * guest.dimensions.depth * guest.layerCount; } else { throw exception("Unsupported TIC Header Type: {}", static_cast(textureControl.headerType)); } - auto mappings{channelCtx.asCtx->gmmu.TranslateRange(textureControl.Iova(), size)}; + auto mappings{channelCtx.asCtx->gmmu.TranslateRange(textureControl.Iova(), guest.GetLayerSize() * (guest.layerCount - guest.baseArrayLayer))}; guest.mappings.assign(mappings.begin(), mappings.end()); } else if (auto textureView{poolTexture.view.lock()}; textureView != nullptr) { // If the entry already exists and the view is still valid then we return it directly