From 605b687af8a46cfb32e1a9599d3ddb47d2cdf02c Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Sat, 23 Nov 2013 20:58:24 +0100 Subject: PixelShaderGen: Use integer math for z textures. --- Source/Core/VideoCommon/PixelShaderManager.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Source/Core/VideoCommon/PixelShaderManager.cpp') diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp index 8999247f24..79ff607b82 100644 --- a/Source/Core/VideoCommon/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/PixelShaderManager.cpp @@ -141,8 +141,8 @@ void PixelShaderManager::SetConstants() if (s_bViewPortChanged) { - constants.zbias[1][0] = xfregs.viewport.farZ / 16777216.0f; - constants.zbias[1][1] = xfregs.viewport.zRange / 16777216.0f; + constants.zbias[1][0] = xfregs.viewport.farZ; + constants.zbias[1][1] = xfregs.viewport.zRange; dirty = true; s_bViewPortChanged = false; } @@ -190,7 +190,7 @@ void PixelShaderManager::SetTexDims(int texmapid, u32 width, u32 height, u32 wra void PixelShaderManager::SetZTextureBias() { - constants.zbias[1][3] = bpmem.ztex1.bias/16777215.0f; + constants.zbias[1][3] = bpmem.ztex1.bias; dirty = true; } @@ -242,18 +242,18 @@ void PixelShaderManager::SetZTextureTypeChanged() constants.zbias[0][0] = 0; constants.zbias[0][1] = 0; constants.zbias[0][2] = 0; - constants.zbias[0][3] = 255.0f/16777215.0f; + constants.zbias[0][3] = 1; break; case TEV_ZTEX_TYPE_U16: - constants.zbias[0][0] = 255.0f/16777215.0f; + constants.zbias[0][0] = 1; constants.zbias[0][1] = 0; constants.zbias[0][2] = 0; - constants.zbias[0][3] = 65280.0f/16777215.0f; + constants.zbias[0][3] = 256; break; case TEV_ZTEX_TYPE_U24: - constants.zbias[0][0] = 16711680.0f/16777215.0f; - constants.zbias[0][1] = 65280.0f/16777215.0f; - constants.zbias[0][2] = 255.0f/16777215.0f; + constants.zbias[0][0] = 65536; + constants.zbias[0][1] = 256; + constants.zbias[0][2] = 1; constants.zbias[0][3] = 0; break; default: -- cgit v1.2.3