summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/SWTexture.cpp
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2023-02-01 00:03:59 +1300
committerGitHub <noreply@github.com>2023-02-01 00:03:59 +1300
commite98ab0784dd823bb974cc2f6fbed697accc76f57 (patch)
tree25e7c1f52f2be320829fc58f65cf04a59b5a892c /Source/Core/VideoBackends/Software/SWTexture.cpp
parented3ad9458d6825917f09c3ccf93a20c5fb363078 (diff)
parent7bea39b39e9978ca8461adf68a2c28535719c48e (diff)
Merge pull request #11501 from iwubcode/abstract_texture_load_specify_layer
VideoBackends: add a way to load data into a specific level AND layer
Diffstat (limited to 'Source/Core/VideoBackends/Software/SWTexture.cpp')
-rw-r--r--Source/Core/VideoBackends/Software/SWTexture.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/Source/Core/VideoBackends/Software/SWTexture.cpp b/Source/Core/VideoBackends/Software/SWTexture.cpp
index 6805ff0eb8..4b55f1453c 100644
--- a/Source/Core/VideoBackends/Software/SWTexture.cpp
+++ b/Source/Core/VideoBackends/Software/SWTexture.cpp
@@ -92,16 +92,13 @@ void SWTexture::ResolveFromTexture(const AbstractTexture* src, const MathUtil::R
}
void SWTexture::Load(u32 level, u32 width, u32 height, u32 row_length, const u8* buffer,
- size_t buffer_size)
+ size_t buffer_size, u32 layer)
{
- for (u32 layer = 0; layer < m_config.layers; layer++)
+ u8* data = GetData(layer, level);
+ for (u32 y = 0; y < height; y++)
{
- u8* data = GetData(layer, level);
- for (u32 y = 0; y < height; y++)
- {
- memcpy(&data[width * y * sizeof(Pixel)], &buffer[y * row_length * sizeof(Pixel)],
- width * sizeof(Pixel));
- }
+ memcpy(&data[width * y * sizeof(Pixel)], &buffer[y * row_length * sizeof(Pixel)],
+ width * sizeof(Pixel));
}
}