Skip to content

Instantly share code, notes, and snippets.

@Subv
Created June 8, 2017 19:51
Show Gist options
  • Save Subv/1683fdd48da47695ab5cd3bc10e9bed3 to your computer and use it in GitHub Desktop.
Save Subv/1683fdd48da47695ab5cd3bc10e9bed3 to your computer and use it in GitHub Desktop.
diff --git a/src/video_core/swrasterizer/framebuffer.cpp b/src/video_core/swrasterizer/framebuffer.cpp
index 7de3aac..3f5906a 100644
--- a/src/video_core/swrasterizer/framebuffer.cpp
+++ b/src/video_core/swrasterizer/framebuffer.cpp
@@ -280,17 +280,17 @@ Math::Vec4<u8> EvaluateBlendEquation(const Math::Vec4<u8>& src, const Math::Vec4
// 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());
+ result.r() = std::min(src_result.r(), dst_result.r()) / 255;
+ result.g() = std::min(src_result.g(), dst_result.g()) / 255;
+ result.b() = std::min(src_result.b(), dst_result.b()) / 255;
+ result.a() = std::min(src_result.a(), dst_result.a()) / 255;
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());
+ result.r() = std::max(src_result.r(), dst_result.r()) / 255;
+ result.g() = std::max(src_result.g(), dst_result.g()) / 255;
+ result.b() = std::max(src_result.b(), dst_result.b()) / 255;
+ result.a() = std::max(src_result.a(), dst_result.a()) / 255;
break;
default:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment