diff --git a/src/core/gpu_hw.h b/src/core/gpu_hw.h index 2fbfe8da1..6faa58027 100644 --- a/src/core/gpu_hw.h +++ b/src/core/gpu_hw.h @@ -253,9 +253,9 @@ protected: /// on a per-pixel basis, and the opaque pixels shouldn't be blended at all. bool NeedsTwoPassRendering() const { - return (m_batch.transparency_mode == GPUTransparencyMode::BackgroundMinusForeground && - m_batch.texture_mode != GPUTextureMode::Disabled) || - (m_batch.transparency_mode != GPUTransparencyMode::Disabled && !m_supports_dual_source_blend); + return (m_batch.texture_mode != GPUTextureMode::Disabled && + (m_batch.transparency_mode == GPUTransparencyMode::BackgroundMinusForeground || + (!m_supports_dual_source_blend && m_batch.transparency_mode != GPUTransparencyMode::Disabled))); } ALWAYS_INLINE bool IsUsingSoftwareRendererForReadbacks() { return static_cast(m_sw_renderer); } diff --git a/src/core/gpu_hw_shadergen.cpp b/src/core/gpu_hw_shadergen.cpp index 4484ab084..6eb7bf791 100644 --- a/src/core/gpu_hw_shadergen.cpp +++ b/src/core/gpu_hw_shadergen.cpp @@ -927,7 +927,7 @@ float4 SampleFromVRAM(uint4 texpage, float2 coords) color = (float3(icolor) * premultiply_alpha) / float3(255.0, 255.0, 255.0); #endif - #if TRANSPARENCY + #if TRANSPARENCY && TEXTURED // Apply semitransparency. If not a semitransparent texel, destination alpha is ignored. if (semitransparent) { @@ -963,6 +963,18 @@ float4 SampleFromVRAM(uint4 texpage, float2 coords) discard; #endif } + #elif TRANSPARENCY + // We shouldn't be rendering opaque geometry only when untextured, so no need to test/discard here. + #if USE_DUAL_SOURCE + o_col0 = float4(color, oalpha); + o_col1 = float4(0.0, 0.0, 0.0, u_dst_alpha_factor / ialpha); + #else + o_col0 = float4(color, oalpha); + #endif + + #if !PGXP_DEPTH + o_depth = oalpha * v_pos.z; + #endif #else // Non-transparency won't enable blending so we can write the mask here regardless. o_col0 = float4(color, oalpha); diff --git a/src/core/shader_cache_version.h b/src/core/shader_cache_version.h index 0f774c29a..6a7a3d817 100644 --- a/src/core/shader_cache_version.h +++ b/src/core/shader_cache_version.h @@ -1,4 +1,4 @@ #pragma once #include "types.h" -static constexpr u32 SHADER_CACHE_VERSION = 4; \ No newline at end of file +static constexpr u32 SHADER_CACHE_VERSION = 5; \ No newline at end of file