diff options
| author | Alex Barney <thealexbarney@gmail.com> | 2019-07-01 21:39:22 -0500 |
|---|---|---|
| committer | Ac_K <Acoustik666@gmail.com> | 2019-07-02 04:39:22 +0200 |
| commit | b2b736abc2569ab5d8199da666aef8d8394844a0 (patch) | |
| tree | 88bcc2ae4fb0d4161c95df2cd7edb12388de922a /Ryujinx.Graphics/Graphics3d | |
| parent | 10c74182babaf8cf6bedaeffd64c3109df4ea816 (diff) | |
Misc cleanup (#708)
* Fix typos
* Remove unneeded using statements
* Enforce var style more
* Remove redundant qualifiers
* Fix some indentation
* Disable naming warnings on files with external enum names
* Fix build
* Mass find & replace for comments with no spacing
* Standardize todo capitalization and for/if spacing
Diffstat (limited to 'Ryujinx.Graphics/Graphics3d')
| -rw-r--r-- | Ryujinx.Graphics/Graphics3d/MacroInterpreter.cs | 26 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Graphics3d/NvGpuEngine2d.cs | 8 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Graphics3d/NvGpuEngine3d.cs | 68 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Graphics3d/NvGpuEngineM2mf.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Graphics3d/NvGpuEngineP2mf.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Graphics3d/NvGpuFifo.cs | 4 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Graphics3d/Texture/AstcDecoder.cs | 4 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Graphics3d/Texture/AstcPixel.cs | 2 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Graphics3d/Texture/ImageUtils.cs | 4 |
9 files changed, 60 insertions, 60 deletions
diff --git a/Ryujinx.Graphics/Graphics3d/MacroInterpreter.cs b/Ryujinx.Graphics/Graphics3d/MacroInterpreter.cs index 84576213..9a6206fa 100644 --- a/Ryujinx.Graphics/Graphics3d/MacroInterpreter.cs +++ b/Ryujinx.Graphics/Graphics3d/MacroInterpreter.cs @@ -82,8 +82,8 @@ namespace Ryujinx.Graphics.Graphics3d while (Step(vmm, mme)); - //Due to the delay slot, we still need to execute - //one more instruction before we actually exit. + // Due to the delay slot, we still need to execute + // one more instruction before we actually exit. Step(vmm, mme); } @@ -108,14 +108,14 @@ namespace Ryujinx.Graphics.Graphics3d if ((_opCode & 7) < 7) { - //Operation produces a value. + // Operation produces a value. AssignmentOperation asgOp = (AssignmentOperation)((_opCode >> 4) & 7); int result = GetAluResult(); switch (asgOp) { - //Fetch parameter and ignore result. + // Fetch parameter and ignore result. case AssignmentOperation.IgnoreAndFetch: { SetDstGpr(FetchParam()); @@ -123,7 +123,7 @@ namespace Ryujinx.Graphics.Graphics3d break; } - //Move result. + // Move result. case AssignmentOperation.Move: { SetDstGpr(result); @@ -131,7 +131,7 @@ namespace Ryujinx.Graphics.Graphics3d break; } - //Move result and use as Method Address. + // Move result and use as Method Address. case AssignmentOperation.MoveAndSetMaddr: { SetDstGpr(result); @@ -141,7 +141,7 @@ namespace Ryujinx.Graphics.Graphics3d break; } - //Fetch parameter and send result. + // Fetch parameter and send result. case AssignmentOperation.FetchAndSend: { SetDstGpr(FetchParam()); @@ -151,7 +151,7 @@ namespace Ryujinx.Graphics.Graphics3d break; } - //Move and send result. + // Move and send result. case AssignmentOperation.MoveAndSend: { SetDstGpr(result); @@ -161,7 +161,7 @@ namespace Ryujinx.Graphics.Graphics3d break; } - //Fetch parameter and use result as Method Address. + // Fetch parameter and use result as Method Address. case AssignmentOperation.FetchAndSetMaddr: { SetDstGpr(FetchParam()); @@ -171,7 +171,7 @@ namespace Ryujinx.Graphics.Graphics3d break; } - //Move result and use as Method Address, then fetch and send paramter. + // Move result and use as Method Address, then fetch and send parameter. case AssignmentOperation.MoveAndSetMaddrThenFetchAndSend: { SetDstGpr(result); @@ -183,7 +183,7 @@ namespace Ryujinx.Graphics.Graphics3d break; } - //Move result and use as Method Address, then send bits 17:12 of result. + // Move result and use as Method Address, then send bits 17:12 of result. case AssignmentOperation.MoveAndSetMaddrThenSendHigh: { SetDstGpr(result); @@ -198,7 +198,7 @@ namespace Ryujinx.Graphics.Graphics3d } else { - //Branch. + // Branch. bool onNotZero = ((_opCode >> 4) & 1) != 0; bool taken = onNotZero @@ -355,7 +355,7 @@ namespace Ryujinx.Graphics.Graphics3d private int GetImm() { - //Note: The immediate is signed, the sign-extension is intended here. + // Note: The immediate is signed, the sign-extension is intended here. return _opCode >> 14; } diff --git a/Ryujinx.Graphics/Graphics3d/NvGpuEngine2d.cs b/Ryujinx.Graphics/Graphics3d/NvGpuEngine2d.cs index d42dca28..b6dae2a3 100644 --- a/Ryujinx.Graphics/Graphics3d/NvGpuEngine2d.cs +++ b/Ryujinx.Graphics/Graphics3d/NvGpuEngine2d.cs @@ -204,10 +204,10 @@ namespace Ryujinx.Graphics.Graphics3d dstBlitX + dstBlitW, dstBlitY + dstBlitH); - //Do a guest side copy aswell. This is necessary when - //the texture is modified by the guest, however it doesn't - //work when resources that the gpu can write to are copied, - //like framebuffers. + // Do a guest side copy as well. This is necessary when + // the texture is modified by the guest, however it doesn't + // work when resources that the gpu can write to are copied, + // like framebuffers. // FIXME: SUPPORT MULTILAYER CORRECTLY HERE (this will cause weird stuffs on the first layer) ImageUtils.CopyTexture( diff --git a/Ryujinx.Graphics/Graphics3d/NvGpuEngine3d.cs b/Ryujinx.Graphics/Graphics3d/NvGpuEngine3d.cs index 29b6cc5d..e475a964 100644 --- a/Ryujinx.Graphics/Graphics3d/NvGpuEngine3d.cs +++ b/Ryujinx.Graphics/Graphics3d/NvGpuEngine3d.cs @@ -67,8 +67,8 @@ namespace Ryujinx.Graphics.Graphics3d _constBuffers[index] = new ConstBuffer[18]; } - //Ensure that all components are enabled by default. - //FIXME: Is this correct? + // Ensure that all components are enabled by default. + // FIXME: Is this correct? WriteRegister(NvGpuEngine3dReg.ColorMaskN, 0x1111); WriteRegister(NvGpuEngine3dReg.FrameBufferSrgb, 1); @@ -333,12 +333,12 @@ namespace Ryujinx.Graphics.Graphics3d if (vpAEnable) { - //Note: The maxwell supports 2 vertex programs, usually - //only VP B is used, but in some cases VP A is also used. - //In this case, it seems to function as an extra vertex - //shader stage. - //The graphics abstraction layer has a special overload for this - //case, which should merge the two shaders into one vertex shader. + // Note: The maxwell supports 2 vertex programs, usually + // only VP B is used, but in some cases VP A is also used. + // In this case, it seems to function as an extra vertex + // shader stage. + // The graphics abstraction layer has a special overload for this + // case, which should merge the two shaders into one vertex shader. int vpAOffset = ReadRegister(NvGpuEngine3dReg.ShaderNOffset); int vpBOffset = ReadRegister(NvGpuEngine3dReg.ShaderNOffset + 0x10); @@ -360,7 +360,7 @@ namespace Ryujinx.Graphics.Graphics3d int control = ReadRegister(NvGpuEngine3dReg.ShaderNControl + index * 0x10); int offset = ReadRegister(NvGpuEngine3dReg.ShaderNOffset + index * 0x10); - //Note: Vertex Program (B) is always enabled. + // Note: Vertex Program (B) is always enabled. bool enable = (control & 1) != 0 || index == 1; if (!enable) @@ -405,7 +405,7 @@ namespace Ryujinx.Graphics.Graphics3d GalFrontFace frontFace = (GalFrontFace)ReadRegister(NvGpuEngine3dReg.FrontFace); - //Flipping breaks facing. Flipping front facing too fixes it + // Flipping breaks facing. Flipping front facing too fixes it if (signX != signY) { switch (frontFace) @@ -574,8 +574,8 @@ namespace Ryujinx.Graphics.Graphics3d } else { - //It seems that even when independent blend is disabled, the first IBlend enable - //register is still set to indicate whenever blend is enabled or not (?). + // It seems that even when independent blend is disabled, the first IBlend enable + // register is still set to indicate whenever blend is enabled or not (?). state.Blends[index].Enabled = ReadRegisterBool(NvGpuEngine3dReg.IBlendNEnable); if (state.Blends[index].Enabled) @@ -632,8 +632,8 @@ namespace Ryujinx.Graphics.Graphics3d private void SetRenderTargets() { - //Commercial games do not seem to - //bool SeparateFragData = ReadRegisterBool(NvGpuEngine3dReg.RTSeparateFragData); + // Commercial games do not seem to + // bool SeparateFragData = ReadRegisterBool(NvGpuEngine3dReg.RTSeparateFragData); uint control = (uint)(ReadRegister(NvGpuEngine3dReg.RtControl)); @@ -711,8 +711,8 @@ namespace Ryujinx.Graphics.Graphics3d { if (textureHandle == 0) { - //FIXME: Some games like puyo puyo will use handles with the value 0. - //This is a bug, most likely caused by sync issues. + // FIXME: Some games like puyo puyo will use handles with the value 0. + // This is a bug, most likely caused by sync issues. return (0, default(GalImage), default(GalTextureSampler)); } @@ -751,7 +751,7 @@ namespace Ryujinx.Graphics.Graphics3d { Profile.End(Profiles.GPU.Engine3d.UploadTexture); - //FIXME: Shouldn't ignore invalid addresses. + // FIXME: Shouldn't ignore invalid addresses. return (0, default(GalImage), default(GalTextureSampler)); } @@ -910,8 +910,8 @@ namespace Ryujinx.Graphics.Graphics3d // Check vertex array is enabled to avoid out of bounds exception when reading bytes bool enable = (ReadRegister(NvGpuEngine3dReg.VertexArrayNControl + arrayIndex * 4) & 0x1000) != 0; - //Note: 16 is the maximum size of an attribute, - //having a component size of 32-bits with 4 elements (a vec4). + // Note: 16 is the maximum size of an attribute, + // having a component size of 32-bits with 4 elements (a vec4). if (enable) { byte[] data = vmm.ReadBytes(vbPosition + offset, 16); @@ -954,7 +954,7 @@ namespace Ryujinx.Graphics.Graphics3d if (vbPosition > vbEndPos) { - //Instance is invalid, ignore the draw call + // Instance is invalid, ignore the draw call continue; } @@ -1057,14 +1057,14 @@ namespace Ryujinx.Graphics.Graphics3d long iboKey = vmm.GetPhysicalAddress(indexPosition); - //Quad primitive types were deprecated on OpenGL 3.x, - //they are converted to a triangles index buffer on IB creation, - //so we should use the triangles type here too. + // Quad primitive types were deprecated on OpenGL 3.x, + // they are converted to a triangles index buffer on IB creation, + // so we should use the triangles type here too. if (primType == GalPrimitiveType.Quads || primType == GalPrimitiveType.QuadStrip) { - //Note: We assume that index first points to the first - //vertex of a quad, if it points to the middle of a - //quad (First % 4 != 0 for Quads) then it will not work properly. + // Note: We assume that index first points to the first + // vertex of a quad, if it points to the middle of a + // quad (First % 4 != 0 for Quads) then it will not work properly. if (primType == GalPrimitiveType.Quads) { indexFirst = QuadHelper.ConvertSizeQuadsToTris(indexFirst); @@ -1084,14 +1084,14 @@ namespace Ryujinx.Graphics.Graphics3d int vertexFirst = ReadRegister(NvGpuEngine3dReg.VertexArrayFirst); int vertexCount = ReadRegister(NvGpuEngine3dReg.VertexArrayCount); - //Quad primitive types were deprecated on OpenGL 3.x, - //they are converted to a triangles index buffer on IB creation, - //so we should use the triangles type here too. + // Quad primitive types were deprecated on OpenGL 3.x, + // they are converted to a triangles index buffer on IB creation, + // so we should use the triangles type here too. if (primType == GalPrimitiveType.Quads || primType == GalPrimitiveType.QuadStrip) { - //Note: We assume that index first points to the first - //vertex of a quad, if it points to the middle of a - //quad (First % 4 != 0 for Quads) then it will not work properly. + // Note: We assume that index first points to the first + // vertex of a quad, if it points to the middle of a + // quad (First % 4 != 0 for Quads) then it will not work properly. if (primType == GalPrimitiveType.Quads) { vertexFirst = QuadHelper.ConvertSizeQuadsToTris(vertexFirst); @@ -1111,7 +1111,7 @@ namespace Ryujinx.Graphics.Graphics3d // Reset pipeline for host OpenGL calls _gpu.Renderer.Pipeline.Unbind(state); - //Is the GPU really clearing those registers after draw? + // Is the GPU really clearing those registers after draw? WriteRegister(NvGpuEngine3dReg.IndexBatchFirst, 0); WriteRegister(NvGpuEngine3dReg.IndexBatchCount, 0); } @@ -1140,7 +1140,7 @@ namespace Ryujinx.Graphics.Graphics3d case QueryMode.WriteCounterAndTimestamp: { - //TODO: Implement counters. + // TODO: Implement counters. long counter = 1; long timestamp = PerformanceCounter.ElapsedMilliseconds; diff --git a/Ryujinx.Graphics/Graphics3d/NvGpuEngineM2mf.cs b/Ryujinx.Graphics/Graphics3d/NvGpuEngineM2mf.cs index 172c919b..fca8ae22 100644 --- a/Ryujinx.Graphics/Graphics3d/NvGpuEngineM2mf.cs +++ b/Ryujinx.Graphics/Graphics3d/NvGpuEngineM2mf.cs @@ -56,7 +56,7 @@ namespace Ryujinx.Graphics.Graphics3d { Profile.Begin(Profiles.GPU.EngineM2mf.Execute); - //TODO: Some registers and copy modes are still not implemented. + // TODO: Some registers and copy modes are still not implemented. int control = methCall.Argument; bool srcLinear = ((control >> 7) & 1) != 0; diff --git a/Ryujinx.Graphics/Graphics3d/NvGpuEngineP2mf.cs b/Ryujinx.Graphics/Graphics3d/NvGpuEngineP2mf.cs index 83ad0e70..2b2c7b5f 100644 --- a/Ryujinx.Graphics/Graphics3d/NvGpuEngineP2mf.cs +++ b/Ryujinx.Graphics/Graphics3d/NvGpuEngineP2mf.cs @@ -73,7 +73,7 @@ namespace Ryujinx.Graphics.Graphics3d { Profile.Begin(Profiles.GPU.EngineP2mf.Execute); - //TODO: Some registers and copy modes are still not implemented. + // TODO: Some registers and copy modes are still not implemented. int control = methCall.Argument; long dstAddress = MakeInt64From2xInt32(NvGpuEngineP2mfReg.DstAddress); diff --git a/Ryujinx.Graphics/Graphics3d/NvGpuFifo.cs b/Ryujinx.Graphics/Graphics3d/NvGpuFifo.cs index ae96a4f5..23bfd0b3 100644 --- a/Ryujinx.Graphics/Graphics3d/NvGpuFifo.cs +++ b/Ryujinx.Graphics/Graphics3d/NvGpuFifo.cs @@ -7,8 +7,8 @@ namespace Ryujinx.Graphics.Graphics3d private const int MacrosCount = 0x80; private const int MacroIndexMask = MacrosCount - 1; - //Note: The size of the macro memory is unknown, we just make - //a guess here and use 256kb as the size. Increase if needed. + // Note: The size of the macro memory is unknown, we just make + // a guess here and use 256kb as the size. Increase if needed. private const int MmeWords = 256 * 256; private NvGpu _gpu; diff --git a/Ryujinx.Graphics/Graphics3d/Texture/AstcDecoder.cs b/Ryujinx.Graphics/Graphics3d/Texture/AstcDecoder.cs index 99b166f3..3e68be7d 100644 --- a/Ryujinx.Graphics/Graphics3d/Texture/AstcDecoder.cs +++ b/Ryujinx.Graphics/Graphics3d/Texture/AstcDecoder.cs @@ -11,7 +11,7 @@ namespace Ryujinx.Graphics.Texture public AstcDecoderException(string exMsg) : base(exMsg) { } } - //https://github.com/GammaUNC/FasTC/blob/master/ASTCEncoder/src/Decompressor.cpp + // https://github.com/GammaUNC/FasTC/blob/master/ASTCEncoder/src/Decompressor.cpp public static class AstcDecoder { struct TexelWeightParams @@ -1356,7 +1356,7 @@ namespace Ryujinx.Graphics.Texture } default: - //Don't know this layout... + // Don't know this layout... texelParams.Error = true; break; } diff --git a/Ryujinx.Graphics/Graphics3d/Texture/AstcPixel.cs b/Ryujinx.Graphics/Graphics3d/Texture/AstcPixel.cs index cd30acca..2f73c62b 100644 --- a/Ryujinx.Graphics/Graphics3d/Texture/AstcPixel.cs +++ b/Ryujinx.Graphics/Graphics3d/Texture/AstcPixel.cs @@ -65,7 +65,7 @@ namespace Ryujinx.Graphics.Texture public void ChangeBitDepth(byte[] depth) { - for(int i = 0; i< 4; i++) + for (int i = 0; i< 4; i++) { int value = ChangeBitDepth(GetComponent(i), _bitDepth[i], depth[i]); diff --git a/Ryujinx.Graphics/Graphics3d/Texture/ImageUtils.cs b/Ryujinx.Graphics/Graphics3d/Texture/ImageUtils.cs index bd9b4327..2e78cf14 100644 --- a/Ryujinx.Graphics/Graphics3d/Texture/ImageUtils.cs +++ b/Ryujinx.Graphics/Graphics3d/Texture/ImageUtils.cs @@ -67,7 +67,7 @@ namespace Ryujinx.Graphics.Texture { GalTextureFormat.D32Fx24S8, GalImageFormat.D32S8 | Float }, { GalTextureFormat.D16, GalImageFormat.D16 | Unorm }, - //Compressed formats + // Compressed formats { GalTextureFormat.BptcSfloat, GalImageFormat.BptcSfloat | Float }, { GalTextureFormat.BptcUfloat, GalImageFormat.BptcUfloat | Float }, { GalTextureFormat.BptcUnorm, GalImageFormat.BptcUnorm | Unorm | Srgb }, @@ -248,7 +248,7 @@ namespace Ryujinx.Graphics.Texture int bytesPerPixel = desc.BytesPerPixel; - //Note: Each row of the texture needs to be aligned to 4 bytes. + // Note: Each row of the texture needs to be aligned to 4 bytes. int pitch = (width * bytesPerPixel + 3) & ~3; |
