mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Change destination alpha handling. The blending method introduced in rev 1921 was not the correct way to do it. This way was suggested by hrydgard in October and I should have listened. A simple pixel shader as hrydgard suggested cannot be used because the alpha is not set if the pixel is discarded due to failing depth (after z texture) or alpha (result of tev stages) tests. There is a bit of a performance hit so there should be an option to disable the second render pass which sets the alpha because it is probably not needed most of the time.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2662 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -105,13 +105,14 @@ GLuint PixelShaderCache::GetColorMatrixProgram()
|
||||
}
|
||||
|
||||
|
||||
FRAGMENTSHADER* PixelShaderCache::GetShader()
|
||||
FRAGMENTSHADER* PixelShaderCache::GetShader(bool dstAlphaEnable)
|
||||
{
|
||||
DVSTARTPROFILE();
|
||||
PIXELSHADERUID uid;
|
||||
u32 zbufrender = (Renderer::UseFakeZTarget() && bpmem.zmode.updateenable) ? 1 : 0;
|
||||
u32 zBufRenderToCol0 = Renderer::GetRenderMode() != Renderer::RM_Normal;
|
||||
GetPixelShaderId(uid, PixelShaderManager::GetTextureMask(), zbufrender, zBufRenderToCol0);
|
||||
u32 dstAlpha = dstAlphaEnable ? 1 : 0;
|
||||
GetPixelShaderId(uid, PixelShaderManager::GetTextureMask(), zbufrender, zBufRenderToCol0, dstAlpha);
|
||||
|
||||
PSCache::iterator iter = pshaders.find(uid);
|
||||
|
||||
@ -128,7 +129,8 @@ FRAGMENTSHADER* PixelShaderCache::GetShader()
|
||||
PSCacheEntry& newentry = pshaders[uid];
|
||||
const char *code = GeneratePixelShader(PixelShaderManager::GetTextureMask(),
|
||||
Renderer::UseFakeZTarget(),
|
||||
Renderer::GetRenderMode() != Renderer::RM_Normal);
|
||||
Renderer::GetRenderMode() != Renderer::RM_Normal,
|
||||
dstAlphaEnable);
|
||||
|
||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||
if (g_Config.iLog & CONF_SAVESHADERS && code) {
|
||||
|
Reference in New Issue
Block a user