summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/Rasterizer.cpp
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2021-10-10 08:16:15 +1300
committerScott Mansell <phiren@gmail.com>2021-10-10 09:09:43 +1300
commit9fa26624b02562fb8626c93c45acf2015fc06f40 (patch)
tree870bffe166ba60ef71dc8c19b89de59ca438d337 /Source/Core/VideoBackends/Software/Rasterizer.cpp
parentef0e401708dc534e8bfac52e5e43086b4255c22d (diff)
BPMemory: Refactor/consolidate TexUnit Addressing
Currently the logic for addressing the individual TexUnits is splattered all across dolphin's codebase, this commit attempts to consolidate it all into a single place and formalise it using our new TexUnitAddress struct.
Diffstat (limited to 'Source/Core/VideoBackends/Software/Rasterizer.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/Rasterizer.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp
index de9925d596..df04ab5a31 100644
--- a/Source/Core/VideoBackends/Software/Rasterizer.cpp
+++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp
@@ -163,13 +163,12 @@ static void InitSlope(Slope* slope, float f1, float f2, float f3, float DX31, fl
static inline void CalculateLOD(s32* lodp, bool* linear, u32 texmap, u32 texcoord)
{
- const FourTexUnits& texUnit = bpmem.tex[(texmap >> 2) & 1];
- const u8 subTexmap = texmap & 3;
+ auto texUnit = bpmem.tex.GetUnit(texmap);
// LOD calculation requires data from the texture mode for bias, etc.
// it does not seem to use the actual texture size
- const TexMode0& tm0 = texUnit.texMode0[subTexmap];
- const TexMode1& tm1 = texUnit.texMode1[subTexmap];
+ const TexMode0& tm0 = texUnit.texMode0;
+ const TexMode1& tm1 = texUnit.texMode1;
float sDelta, tDelta;
if (tm0.diag_lod == LODType::Diagonal)