Sfoglia il codice sorgente

Initialize blend registers with default values (#497)

gdkchan 7 anni fa
parent
commit
453543fb88

+ 2 - 2
Ryujinx.Graphics/Gal/GalPipelineState.cs

@@ -24,10 +24,10 @@
         {
             Enabled       = false,
             SeparateAlpha = false,
-            EquationRgb   = 0,
+            EquationRgb   = GalBlendEquation.FuncAdd,
             FuncSrcRgb    = GalBlendFactor.One,
             FuncDstRgb    = GalBlendFactor.Zero,
-            EquationAlpha = 0,
+            EquationAlpha = GalBlendEquation.FuncAdd,
             FuncSrcAlpha  = GalBlendFactor.One,
             FuncDstAlpha  = GalBlendFactor.Zero
         };

+ 10 - 0
Ryujinx.Graphics/NvGpuEngine3d.cs

@@ -69,6 +69,16 @@ namespace Ryujinx.Graphics
             //Ensure that all components are enabled by default.
             //FIXME: Is this correct?
             WriteRegister(NvGpuEngine3dReg.ColorMaskN, 0x1111);
+
+            for (int Index = 0; Index < GalPipelineState.RenderTargetsCount; Index++)
+            {
+                WriteRegister(NvGpuEngine3dReg.IBlendNEquationRgb   + Index * 8, (int)GalBlendEquation.FuncAdd);
+                WriteRegister(NvGpuEngine3dReg.IBlendNFuncSrcRgb    + Index * 8, (int)GalBlendFactor.One);
+                WriteRegister(NvGpuEngine3dReg.IBlendNFuncDstRgb    + Index * 8, (int)GalBlendFactor.Zero);
+                WriteRegister(NvGpuEngine3dReg.IBlendNEquationAlpha + Index * 8, (int)GalBlendEquation.FuncAdd);
+                WriteRegister(NvGpuEngine3dReg.IBlendNFuncSrcAlpha  + Index * 8, (int)GalBlendFactor.One);
+                WriteRegister(NvGpuEngine3dReg.IBlendNFuncDstAlpha  + Index * 8, (int)GalBlendFactor.Zero);
+            }
         }
 
         public void CallMethod(NvGpuVmm Vmm, NvGpuPBEntry PBEntry)