Fix GetHandleInformation for mipmapped 3d textures (#2569)

Got this the wrong way round - was causing games to try synchronize mipmap levels of like 52 on a 3d texture with 6 levels. Also, corrected the variable name in the method that _was_ working.
This commit is contained in:
riperiperi 2021-08-20 18:59:39 +01:00 committed by GitHub
parent f2a7b300c4
commit 97aedc030d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -452,13 +452,13 @@ namespace Ryujinx.Graphics.Gpu.Image
index = handleIndex;
baseLevel = 0;
int layerLevels = _levels;
int levelLayers = _layers;
while (handleIndex >= layerLevels)
while (handleIndex >= levelLayers)
{
handleIndex -= layerLevels;
handleIndex -= levelLayers;
baseLevel++;
layerLevels = Math.Max(layerLevels >> 1, 1);
levelLayers = Math.Max(levelLayers >> 1, 1);
}
baseLayer = handleIndex;
@ -492,13 +492,13 @@ namespace Ryujinx.Graphics.Gpu.Image
{
int baseLevel = 0;
int layerLevels = _layers;
int levelLayers = _layers;
while (index >= layerLevels)
while (index >= levelLayers)
{
index -= layerLevels;
index -= levelLayers;
baseLevel++;
layerLevels = Math.Max(layerLevels >> 1, 1);
levelLayers = Math.Max(levelLayers >> 1, 1);
}
return (index, baseLevel);