From 21a6866defa5ad97de6c3ddcca5a745a8b06f9a2 Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Tue, 11 Jan 2022 19:57:21 +0530 Subject: [PATCH] Fix Maxwell3D Blend Enum Conversion Bugs The `OneMinusSourceAlpha` blending factor was converted to `eOneMinusSrcColor` rather than `eOneMinusSrcAlpha` leading to incorrect blending behavior in certain titles. A similar issue with the order of `MinimumGL`/`MaximumGL` and `SubtractGL`/`ReverseSubtractGL` being the opposite of what it should've been, both of these issues have been fixed. --- .../main/cpp/skyline/gpu/interconnect/graphics_context.h | 2 +- .../main/cpp/skyline/soc/gm20b/engines/maxwell/types.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h b/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h index 13ecbae8..a999e7a5 100644 --- a/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h +++ b/app/src/main/cpp/skyline/gpu/interconnect/graphics_context.h @@ -1210,7 +1210,7 @@ namespace skyline::gpu::interconnect { case maxwell3d::BlendFactor::OneMinusSourceAlpha: case maxwell3d::BlendFactor::OneMinusSourceAlphaGL: - return vk::BlendFactor::eOneMinusSrcColor; + return vk::BlendFactor::eOneMinusSrcAlpha; case maxwell3d::BlendFactor::DestAlpha: case maxwell3d::BlendFactor::DestAlphaGL: diff --git a/app/src/main/cpp/skyline/soc/gm20b/engines/maxwell/types.h b/app/src/main/cpp/skyline/soc/gm20b/engines/maxwell/types.h index 23f48940..23de06e5 100644 --- a/app/src/main/cpp/skyline/soc/gm20b/engines/maxwell/types.h +++ b/app/src/main/cpp/skyline/soc/gm20b/engines/maxwell/types.h @@ -393,10 +393,10 @@ namespace skyline::soc::gm20b::engine::maxwell3d::type { Maximum = 5, AddGL = 0x8006, - SubtractGL = 0x8007, - ReverseSubtractGL = 0x8008, - MinimumGL = 0x800A, - MaximumGL = 0x800B, + MinimumGL = 0x8007, + MaximumGL = 0x8008, + SubtractGL = 0x800A, + ReverseSubtractGL = 0x800B, }; enum class BlendFactor : u32 {