summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Subv2015-08-21 11:01:42 -0500
committerGravatar Subv2015-08-21 11:01:42 -0500
commit7c1f84a92b9727765a755c312e90b09b0cf6ed1d (patch)
treead6a2b0a93303caf6c6823a52a676931498b29ce /src
parentHWRasterizer: Implemented stencil op 1 (GL_ZERO) (diff)
downloadyuzu-7c1f84a92b9727765a755c312e90b09b0cf6ed1d.tar.gz
yuzu-7c1f84a92b9727765a755c312e90b09b0cf6ed1d.tar.xz
yuzu-7c1f84a92b9727765a755c312e90b09b0cf6ed1d.zip
SWRasterizer: Implemented stencil ops 6 and 7.
IncrementWrap and DecrementWrap, verified with hwtests.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/pica.h14
-rw-r--r--src/video_core/rasterizer.cpp6
2 files changed, 14 insertions, 6 deletions
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index a47dddd75..87cf705e7 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -441,12 +441,14 @@ struct Regs {
441 }; 441 };
442 442
443 enum class StencilAction : u32 { 443 enum class StencilAction : u32 {
444 Keep = 0, 444 Keep = 0,
445 Zero = 1, 445 Zero = 1,
446 Replace = 2, 446 Replace = 2,
447 Increment = 3, 447 Increment = 3,
448 Decrement = 4, 448 Decrement = 4,
449 Invert = 5 449 Invert = 5,
450 IncrementWrap = 6,
451 DecrementWrap = 7
450 }; 452 };
451 453
452 struct { 454 struct {
diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp
index 25911e0a2..b6c0e1bff 100644
--- a/src/video_core/rasterizer.cpp
+++ b/src/video_core/rasterizer.cpp
@@ -237,6 +237,12 @@ static u8 PerformStencilAction(Regs::StencilAction action, u8 old_stencil, u8 re
237 case Regs::StencilAction::Invert: 237 case Regs::StencilAction::Invert:
238 return ~old_stencil; 238 return ~old_stencil;
239 239
240 case Regs::StencilAction::IncrementWrap:
241 return old_stencil + 1;
242
243 case Regs::StencilAction::DecrementWrap:
244 return old_stencil - 1;
245
240 default: 246 default:
241 LOG_CRITICAL(HW_GPU, "Unknown stencil action %x", (int)action); 247 LOG_CRITICAL(HW_GPU, "Unknown stencil action %x", (int)action);
242 UNIMPLEMENTED(); 248 UNIMPLEMENTED();