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

SWRasterizer: Implemented stencil ops 6 and 7.

IncrementWrap and DecrementWrap, verified with hwtests.
Subv 11 лет назад
Родитель
Сommit
7c1f84a92b
2 измененных файлов с 14 добавлено и 6 удалено
  1. 8 6
      src/video_core/pica.h
  2. 6 0
      src/video_core/rasterizer.cpp

+ 8 - 6
src/video_core/pica.h

@@ -441,12 +441,14 @@ struct Regs {
     };
 
     enum class StencilAction : u32 {
-        Keep      = 0,
-        Zero      = 1,
-        Replace   = 2,
-        Increment = 3,
-        Decrement = 4,
-        Invert    = 5
+        Keep           = 0,
+        Zero           = 1,
+        Replace        = 2,
+        Increment      = 3,
+        Decrement      = 4,
+        Invert         = 5,
+        IncrementWrap  = 6,
+        DecrementWrap  = 7
     };
 
     struct {

+ 6 - 0
src/video_core/rasterizer.cpp

@@ -237,6 +237,12 @@ static u8 PerformStencilAction(Regs::StencilAction action, u8 old_stencil, u8 re
     case Regs::StencilAction::Invert:
         return ~old_stencil;
 
+    case Regs::StencilAction::IncrementWrap:
+        return old_stencil + 1;
+
+    case Regs::StencilAction::DecrementWrap:
+        return old_stencil - 1;
+
     default:
         LOG_CRITICAL(HW_GPU, "Unknown stencil action %x", (int)action);
         UNIMPLEMENTED();