Просмотр исходного кода

Merge branch 'master' into ICommonStateGetter

Lordmau5 7 лет назад
Родитель
Сommit
e6f6c6ad57

+ 1 - 0
ChocolArm64/AOpCodeTable.cs

@@ -206,6 +206,7 @@ namespace ChocolArm64
             SetA64("0>101110000xxxxx0<xxx0xxxxxxxxxx", AInstEmit.Ext_V,         typeof(AOpCodeSimdExt));
             SetA64("011111101x1xxxxx110101xxxxxxxxxx", AInstEmit.Fabd_S,        typeof(AOpCodeSimdReg));
             SetA64("000111100x100000110000xxxxxxxxxx", AInstEmit.Fabs_S,        typeof(AOpCodeSimd));
+            SetA64("0>0011101<100000111110xxxxxxxxxx", AInstEmit.Fabs_V,        typeof(AOpCodeSimd));
             SetA64("000111100x1xxxxx001010xxxxxxxxxx", AInstEmit.Fadd_S,        typeof(AOpCodeSimdReg));
             SetA64("0>0011100<1xxxxx110101xxxxxxxxxx", AInstEmit.Fadd_V,        typeof(AOpCodeSimdReg));
             SetA64("0>1011100<1xxxxx110101xxxxxxxxxx", AInstEmit.Faddp_V,       typeof(AOpCodeSimdReg));

+ 8 - 0
ChocolArm64/Instruction/AInstEmitSimdArithmetic.cs

@@ -309,6 +309,14 @@ namespace ChocolArm64.Instruction
             });
         }
 
+        public static void Fabs_V(AILEmitterCtx Context)
+        {
+            EmitVectorUnaryOpF(Context, () =>
+            {
+                EmitUnaryMathCall(Context, nameof(Math.Abs));
+            });
+        }
+
         public static void Fadd_S(AILEmitterCtx Context)
         {
             if (AOptimizations.UseSse2)

+ 1 - 0
Ryujinx.Graphics/Gal/GalTextureFormat.cs

@@ -10,6 +10,7 @@ namespace Ryujinx.Graphics.Gal
         B5G6R5       = 0x15,
         BC7U         = 0x17,
         G8R8         = 0x18,
+        R16          = 0x1b,
         R8           = 0x1d,
         BC1          = 0x24,
         BC2          = 0x25,

+ 1 - 0
Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs

@@ -66,6 +66,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
                 case GalTextureFormat.A1B5G5R5:     return (PixelFormat.Rgba, PixelType.UnsignedShort5551);
                 case GalTextureFormat.B5G6R5:       return (PixelFormat.Rgb,  PixelType.UnsignedShort565);
                 case GalTextureFormat.G8R8:         return (PixelFormat.Rg,   PixelType.UnsignedByte);
+                case GalTextureFormat.R16:          return (PixelFormat.Red,  PixelType.HalfFloat);
                 case GalTextureFormat.R8:           return (PixelFormat.Red,  PixelType.UnsignedByte);
             }
 

+ 2 - 1
Ryujinx.Graphics/Gal/Shader/GlslDecl.cs

@@ -159,7 +159,8 @@ namespace Ryujinx.Graphics.Gal.Shader
                 case ShaderIrOperAbuf Abuf:
                 {
                     //This is a built-in input variable.
-                    if (Abuf.Offs == VertexIdAttr)
+                    if (Abuf.Offs == VertexIdAttr ||
+                        Abuf.Offs == InstanceIdAttr)
                     {
                         break;
                     }

+ 2 - 1
Ryujinx.Graphics/Gal/Shader/GlslDecompiler.cs

@@ -975,7 +975,8 @@ namespace Ryujinx.Graphics.Gal.Shader
             switch (Node)
             {
                 case ShaderIrOperAbuf Abuf:
-                    return Abuf.Offs == GlslDecl.VertexIdAttr
+                    return Abuf.Offs == GlslDecl.VertexIdAttr ||
+                           Abuf.Offs == GlslDecl.InstanceIdAttr
                         ? OperType.I32
                         : OperType.F32;
 

+ 1 - 1
Ryujinx.Graphics/Gal/Shader/ShaderDecodeHelper.cs

@@ -14,7 +14,7 @@ namespace Ryujinx.Graphics.Gal.Shader
 
             for (int Index = 0; Index <= Size; Index++)
             {
-                Opers[Index] = new ShaderIrOperAbuf(Abuf, Reg);
+                Opers[Index] = new ShaderIrOperAbuf(Abuf + Index * 4, Reg);
             }
 
             return Opers;

+ 1 - 0
Ryujinx.HLE/Gpu/TextureHelper.cs

@@ -33,6 +33,7 @@ namespace Ryujinx.HLE.Gpu
                 case GalTextureFormat.A1B5G5R5:     return Texture.Width * Texture.Height * 2;
                 case GalTextureFormat.B5G6R5:       return Texture.Width * Texture.Height * 2;
                 case GalTextureFormat.G8R8:         return Texture.Width * Texture.Height * 2;
+                case GalTextureFormat.R16:          return Texture.Width * Texture.Height * 2;
                 case GalTextureFormat.R8:           return Texture.Width * Texture.Height;
 
                 case GalTextureFormat.BC1:

+ 1 - 0
Ryujinx.HLE/Gpu/TextureReader.cs

@@ -17,6 +17,7 @@ namespace Ryujinx.HLE.Gpu
                 case GalTextureFormat.A1B5G5R5:     return Read5551    (Memory, Texture);
                 case GalTextureFormat.B5G6R5:       return Read565     (Memory, Texture);
                 case GalTextureFormat.G8R8:         return Read2Bpp    (Memory, Texture);
+                case GalTextureFormat.R16:          return Read2Bpp    (Memory, Texture);
                 case GalTextureFormat.R8:           return Read1Bpp    (Memory, Texture);
                 case GalTextureFormat.BC7U:         return Read16Bpt4x4(Memory, Texture);
                 case GalTextureFormat.BC1:          return Read8Bpt4x4 (Memory, Texture);

+ 2 - 4
Ryujinx.HLE/Hid/Hid.cs

@@ -130,9 +130,7 @@ namespace Ryujinx.HLE.Input
         {
             long BaseControllerOffset = Position + HidControllersOffset + 8 * HidControllerSize;
 
-            HidControllerType Type =
-                HidControllerType.ControllerType_Handheld |
-                HidControllerType.ControllerType_JoyconPair;
+            HidControllerType Type = HidControllerType.ControllerType_Handheld;
 
             bool IsHalf = false;
 
@@ -276,4 +274,4 @@ namespace Ryujinx.HLE.Input
             return (long)((ulong)Environment.TickCount * 19_200);
         }
     }
-}
+}