From ad12900397d68c7d59ea1a9476bdf9d67eab5920 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Tue, 28 Mar 2017 14:17:38 +0300 Subject: [PATCH] gl: Force alignment of DXT textures --- rpcs3/Emu/RSX/GL/GLTexture.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rpcs3/Emu/RSX/GL/GLTexture.cpp b/rpcs3/Emu/RSX/GL/GLTexture.cpp index 809c9dd3e7..9e3a11eca7 100644 --- a/rpcs3/Emu/RSX/GL/GLTexture.cpp +++ b/rpcs3/Emu/RSX/GL/GLTexture.cpp @@ -319,6 +319,14 @@ namespace rsx std::vector staging_buffer) { int mip_level = 0; + if (is_compressed_format(format)) + { + //Compressed formats have a 4-byte alignment + //TODO: Verify that samplers are not affected by the padding + width = align(width, 4); + height = align(height, 4); + } + if (dim == rsx::texture_dimension_extended::texture_dimension_1d) { __glcheck glTexStorage1D(GL_TEXTURE_1D, mipmap_count, ::gl::get_sized_internal_format(format), width);