mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-15 09:35:27 +00:00
Improved Min/Mip -> MinFilter enum conversion
This commit is contained in:
parent
1bb08742c1
commit
cdeeac163f
|
@ -94,10 +94,42 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||
|
||||
public MinFilter UnpackMinFilter()
|
||||
{
|
||||
int minFilter = (int)(Word1 >> 4) & 3;
|
||||
int mipFilter = (int)(Word1 >> 6) & 3;
|
||||
SamplerMinFilter minFilter = (SamplerMinFilter)((Word1 >> 4) & 3);
|
||||
SamplerMipFilter mipFilter = (SamplerMipFilter)((Word1 >> 6) & 3);
|
||||
|
||||
return (MinFilter)(minFilter + (mipFilter - 1) * 2);
|
||||
return ConvertFilter(minFilter, mipFilter);
|
||||
}
|
||||
|
||||
private static MinFilter ConvertFilter(SamplerMinFilter minFilter, SamplerMipFilter mipFilter)
|
||||
{
|
||||
switch (mipFilter)
|
||||
{
|
||||
case SamplerMipFilter.None:
|
||||
switch (minFilter)
|
||||
{
|
||||
case SamplerMinFilter.Nearest: return MinFilter.Nearest;
|
||||
case SamplerMinFilter.Linear: return MinFilter.Linear;
|
||||
}
|
||||
break;
|
||||
|
||||
case SamplerMipFilter.Nearest:
|
||||
switch (minFilter)
|
||||
{
|
||||
case SamplerMinFilter.Nearest: return MinFilter.NearestMipmapNearest;
|
||||
case SamplerMinFilter.Linear: return MinFilter.LinearMipmapNearest;
|
||||
}
|
||||
break;
|
||||
|
||||
case SamplerMipFilter.Linear:
|
||||
switch (minFilter)
|
||||
{
|
||||
case SamplerMinFilter.Nearest: return MinFilter.NearestMipmapLinear;
|
||||
case SamplerMinFilter.Linear: return MinFilter.LinearMipmapLinear;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return MinFilter.Nearest;
|
||||
}
|
||||
|
||||
public ReductionFilter UnpackReductionFilter()
|
||||
|
|
8
Ryujinx.Graphics.Gpu/Image/SamplerMinFilter.cs
Normal file
8
Ryujinx.Graphics.Gpu/Image/SamplerMinFilter.cs
Normal file
|
@ -0,0 +1,8 @@
|
|||
namespace Ryujinx.Graphics.Gpu.Image
|
||||
{
|
||||
enum SamplerMinFilter
|
||||
{
|
||||
Nearest = 1,
|
||||
Linear
|
||||
}
|
||||
}
|
9
Ryujinx.Graphics.Gpu/Image/SamplerMipFilter.cs
Normal file
9
Ryujinx.Graphics.Gpu/Image/SamplerMipFilter.cs
Normal file
|
@ -0,0 +1,9 @@
|
|||
namespace Ryujinx.Graphics.Gpu.Image
|
||||
{
|
||||
enum SamplerMipFilter
|
||||
{
|
||||
None = 1,
|
||||
Nearest,
|
||||
Linear
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue