From 818c89313e54bcf3de98b976c0da57c88a8588d2 Mon Sep 17 00:00:00 2001 From: magumagu Date: Wed, 16 Apr 2014 14:51:18 -0700 Subject: Video backends: unify xfregs/xfmem structures. Removes the duplicate swxfregs global variable/struct from the software backend in favor of the ones from VideoCommon. --- Source/Core/VideoCommon/PixelShaderManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/PixelShaderManager.cpp') diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp index aa5140d4df..f03b6332ac 100644 --- a/Source/Core/VideoCommon/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/PixelShaderManager.cpp @@ -108,7 +108,7 @@ void PixelShaderManager::SetConstants() // lights don't have a 1 to 1 mapping, the color component needs to be converted to 4 floats int istart = nLightsChanged[0] / 0x10; int iend = (nLightsChanged[1] + 15) / 0x10; - const float* xfmemptr = (const float*)&xfmem[0x10 * istart + XFMEM_LIGHTS]; + const float* xfmemptr = (const float*)&xfmem.lights[0x10 * istart]; for (int i = istart; i < iend; ++i) { -- cgit v1.2.3 From 8f5342c442c8e78784b4ea7002250781ba768767 Mon Sep 17 00:00:00 2001 From: magumagu Date: Wed, 16 Apr 2014 18:10:33 -0700 Subject: Video backend: merge global var xfmem into xfregs. There isn't really any reason to keep them separate. --- Source/Core/VideoCommon/PixelShaderManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/PixelShaderManager.cpp') diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp index f03b6332ac..3b67b7a936 100644 --- a/Source/Core/VideoCommon/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/PixelShaderManager.cpp @@ -108,7 +108,7 @@ void PixelShaderManager::SetConstants() // lights don't have a 1 to 1 mapping, the color component needs to be converted to 4 floats int istart = nLightsChanged[0] / 0x10; int iend = (nLightsChanged[1] + 15) / 0x10; - const float* xfmemptr = (const float*)&xfmem.lights[0x10 * istart]; + const float* xfmemptr = (const float*)&xfregs.lights[0x10 * istart]; for (int i = istart; i < iend; ++i) { -- cgit v1.2.3 From 1357277f40166683a3ac4eb9979010c3038d2db8 Mon Sep 17 00:00:00 2001 From: magumagu Date: Sun, 27 Apr 2014 11:59:04 -0700 Subject: Video backends: mass-replace "xfregs" with "xfmem". --- Source/Core/VideoCommon/PixelShaderManager.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoCommon/PixelShaderManager.cpp') diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp index 3b67b7a936..4ca5d38f81 100644 --- a/Source/Core/VideoCommon/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/PixelShaderManager.cpp @@ -77,7 +77,7 @@ void PixelShaderManager::SetConstants() //bpmem.fogRange.Base.Center : center of the viewport in x axis. observation: bpmem.fogRange.Base.Center = realcenter + 342; int center = ((u32)bpmem.fogRange.Base.Center) - 342; // normalize center to make calculations easy - float ScreenSpaceCenter = center / (2.0f * xfregs.viewport.wd); + float ScreenSpaceCenter = center / (2.0f * xfmem.viewport.wd); ScreenSpaceCenter = (ScreenSpaceCenter * 2.0f) - 1.0f; //bpmem.fogRange.K seems to be a table of precalculated coefficients for the adjust factor //observations: bpmem.fogRange.K[0].LO appears to be the lowest value and bpmem.fogRange.K[4].HI the largest @@ -86,7 +86,7 @@ void PixelShaderManager::SetConstants() // so to simplify I use the hi coefficient as K in the shader taking 256 as the scale // TODO: Shouldn't this be EFBToScaledXf? constants.fogf[0][0] = ScreenSpaceCenter; - constants.fogf[0][1] = (float)Renderer::EFBToScaledX((int)(2.0f * xfregs.viewport.wd)); + constants.fogf[0][1] = (float)Renderer::EFBToScaledX((int)(2.0f * xfmem.viewport.wd)); constants.fogf[0][2] = bpmem.fogRange.K[4].HI / 256.0f; } else @@ -108,7 +108,7 @@ void PixelShaderManager::SetConstants() // lights don't have a 1 to 1 mapping, the color component needs to be converted to 4 floats int istart = nLightsChanged[0] / 0x10; int iend = (nLightsChanged[1] + 15) / 0x10; - const float* xfmemptr = (const float*)&xfregs.lights[0x10 * istart]; + const float* xfmemptr = (const float*)&xfmem.lights[0x10 * istart]; for (int i = istart; i < iend; ++i) { @@ -141,8 +141,8 @@ void PixelShaderManager::SetConstants() if (s_bViewPortChanged) { - constants.zbias[1][0] = xfregs.viewport.farZ; - constants.zbias[1][1] = xfregs.viewport.zRange; + constants.zbias[1][0] = xfmem.viewport.farZ; + constants.zbias[1][1] = xfmem.viewport.zRange; dirty = true; s_bViewPortChanged = false; } -- cgit v1.2.3