From ccb6e99e071359870df26c8cc8e6ff996bb5e7f0 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 21 Sep 2014 10:58:21 -0700 Subject: [PATCH] d3d9: Disable color doubling without tex. As the PSP does. --- GPU/Directx9/PixelShaderGeneratorDX9.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/GPU/Directx9/PixelShaderGeneratorDX9.cpp b/GPU/Directx9/PixelShaderGeneratorDX9.cpp index 10cdc9e645..bf3ac3ffb1 100644 --- a/GPU/Directx9/PixelShaderGeneratorDX9.cpp +++ b/GPU/Directx9/PixelShaderGeneratorDX9.cpp @@ -474,11 +474,14 @@ void GenerateFragmentShaderDX9(char *buffer) { bool enableAlphaTest = gstate.isAlphaTestEnabled() && !IsAlphaTestTriviallyTrue() && !gstate.isModeClear() && !g_Config.bDisableAlphaTest; bool alphaTestAgainstZero = IsAlphaTestAgainstZero(); bool enableColorTest = gstate.isColorTestEnabled() && !IsColorTestTriviallyTrue() && !gstate.isModeClear(); - bool enableColorDoubling = gstate.isColorDoublingEnabled(); - // This isn't really correct, but it's a hack to get doubled blend modes to work more correctly. - bool enableAlphaDoubling = CanDoubleSrcBlendMode(); + bool enableColorDoubling = gstate.isColorDoublingEnabled() && gstate.isTextureMapEnabled(); bool doTextureProjection = gstate.getUVGenMode() == GE_TEXMAP_TEXTURE_MATRIX; bool doTextureAlpha = gstate.isTextureAlphaUsed(); + bool textureAtOffset = gstate_c.curTextureXOffset != 0 || gstate_c.curTextureYOffset != 0; + ReplaceBlendType replaceBlend = ReplaceBlendWithShader(); + ReplaceAlphaType stencilToAlpha = ReplaceAlphaWithStencil(replaceBlend); + // This isn't really correct, but it's a hack to get doubled blend modes to work more correctly. + bool enableAlphaDoubling = CanDoubleSrcBlendMode(); if (gstate_c.textureFullAlpha && gstate.getTextureFunction() != GE_TEXFUNC_REPLACE) doTextureAlpha = false;