mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-24 08:37:11 +02:00
Clamp amount of mipmap levels to max allowed for all backends (#7197)
* Clamp amount of mipmap levels to max allowed for all backends * XML docs * Remove using
This commit is contained in:
parent
8d8983049e
commit
4f75e26ec7
4 changed files with 36 additions and 25 deletions
|
@ -1,6 +1,5 @@
|
|||
using Ryujinx.Common;
|
||||
using System;
|
||||
using System.Numerics;
|
||||
|
||||
namespace Ryujinx.Graphics.GAL
|
||||
{
|
||||
|
@ -113,25 +112,6 @@ namespace Ryujinx.Graphics.GAL
|
|||
return 1;
|
||||
}
|
||||
|
||||
public int GetLevelsClamped()
|
||||
{
|
||||
int maxSize = Width;
|
||||
|
||||
if (Target != Target.Texture1D &&
|
||||
Target != Target.Texture1DArray)
|
||||
{
|
||||
maxSize = Math.Max(maxSize, Height);
|
||||
}
|
||||
|
||||
if (Target == Target.Texture3D)
|
||||
{
|
||||
maxSize = Math.Max(maxSize, Depth);
|
||||
}
|
||||
|
||||
int maxLevels = BitOperations.Log2((uint)maxSize) + 1;
|
||||
return Math.Min(Levels, maxLevels);
|
||||
}
|
||||
|
||||
private static int GetLevelSize(int size, int level)
|
||||
{
|
||||
return Math.Max(1, size >> level);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue