From 1a543723ab57a85f15013831e6ed598fc62de2a1 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 20 Nov 2018 19:57:20 -0500 Subject: maxwell_3d: Initialize rasterizer color mask registers as enabled. - Fixes rendering regression with Sonic Mania. --- src/video_core/engines/maxwell_3d.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/video_core/engines/maxwell_3d.cpp') diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index a04e00ecb..2bc534be3 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -69,6 +69,15 @@ void Maxwell3D::InitializeRegisterDefaults() { // TODO(Rodrigo): Most games do not set a point size. I think this is a case of a // register carrying a default value. Assume it's OpenGL's default (1). regs.point_size = 1.0f; + + // TODO(bunnei): Some games do not initialize the color masks (e.g. Sonic Mania). Assuming a + // default of enabled fixes rendering here. + for (std::size_t color_mask = 0; color_mask < Regs::NumRenderTargets; color_mask++) { + regs.color_mask[color_mask].R.Assign(1); + regs.color_mask[color_mask].G.Assign(1); + regs.color_mask[color_mask].B.Assign(1); + regs.color_mask[color_mask].A.Assign(1); + } } void Maxwell3D::CallMacroMethod(u32 method, std::vector parameters) { -- cgit v1.2.3