From 7bea39b39e9978ca8461adf68a2c28535719c48e Mon Sep 17 00:00:00 2001 From: iwubcode Date: Fri, 27 Jan 2023 18:46:53 -0600 Subject: VideoBackends: add a way to load data into a specific level AND layer, default to layer 0 --- Source/Core/VideoBackends/Software/SWTexture.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'Source/Core/VideoBackends/Software/SWTexture.cpp') 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)); } } -- cgit v1.2.3