summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software/SWTexture.cpp
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2023-01-27 18:46:53 -0600
committeriwubcode <iwubcode@users.noreply.github.com>2023-01-27 18:46:53 -0600
commit7bea39b39e9978ca8461adf68a2c28535719c48e (patch)
tree7329c4aab053fada727c88bf996050f04e2bdb4f /Source/Core/VideoBackends/Software/SWTexture.cpp
parent41272dc5f1b62f4a5a0562cc29eb3e83367d0f14 (diff)
VideoBackends: add a way to load data into a specific level AND layer, default to layer 0
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));
}
}