From f17c2c44d0fe7aa7d9edc670c72f40f225bdb8a0 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 9 May 2020 14:38:02 +1000 Subject: [PATCH] GPU/HW: Fix red bleeding when writing VRAM with mask bit set Fixes menu screen in Twisted Metal 4. --- src/core/gpu_hw_d3d11.cpp | 2 +- src/core/gpu_hw_opengl.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/gpu_hw_d3d11.cpp b/src/core/gpu_hw_d3d11.cpp index 0afebcf34..7df3c2929 100644 --- a/src/core/gpu_hw_d3d11.cpp +++ b/src/core/gpu_hw_d3d11.cpp @@ -731,7 +731,7 @@ void GPU_HW_D3D11::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* d width, height, map_result.index_aligned, - m_GPUSTAT.set_mask_while_drawing ? 0xFFu : 0x00, + m_GPUSTAT.set_mask_while_drawing ? 0x8000u : 0x00, GetCurrentNormalizedBatchVertexDepthID()}; m_context->OMSetDepthStencilState( m_GPUSTAT.check_mask_before_draw ? m_depth_test_less_state.Get() : m_depth_test_always_state.Get(), 0); diff --git a/src/core/gpu_hw_opengl.cpp b/src/core/gpu_hw_opengl.cpp index 38557139a..6498e2da8 100644 --- a/src/core/gpu_hw_opengl.cpp +++ b/src/core/gpu_hw_opengl.cpp @@ -782,7 +782,7 @@ void GPU_HW_OpenGL::UpdateVRAM(u32 x, u32 y, u32 width, u32 height, const void* width, height, map_result.index_aligned, - m_GPUSTAT.set_mask_while_drawing ? 0xFFu : 0x00, + m_GPUSTAT.set_mask_while_drawing ? 0x8000u : 0x00, GetCurrentNormalizedBatchVertexDepthID()}; UploadUniformBuffer(&uniforms, sizeof(uniforms));