aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Vic
diff options
context:
space:
mode:
authorAlex Barney <thealexbarney@gmail.com>2019-03-03 19:45:25 -0600
committerjduncanator <1518948+jduncanator@users.noreply.github.com>2019-03-04 12:45:25 +1100
commit1f554c1093dde6a4d3ed80fae2675abfb6c12fac (patch)
treebbbdfb87999168288777ac404081f3e49c7440ae /Ryujinx.Graphics/Vic
parent8e71ea0812f6b56ff819dbda951b463bcb5eb8dc (diff)
Do naming refactoring on Ryujinx.Graphics (#611)
* Renaming part 1 * Renaming part 2 * Renaming part 3 * Renaming part 4 * Renaming part 5 * Renaming part 6 * Renaming part 7 * Renaming part 8 * Renaming part 9 * Renaming part 10 * General cleanup * Thought I got all of these * Apply #595 * Additional renaming * Tweaks from feedback * Rename files
Diffstat (limited to 'Ryujinx.Graphics/Vic')
-rw-r--r--Ryujinx.Graphics/Vic/StructUnpacker.cs52
-rw-r--r--Ryujinx.Graphics/Vic/SurfaceOutputConfig.cs28
-rw-r--r--Ryujinx.Graphics/Vic/SurfacePixelFormat.cs4
-rw-r--r--Ryujinx.Graphics/Vic/VideoImageComposer.cs96
4 files changed, 90 insertions, 90 deletions
diff --git a/Ryujinx.Graphics/Vic/StructUnpacker.cs b/Ryujinx.Graphics/Vic/StructUnpacker.cs
index 62777aad..6b6b9795 100644
--- a/Ryujinx.Graphics/Vic/StructUnpacker.cs
+++ b/Ryujinx.Graphics/Vic/StructUnpacker.cs
@@ -5,64 +5,64 @@ namespace Ryujinx.Graphics.Vic
{
class StructUnpacker
{
- private NvGpuVmm Vmm;
+ private NvGpuVmm _vmm;
- private long Position;
+ private long _position;
- private ulong Buffer;
- private int BuffPos;
+ private ulong _buffer;
+ private int _buffPos;
- public StructUnpacker(NvGpuVmm Vmm, long Position)
+ public StructUnpacker(NvGpuVmm vmm, long position)
{
- this.Vmm = Vmm;
- this.Position = Position;
+ _vmm = vmm;
+ _position = position;
- BuffPos = 64;
+ _buffPos = 64;
}
- public int Read(int Bits)
+ public int Read(int bits)
{
- if ((uint)Bits > 32)
+ if ((uint)bits > 32)
{
- throw new ArgumentOutOfRangeException(nameof(Bits));
+ throw new ArgumentOutOfRangeException(nameof(bits));
}
- int Value = 0;
+ int value = 0;
- while (Bits > 0)
+ while (bits > 0)
{
RefillBufferIfNeeded();
- int ReadBits = Bits;
+ int readBits = bits;
- int MaxReadBits = 64 - BuffPos;
+ int maxReadBits = 64 - _buffPos;
- if (ReadBits > MaxReadBits)
+ if (readBits > maxReadBits)
{
- ReadBits = MaxReadBits;
+ readBits = maxReadBits;
}
- Value <<= ReadBits;
+ value <<= readBits;
- Value |= (int)(Buffer >> BuffPos) & (int)(0xffffffff >> (32 - ReadBits));
+ value |= (int)(_buffer >> _buffPos) & (int)(0xffffffff >> (32 - readBits));
- BuffPos += ReadBits;
+ _buffPos += readBits;
- Bits -= ReadBits;
+ bits -= readBits;
}
- return Value;
+ return value;
}
private void RefillBufferIfNeeded()
{
- if (BuffPos >= 64)
+ if (_buffPos >= 64)
{
- Buffer = Vmm.ReadUInt64(Position);
+ _buffer = _vmm.ReadUInt64(_position);
- Position += 8;
+ _position += 8;
- BuffPos = 0;
+ _buffPos = 0;
}
}
}
diff --git a/Ryujinx.Graphics/Vic/SurfaceOutputConfig.cs b/Ryujinx.Graphics/Vic/SurfaceOutputConfig.cs
index 0a232744..bdd55fc7 100644
--- a/Ryujinx.Graphics/Vic/SurfaceOutputConfig.cs
+++ b/Ryujinx.Graphics/Vic/SurfaceOutputConfig.cs
@@ -13,21 +13,21 @@ namespace Ryujinx.Graphics.Vic
public long SurfaceChromaVAddress;
public SurfaceOutputConfig(
- SurfacePixelFormat PixelFormat,
- int SurfaceWidth,
- int SurfaceHeight,
- int GobBlockHeight,
- long OutputSurfaceLumaAddress,
- long OutputSurfaceChromaUAddress,
- long OutputSurfaceChromaVAddress)
+ SurfacePixelFormat pixelFormat,
+ int surfaceWidth,
+ int surfaceHeight,
+ int gobBlockHeight,
+ long outputSurfaceLumaAddress,
+ long outputSurfaceChromaUAddress,
+ long outputSurfaceChromaVAddress)
{
- this.PixelFormat = PixelFormat;
- this.SurfaceWidth = SurfaceWidth;
- this.SurfaceHeight = SurfaceHeight;
- this.GobBlockHeight = GobBlockHeight;
- this.SurfaceLumaAddress = OutputSurfaceLumaAddress;
- this.SurfaceChromaUAddress = OutputSurfaceChromaUAddress;
- this.SurfaceChromaVAddress = OutputSurfaceChromaVAddress;
+ PixelFormat = pixelFormat;
+ SurfaceWidth = surfaceWidth;
+ SurfaceHeight = surfaceHeight;
+ GobBlockHeight = gobBlockHeight;
+ SurfaceLumaAddress = outputSurfaceLumaAddress;
+ SurfaceChromaUAddress = outputSurfaceChromaUAddress;
+ SurfaceChromaVAddress = outputSurfaceChromaVAddress;
}
}
} \ No newline at end of file
diff --git a/Ryujinx.Graphics/Vic/SurfacePixelFormat.cs b/Ryujinx.Graphics/Vic/SurfacePixelFormat.cs
index ee56ac05..8dabd094 100644
--- a/Ryujinx.Graphics/Vic/SurfacePixelFormat.cs
+++ b/Ryujinx.Graphics/Vic/SurfacePixelFormat.cs
@@ -2,7 +2,7 @@ namespace Ryujinx.Graphics.Vic
{
enum SurfacePixelFormat
{
- RGBA8 = 0x1f,
- YUV420P = 0x44
+ Rgba8 = 0x1f,
+ Yuv420P = 0x44
}
} \ No newline at end of file
diff --git a/Ryujinx.Graphics/Vic/VideoImageComposer.cs b/Ryujinx.Graphics/Vic/VideoImageComposer.cs
index 758382fa..e05bcfdb 100644
--- a/Ryujinx.Graphics/Vic/VideoImageComposer.cs
+++ b/Ryujinx.Graphics/Vic/VideoImageComposer.cs
@@ -4,104 +4,104 @@ namespace Ryujinx.Graphics.Vic
{
class VideoImageComposer
{
- private NvGpu Gpu;
+ private NvGpu _gpu;
- private long ConfigStructAddress;
- private long OutputSurfaceLumaAddress;
- private long OutputSurfaceChromaUAddress;
- private long OutputSurfaceChromaVAddress;
+ private long _configStructAddress;
+ private long _outputSurfaceLumaAddress;
+ private long _outputSurfaceChromaUAddress;
+ private long _outputSurfaceChromaVAddress;
- public VideoImageComposer(NvGpu Gpu)
+ public VideoImageComposer(NvGpu gpu)
{
- this.Gpu = Gpu;
+ _gpu = gpu;
}
- public void Process(NvGpuVmm Vmm, int MethodOffset, int[] Arguments)
+ public void Process(NvGpuVmm vmm, int methodOffset, int[] arguments)
{
- VideoImageComposerMeth Method = (VideoImageComposerMeth)MethodOffset;
+ VideoImageComposerMeth method = (VideoImageComposerMeth)methodOffset;
- switch (Method)
+ switch (method)
{
case VideoImageComposerMeth.Execute:
- Execute(Vmm, Arguments);
+ Execute(vmm, arguments);
break;
case VideoImageComposerMeth.SetConfigStructOffset:
- SetConfigStructOffset(Vmm, Arguments);
+ SetConfigStructOffset(vmm, arguments);
break;
case VideoImageComposerMeth.SetOutputSurfaceLumaOffset:
- SetOutputSurfaceLumaOffset(Vmm, Arguments);
+ SetOutputSurfaceLumaOffset(vmm, arguments);
break;
case VideoImageComposerMeth.SetOutputSurfaceChromaUOffset:
- SetOutputSurfaceChromaUOffset(Vmm, Arguments);
+ SetOutputSurfaceChromaUOffset(vmm, arguments);
break;
case VideoImageComposerMeth.SetOutputSurfaceChromaVOffset:
- SetOutputSurfaceChromaVOffset(Vmm, Arguments);
+ SetOutputSurfaceChromaVOffset(vmm, arguments);
break;
}
}
- private void Execute(NvGpuVmm Vmm, int[] Arguments)
+ private void Execute(NvGpuVmm vmm, int[] arguments)
{
- StructUnpacker Unpacker = new StructUnpacker(Vmm, ConfigStructAddress + 0x20);
+ StructUnpacker unpacker = new StructUnpacker(vmm, _configStructAddress + 0x20);
- SurfacePixelFormat PixelFormat = (SurfacePixelFormat)Unpacker.Read(7);
+ SurfacePixelFormat pixelFormat = (SurfacePixelFormat)unpacker.Read(7);
- int ChromaLocHoriz = Unpacker.Read(2);
- int ChromaLocVert = Unpacker.Read(2);
+ int chromaLocHoriz = unpacker.Read(2);
+ int chromaLocVert = unpacker.Read(2);
- int BlockLinearKind = Unpacker.Read(4);
- int BlockLinearHeightLog2 = Unpacker.Read(4);
+ int blockLinearKind = unpacker.Read(4);
+ int blockLinearHeightLog2 = unpacker.Read(4);
- int Reserved0 = Unpacker.Read(3);
- int Reserved1 = Unpacker.Read(10);
+ int reserved0 = unpacker.Read(3);
+ int reserved1 = unpacker.Read(10);
- int SurfaceWidthMinus1 = Unpacker.Read(14);
- int SurfaceHeightMinus1 = Unpacker.Read(14);
+ int surfaceWidthMinus1 = unpacker.Read(14);
+ int surfaceHeightMinus1 = unpacker.Read(14);
- int GobBlockHeight = 1 << BlockLinearHeightLog2;
+ int gobBlockHeight = 1 << blockLinearHeightLog2;
- int SurfaceWidth = SurfaceWidthMinus1 + 1;
- int SurfaceHeight = SurfaceHeightMinus1 + 1;
+ int surfaceWidth = surfaceWidthMinus1 + 1;
+ int surfaceHeight = surfaceHeightMinus1 + 1;
- SurfaceOutputConfig OutputConfig = new SurfaceOutputConfig(
- PixelFormat,
- SurfaceWidth,
- SurfaceHeight,
- GobBlockHeight,
- OutputSurfaceLumaAddress,
- OutputSurfaceChromaUAddress,
- OutputSurfaceChromaVAddress);
+ SurfaceOutputConfig outputConfig = new SurfaceOutputConfig(
+ pixelFormat,
+ surfaceWidth,
+ surfaceHeight,
+ gobBlockHeight,
+ _outputSurfaceLumaAddress,
+ _outputSurfaceChromaUAddress,
+ _outputSurfaceChromaVAddress);
- Gpu.VideoDecoder.CopyPlanes(Vmm, OutputConfig);
+ _gpu.VideoDecoder.CopyPlanes(vmm, outputConfig);
}
- private void SetConfigStructOffset(NvGpuVmm Vmm, int[] Arguments)
+ private void SetConfigStructOffset(NvGpuVmm vmm, int[] arguments)
{
- ConfigStructAddress = GetAddress(Arguments);
+ _configStructAddress = GetAddress(arguments);
}
- private void SetOutputSurfaceLumaOffset(NvGpuVmm Vmm, int[] Arguments)
+ private void SetOutputSurfaceLumaOffset(NvGpuVmm vmm, int[] arguments)
{
- OutputSurfaceLumaAddress = GetAddress(Arguments);
+ _outputSurfaceLumaAddress = GetAddress(arguments);
}
- private void SetOutputSurfaceChromaUOffset(NvGpuVmm Vmm, int[] Arguments)
+ private void SetOutputSurfaceChromaUOffset(NvGpuVmm vmm, int[] arguments)
{
- OutputSurfaceChromaUAddress = GetAddress(Arguments);
+ _outputSurfaceChromaUAddress = GetAddress(arguments);
}
- private void SetOutputSurfaceChromaVOffset(NvGpuVmm Vmm, int[] Arguments)
+ private void SetOutputSurfaceChromaVOffset(NvGpuVmm vmm, int[] arguments)
{
- OutputSurfaceChromaVAddress = GetAddress(Arguments);
+ _outputSurfaceChromaVAddress = GetAddress(arguments);
}
- private static long GetAddress(int[] Arguments)
+ private static long GetAddress(int[] arguments)
{
- return (long)(uint)Arguments[0] << 8;
+ return (long)(uint)arguments[0] << 8;
}
}
} \ No newline at end of file