0
0
Fork 0
mirror of https://github.com/GreemDev/Ryujinx.git synced 2024-12-23 09:15:46 +00:00
Ryujinx/Ryujinx.Graphics.GAL/SamplerCreateInfo.cs
Andrey Sukharev 4da44e09cb
Make structs readonly when applicable (#4002)
* Make all structs readonly when applicable. It should reduce amount of needless defensive copies

* Make structs with trivial boilerplate equality code record structs

* Remove unnecessary readonly modifiers from TextureCreateInfo

* Make BitMap structs readonly too
2022-12-05 14:47:39 +01:00

72 lines
No EOL
2.2 KiB
C#

namespace Ryujinx.Graphics.GAL
{
public readonly struct SamplerCreateInfo
{
public MinFilter MinFilter { get; }
public MagFilter MagFilter { get; }
public bool SeamlessCubemap { get; }
public AddressMode AddressU { get; }
public AddressMode AddressV { get; }
public AddressMode AddressP { get; }
public CompareMode CompareMode { get; }
public CompareOp CompareOp { get; }
public ColorF BorderColor { get; }
public float MinLod { get; }
public float MaxLod { get; }
public float MipLodBias { get; }
public float MaxAnisotropy { get; }
public SamplerCreateInfo(
MinFilter minFilter,
MagFilter magFilter,
bool seamlessCubemap,
AddressMode addressU,
AddressMode addressV,
AddressMode addressP,
CompareMode compareMode,
CompareOp compareOp,
ColorF borderColor,
float minLod,
float maxLod,
float mipLodBias,
float maxAnisotropy)
{
MinFilter = minFilter;
MagFilter = magFilter;
SeamlessCubemap = seamlessCubemap;
AddressU = addressU;
AddressV = addressV;
AddressP = addressP;
CompareMode = compareMode;
CompareOp = compareOp;
BorderColor = borderColor;
MinLod = minLod;
MaxLod = maxLod;
MipLodBias = mipLodBias;
MaxAnisotropy = maxAnisotropy;
}
public static SamplerCreateInfo Create(MinFilter minFilter, MagFilter magFilter)
{
return new SamplerCreateInfo(
minFilter,
magFilter,
false,
AddressMode.ClampToEdge,
AddressMode.ClampToEdge,
AddressMode.ClampToEdge,
CompareMode.None,
GAL.CompareOp.Always,
new ColorF(0f, 0f, 0f, 0f),
0f,
0f,
0f,
1f);
}
}
}