diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-01-30 04:25:48 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2017-02-13 03:13:04 +0100 |
commit | 426fda1d524b17acd10d962a03af872a85342eca (patch) | |
tree | c9ad03dd5495a9a83b30209492720e979e4fbeb9 /src/video_core/swrasterizer/rasterizer.cpp | |
parent | SWRasterizer: Move texturing functions to their own file (diff) | |
download | yuzu-426fda1d524b17acd10d962a03af872a85342eca.tar yuzu-426fda1d524b17acd10d962a03af872a85342eca.tar.gz yuzu-426fda1d524b17acd10d962a03af872a85342eca.tar.bz2 yuzu-426fda1d524b17acd10d962a03af872a85342eca.tar.lz yuzu-426fda1d524b17acd10d962a03af872a85342eca.tar.xz yuzu-426fda1d524b17acd10d962a03af872a85342eca.tar.zst yuzu-426fda1d524b17acd10d962a03af872a85342eca.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/swrasterizer/rasterizer.cpp | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp index 0fd842abe..7557fcb89 100644 --- a/src/video_core/swrasterizer/rasterizer.cpp +++ b/src/video_core/swrasterizer/rasterizer.cpp @@ -31,106 +31,6 @@ namespace Pica { namespace Rasterizer { -static Math::Vec4<u8> EvaluateBlendEquation(const Math::Vec4<u8>& src, - const Math::Vec4<u8>& srcfactor, - const Math::Vec4<u8>& dest, - const Math::Vec4<u8>& destfactor, - FramebufferRegs::BlendEquation equation) { - Math::Vec4<int> result; - - auto src_result = (src * srcfactor).Cast<int>(); - auto dst_result = (dest * destfactor).Cast<int>(); - - switch (equation) { - case FramebufferRegs::BlendEquation::Add: - result = (src_result + dst_result) / 255; - break; - - case FramebufferRegs::BlendEquation::Subtract: - result = (src_result - dst_result) / 255; - break; - - case FramebufferRegs::BlendEquation::ReverseSubtract: - result = (dst_result - src_result) / 255; - break; - - // TODO: How do these two actually work? OpenGL doesn't include the blend factors in the - // min/max computations, but is this what the 3DS actually does? - case FramebufferRegs::BlendEquation::Min: - result.r() = std::min(src.r(), dest.r()); - result.g() = std::min(src.g(), dest.g()); - result.b() = std::min(src.b(), dest.b()); - result.a() = std::min(src.a(), dest.a()); - break; - - case FramebufferRegs::BlendEquation::Max: - result.r() = std::max(src.r(), dest.r()); - result.g() = std::max(src.g(), dest.g()); - result.b() = std::max(src.b(), dest.b()); - result.a() = std::max(src.a(), dest.a()); - break; - - default: - LOG_CRITICAL(HW_GPU, "Unknown RGB blend equation %x", equation); - UNIMPLEMENTED(); - } - - return Math::Vec4<u8>(MathUtil::Clamp(result.r(), 0, 255), MathUtil::Clamp(result.g(), 0, 255), - MathUtil::Clamp(result.b(), 0, 255), MathUtil::Clamp(result.a(), 0, 255)); -}; - -static u8 LogicOp(u8 src, u8 dest, FramebufferRegs::LogicOp op) { - switch (op) { - case FramebufferRegs::LogicOp::Clear: - return 0; - - case FramebufferRegs::LogicOp::And: - return src & dest; - - case FramebufferRegs::LogicOp::AndReverse: - return src & ~dest; - - case FramebufferRegs::LogicOp::Copy: - return src; - - case FramebufferRegs::LogicOp::Set: - return 255; - - case FramebufferRegs::LogicOp::CopyInverted: - return ~src; - - case FramebufferRegs::LogicOp::NoOp: - return dest; - - case FramebufferRegs::LogicOp::Invert: - return ~dest; - - case FramebufferRegs::LogicOp::Nand: - return ~(src & dest); - - case FramebufferRegs::LogicOp::Or: - return src | dest; - - case FramebufferRegs::LogicOp::Nor: - return ~(src | dest); - - case FramebufferRegs::LogicOp::Xor: - return src ^ dest; - - case FramebufferRegs::LogicOp::Equiv: - return ~(src ^ dest); - - case FramebufferRegs::LogicOp::AndInverted: - return ~src & dest; - - case FramebufferRegs::LogicOp::OrReverse: - return src | ~dest; - - case FramebufferRegs::LogicOp::OrInverted: - return ~src | dest; - } -}; - // NOTE: Assuming that rasterizer coordinates are 12.4 fixed-point values struct Fix12P4 { Fix12P4() {} |