Renaming part 1

This commit is contained in:
Alex Barney 2019-03-03 11:05:51 -06:00
commit a268285d9e
5 changed files with 27 additions and 27 deletions

View file

@ -2,7 +2,7 @@
{ {
public struct ColorMaskState public struct ColorMaskState
{ {
private static readonly ColorMaskState _Default = new ColorMaskState() private static readonly ColorMaskState DefaultBackingField = new ColorMaskState()
{ {
Red = true, Red = true,
Green = true, Green = true,
@ -10,7 +10,7 @@
Alpha = true Alpha = true
}; };
public static ColorMaskState Default => _Default; public static ColorMaskState Default => DefaultBackingField;
public bool Red; public bool Red;
public bool Green; public bool Green;
@ -20,7 +20,7 @@
public struct BlendState public struct BlendState
{ {
private static readonly BlendState _Default = new BlendState() private static readonly BlendState DefaultBackingField = new BlendState()
{ {
Enabled = false, Enabled = false,
SeparateAlpha = false, SeparateAlpha = false,
@ -32,7 +32,7 @@
FuncDstAlpha = GalBlendFactor.Zero FuncDstAlpha = GalBlendFactor.Zero
}; };
public static BlendState Default => _Default; public static BlendState Default => DefaultBackingField;
public bool Enabled; public bool Enabled;
public bool SeparateAlpha; public bool SeparateAlpha;

View file

@ -5,16 +5,16 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{ {
static class OGLExtension static class OGLExtension
{ {
private static Lazy<bool> s_EnhancedLayouts = new Lazy<bool>(() => HasExtension("GL_ARB_enhanced_layouts")); private static Lazy<bool> _enhancedLayouts = new Lazy<bool>(() => HasExtension("GL_ARB_enhanced_layouts"));
private static Lazy<bool> s_TextureMirrorClamp = new Lazy<bool>(() => HasExtension("GL_EXT_texture_mirror_clamp")); private static Lazy<bool> _textureMirrorClamp = new Lazy<bool>(() => HasExtension("GL_EXT_texture_mirror_clamp"));
private static Lazy<bool> s_ViewportArray = new Lazy<bool>(() => HasExtension("GL_ARB_viewport_array")); private static Lazy<bool> _viewportArray = new Lazy<bool>(() => HasExtension("GL_ARB_viewport_array"));
private static Lazy<bool> s_NvidiaDriver = new Lazy<bool>(() => IsNvidiaDriver()); private static Lazy<bool> _nvidiaDriver = new Lazy<bool>(() => IsNvidiaDriver());
public static bool EnhancedLayouts => s_EnhancedLayouts.Value; public static bool EnhancedLayouts => _enhancedLayouts.Value;
public static bool TextureMirrorClamp => s_TextureMirrorClamp.Value; public static bool TextureMirrorClamp => _textureMirrorClamp.Value;
public static bool ViewportArray => s_ViewportArray.Value; public static bool ViewportArray => _viewportArray.Value;
public static bool NvidiaDrvier => s_NvidiaDriver.Value; public static bool NvidiaDriver => _nvidiaDriver.Value;
private static bool HasExtension(string Name) private static bool HasExtension(string Name)
{ {

View file

@ -53,7 +53,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{ {
GlslProgram Program; GlslProgram Program;
GlslDecompiler Decompiler = new GlslDecompiler(OGLLimit.MaxUboSize, OGLExtension.NvidiaDrvier); GlslDecompiler Decompiler = new GlslDecompiler(OGLLimit.MaxUboSize, OGLExtension.NvidiaDriver);
int ShaderDumpIndex = ShaderDumper.DumpIndex; int ShaderDumpIndex = ShaderDumper.DumpIndex;

View file

@ -587,8 +587,8 @@ namespace Ryujinx.Graphics.Texture
case 2: case 2:
{ {
C = 23; C = 23;
int b = (BitValue >> 1) & 1; int b2 = (BitValue >> 1) & 1;
B = (b << 6) | (b << 2) | b; B = (b2 << 6) | (b2 << 2) | b2;
break; break;
} }
@ -634,8 +634,8 @@ namespace Ryujinx.Graphics.Texture
case 2: case 2:
{ {
C = 13; C = 13;
int b = (BitValue >> 1) & 1; int b2 = (BitValue >> 1) & 1;
B = (b << 6) | (b << 1); B = (b2 << 6) | (b2 << 1);
break; break;
} }

View file

@ -167,7 +167,7 @@ namespace Ryujinx.Graphics.Texture
{ {
// Implement the algorithm in section C.2.12 // Implement the algorithm in section C.2.12
int[] m = new int[3]; int[] m = new int[3];
int[] q = new int[3]; int[] qa = new int[3];
int Q; int Q;
// Read the trit encoded block according to // Read the trit encoded block according to
@ -182,33 +182,33 @@ namespace Ryujinx.Graphics.Texture
BitArrayStream Qb = new BitArrayStream(new BitArray(new int[] { Q })); BitArrayStream Qb = new BitArrayStream(new BitArray(new int[] { Q }));
if (Qb.ReadBits(1, 2) == 3 && Qb.ReadBits(5, 6) == 0) if (Qb.ReadBits(1, 2) == 3 && Qb.ReadBits(5, 6) == 0)
{ {
q[0] = q[1] = 4; qa[0] = qa[1] = 4;
q[2] = (Qb.ReadBit(0) << 2) | ((Qb.ReadBit(4) & ~Qb.ReadBit(0)) << 1) | (Qb.ReadBit(3) & ~Qb.ReadBit(0)); qa[2] = (Qb.ReadBit(0) << 2) | ((Qb.ReadBit(4) & ~Qb.ReadBit(0)) << 1) | (Qb.ReadBit(3) & ~Qb.ReadBit(0));
} }
else else
{ {
int C = 0; int C = 0;
if (Qb.ReadBits(1, 2) == 3) if (Qb.ReadBits(1, 2) == 3)
{ {
q[2] = 4; qa[2] = 4;
C = (Qb.ReadBits(3, 4) << 3) | ((~Qb.ReadBits(5, 6) & 3) << 1) | Qb.ReadBit(0); C = (Qb.ReadBits(3, 4) << 3) | ((~Qb.ReadBits(5, 6) & 3) << 1) | Qb.ReadBit(0);
} }
else else
{ {
q[2] = Qb.ReadBits(5, 6); qa[2] = Qb.ReadBits(5, 6);
C = Qb.ReadBits(0, 4); C = Qb.ReadBits(0, 4);
} }
BitArrayStream Cb = new BitArrayStream(new BitArray(new int[] { C })); BitArrayStream Cb = new BitArrayStream(new BitArray(new int[] { C }));
if (Cb.ReadBits(0, 2) == 5) if (Cb.ReadBits(0, 2) == 5)
{ {
q[1] = 4; qa[1] = 4;
q[0] = Cb.ReadBits(3, 4); qa[0] = Cb.ReadBits(3, 4);
} }
else else
{ {
q[1] = Cb.ReadBits(3, 4); qa[1] = Cb.ReadBits(3, 4);
q[0] = Cb.ReadBits(0, 2); qa[0] = Cb.ReadBits(0, 2);
} }
} }
@ -217,7 +217,7 @@ namespace Ryujinx.Graphics.Texture
IntegerEncoded IntEncoded = new IntegerEncoded(EIntegerEncoding.Quint, NumberBitsPerValue) IntegerEncoded IntEncoded = new IntegerEncoded(EIntegerEncoding.Quint, NumberBitsPerValue)
{ {
BitValue = m[i], BitValue = m[i],
QuintValue = q[i] QuintValue = qa[i]
}; };
ListIntegerEncoded.Add(IntEncoded); ListIntegerEncoded.Add(IntEncoded);
} }