summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-05-09 19:23:14 +0200
committerGitHub <noreply@github.com>2019-05-09 19:23:14 +0200
commitdaca045fcd6df9f2d6bcceffb8410de73770d85b (patch)
treebff14ff6953fc40d2a197c64a0f51ce5584e407c
parentMerge pull request #2443 from ReinUsesLisp/skip-repeated-variants (diff)
parentFix Layered ASTC Textures (diff)
downloadyuzu-daca045fcd6df9f2d6bcceffb8410de73770d85b.tar
yuzu-daca045fcd6df9f2d6bcceffb8410de73770d85b.tar.gz
yuzu-daca045fcd6df9f2d6bcceffb8410de73770d85b.tar.bz2
yuzu-daca045fcd6df9f2d6bcceffb8410de73770d85b.tar.lz
yuzu-daca045fcd6df9f2d6bcceffb8410de73770d85b.tar.xz
yuzu-daca045fcd6df9f2d6bcceffb8410de73770d85b.tar.zst
yuzu-daca045fcd6df9f2d6bcceffb8410de73770d85b.zip
-rw-r--r--src/video_core/textures/astc.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp
index b508d64e9..eafb6b73a 100644
--- a/src/video_core/textures/astc.cpp
+++ b/src/video_core/textures/astc.cpp
@@ -1616,6 +1616,7 @@ namespace Tegra::Texture::ASTC {
std::vector<uint8_t> Decompress(const uint8_t* data, uint32_t width, uint32_t height,
uint32_t depth, uint32_t block_width, uint32_t block_height) {
uint32_t blockIdx = 0;
+ std::size_t depth_offset = 0;
std::vector<uint8_t> outData(height * width * depth * 4);
for (uint32_t k = 0; k < depth; k++) {
for (uint32_t j = 0; j < height; j += block_height) {
@@ -1630,7 +1631,7 @@ std::vector<uint8_t> Decompress(const uint8_t* data, uint32_t width, uint32_t he
uint32_t decompWidth = std::min(block_width, width - i);
uint32_t decompHeight = std::min(block_height, height - j);
- uint8_t* outRow = outData.data() + (j * width + i) * 4;
+ uint8_t* outRow = depth_offset + outData.data() + (j * width + i) * 4;
for (uint32_t jj = 0; jj < decompHeight; jj++) {
memcpy(outRow + jj * width * 4, uncompData + jj * block_width, decompWidth * 4);
}
@@ -1638,6 +1639,7 @@ std::vector<uint8_t> Decompress(const uint8_t* data, uint32_t width, uint32_t he
blockIdx++;
}
}
+ depth_offset += height * width * 4;
}
return outData;