Renaming part 9

This commit is contained in:
Alex Barney 2019-03-03 13:36:15 -06:00
commit bed93cc871
3 changed files with 88 additions and 88 deletions

View file

@ -5,64 +5,64 @@ namespace Ryujinx.Graphics.Vic
{ {
class StructUnpacker class StructUnpacker
{ {
private NvGpuVmm Vmm; private NvGpuVmm _vmm;
private long Position; private long _position;
private ulong Buffer; private ulong _buffer;
private int BuffPos; private int _buffPos;
public StructUnpacker(NvGpuVmm Vmm, long Position) public StructUnpacker(NvGpuVmm vmm, long position)
{ {
this.Vmm = Vmm; this._vmm = vmm;
this.Position = Position; this._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(); 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() 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;
} }
} }
} }

View file

@ -13,21 +13,21 @@ namespace Ryujinx.Graphics.Vic
public long SurfaceChromaVAddress; public long SurfaceChromaVAddress;
public SurfaceOutputConfig( public SurfaceOutputConfig(
SurfacePixelFormat PixelFormat, SurfacePixelFormat pixelFormat,
int SurfaceWidth, int surfaceWidth,
int SurfaceHeight, int surfaceHeight,
int GobBlockHeight, int gobBlockHeight,
long OutputSurfaceLumaAddress, long outputSurfaceLumaAddress,
long OutputSurfaceChromaUAddress, long outputSurfaceChromaUAddress,
long OutputSurfaceChromaVAddress) long outputSurfaceChromaVAddress)
{ {
this.PixelFormat = PixelFormat; this.PixelFormat = pixelFormat;
this.SurfaceWidth = SurfaceWidth; this.SurfaceWidth = surfaceWidth;
this.SurfaceHeight = SurfaceHeight; this.SurfaceHeight = surfaceHeight;
this.GobBlockHeight = GobBlockHeight; this.GobBlockHeight = gobBlockHeight;
this.SurfaceLumaAddress = OutputSurfaceLumaAddress; this.SurfaceLumaAddress = outputSurfaceLumaAddress;
this.SurfaceChromaUAddress = OutputSurfaceChromaUAddress; this.SurfaceChromaUAddress = outputSurfaceChromaUAddress;
this.SurfaceChromaVAddress = OutputSurfaceChromaVAddress; this.SurfaceChromaVAddress = outputSurfaceChromaVAddress;
} }
} }
} }

View file

@ -4,104 +4,104 @@ namespace Ryujinx.Graphics.Vic
{ {
class VideoImageComposer class VideoImageComposer
{ {
private NvGpu Gpu; private NvGpu _gpu;
private long ConfigStructAddress; private long _configStructAddress;
private long OutputSurfaceLumaAddress; private long _outputSurfaceLumaAddress;
private long OutputSurfaceChromaUAddress; private long _outputSurfaceChromaUAddress;
private long OutputSurfaceChromaVAddress; private long _outputSurfaceChromaVAddress;
public VideoImageComposer(NvGpu Gpu) public VideoImageComposer(NvGpu gpu)
{ {
this.Gpu = Gpu; this._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: case VideoImageComposerMeth.Execute:
Execute(Vmm, Arguments); Execute(vmm, arguments);
break; break;
case VideoImageComposerMeth.SetConfigStructOffset: case VideoImageComposerMeth.SetConfigStructOffset:
SetConfigStructOffset(Vmm, Arguments); SetConfigStructOffset(vmm, arguments);
break; break;
case VideoImageComposerMeth.SetOutputSurfaceLumaOffset: case VideoImageComposerMeth.SetOutputSurfaceLumaOffset:
SetOutputSurfaceLumaOffset(Vmm, Arguments); SetOutputSurfaceLumaOffset(vmm, arguments);
break; break;
case VideoImageComposerMeth.SetOutputSurfaceChromaUOffset: case VideoImageComposerMeth.SetOutputSurfaceChromaUOffset:
SetOutputSurfaceChromaUOffset(Vmm, Arguments); SetOutputSurfaceChromaUOffset(vmm, arguments);
break; break;
case VideoImageComposerMeth.SetOutputSurfaceChromaVOffset: case VideoImageComposerMeth.SetOutputSurfaceChromaVOffset:
SetOutputSurfaceChromaVOffset(Vmm, Arguments); SetOutputSurfaceChromaVOffset(vmm, arguments);
break; 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 chromaLocHoriz = unpacker.Read(2);
int ChromaLocVert = Unpacker.Read(2); int chromaLocVert = unpacker.Read(2);
int BlockLinearKind = Unpacker.Read(4); int blockLinearKind = unpacker.Read(4);
int BlockLinearHeightLog2 = Unpacker.Read(4); int blockLinearHeightLog2 = unpacker.Read(4);
int Reserved0 = Unpacker.Read(3); int reserved0 = unpacker.Read(3);
int Reserved1 = Unpacker.Read(10); int reserved1 = unpacker.Read(10);
int SurfaceWidthMinus1 = Unpacker.Read(14); int surfaceWidthMinus1 = unpacker.Read(14);
int SurfaceHeightMinus1 = Unpacker.Read(14); int surfaceHeightMinus1 = unpacker.Read(14);
int GobBlockHeight = 1 << BlockLinearHeightLog2; int gobBlockHeight = 1 << blockLinearHeightLog2;
int SurfaceWidth = SurfaceWidthMinus1 + 1; int surfaceWidth = surfaceWidthMinus1 + 1;
int SurfaceHeight = SurfaceHeightMinus1 + 1; int surfaceHeight = surfaceHeightMinus1 + 1;
SurfaceOutputConfig OutputConfig = new SurfaceOutputConfig( SurfaceOutputConfig outputConfig = new SurfaceOutputConfig(
PixelFormat, pixelFormat,
SurfaceWidth, surfaceWidth,
SurfaceHeight, surfaceHeight,
GobBlockHeight, gobBlockHeight,
OutputSurfaceLumaAddress, _outputSurfaceLumaAddress,
OutputSurfaceChromaUAddress, _outputSurfaceChromaUAddress,
OutputSurfaceChromaVAddress); _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;
} }
} }
} }