diff options
| author | 2019-05-12 20:33:52 -0400 | |
|---|---|---|
| committer | 2019-06-20 21:36:12 -0300 | |
| commit | 7731a0e2d15da04eea746b4b8dd5c6c4b29f9f29 (patch) | |
| tree | 9769d59ddb0076234d26993ee8aca62e7da58554 /src/video_core/textures | |
| parent | surface_params: Ensure pitch is always written to avoid surface leaks (diff) | |
| download | yuzu-7731a0e2d15da04eea746b4b8dd5c6c4b29f9f29.tar.gz yuzu-7731a0e2d15da04eea746b4b8dd5c6c4b29f9f29.tar.xz yuzu-7731a0e2d15da04eea746b4b8dd5c6c4b29f9f29.zip | |
texture_cache: General Fixes
Fixed ASTC mipmaps loading
Fixed alignment on openGL upload/download
Fixed Block Height Calculation
Removed unalign_height
Diffstat (limited to 'src/video_core/textures')
| -rw-r--r-- | src/video_core/textures/convert.cpp | 14 | ||||
| -rw-r--r-- | src/video_core/textures/convert.h | 7 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/video_core/textures/convert.cpp b/src/video_core/textures/convert.cpp index 82050bd51..f3efa7eb0 100644 --- a/src/video_core/textures/convert.cpp +++ b/src/video_core/textures/convert.cpp | |||
| @@ -62,19 +62,19 @@ static void ConvertZ24S8ToS8Z24(u8* data, u32 width, u32 height) { | |||
| 62 | SwapS8Z24ToZ24S8<true>(data, width, height); | 62 | SwapS8Z24ToZ24S8<true>(data, width, height); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | void ConvertFromGuestToHost(u8* data, PixelFormat pixel_format, u32 width, u32 height, u32 depth, | 65 | void ConvertFromGuestToHost(u8* in_data, u8* out_data, PixelFormat pixel_format, u32 width, |
| 66 | bool convert_astc, bool convert_s8z24) { | 66 | u32 height, u32 depth, bool convert_astc, bool convert_s8z24) { |
| 67 | if (convert_astc && IsPixelFormatASTC(pixel_format)) { | 67 | if (convert_astc && IsPixelFormatASTC(pixel_format)) { |
| 68 | // Convert ASTC pixel formats to RGBA8, as most desktop GPUs do not support ASTC. | 68 | // Convert ASTC pixel formats to RGBA8, as most desktop GPUs do not support ASTC. |
| 69 | u32 block_width{}; | 69 | u32 block_width{}; |
| 70 | u32 block_height{}; | 70 | u32 block_height{}; |
| 71 | std::tie(block_width, block_height) = GetASTCBlockSize(pixel_format); | 71 | std::tie(block_width, block_height) = GetASTCBlockSize(pixel_format); |
| 72 | const std::vector<u8> rgba8_data = | 72 | const std::vector<u8> rgba8_data = Tegra::Texture::ASTC::Decompress( |
| 73 | Tegra::Texture::ASTC::Decompress(data, width, height, depth, block_width, block_height); | 73 | in_data, width, height, depth, block_width, block_height); |
| 74 | std::copy(rgba8_data.begin(), rgba8_data.end(), data); | 74 | std::copy(rgba8_data.begin(), rgba8_data.end(), out_data); |
| 75 | 75 | ||
| 76 | } else if (convert_s8z24 && pixel_format == PixelFormat::S8Z24) { | 76 | } else if (convert_s8z24 && pixel_format == PixelFormat::S8Z24) { |
| 77 | Tegra::Texture::ConvertS8Z24ToZ24S8(data, width, height); | 77 | Tegra::Texture::ConvertS8Z24ToZ24S8(in_data, width, height); |
| 78 | } | 78 | } |
| 79 | } | 79 | } |
| 80 | 80 | ||
| @@ -90,4 +90,4 @@ void ConvertFromHostToGuest(u8* data, PixelFormat pixel_format, u32 width, u32 h | |||
| 90 | } | 90 | } |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | } // namespace Tegra::Texture \ No newline at end of file | 93 | } // namespace Tegra::Texture |
diff --git a/src/video_core/textures/convert.h b/src/video_core/textures/convert.h index 12542e71c..d5d6c77bb 100644 --- a/src/video_core/textures/convert.h +++ b/src/video_core/textures/convert.h | |||
| @@ -12,10 +12,11 @@ enum class PixelFormat; | |||
| 12 | 12 | ||
| 13 | namespace Tegra::Texture { | 13 | namespace Tegra::Texture { |
| 14 | 14 | ||
| 15 | void ConvertFromGuestToHost(u8* data, VideoCore::Surface::PixelFormat pixel_format, u32 width, | 15 | void ConvertFromGuestToHost(u8* in_data, u8* out_data, VideoCore::Surface::PixelFormat pixel_format, |
| 16 | u32 height, u32 depth, bool convert_astc, bool convert_s8z24); | 16 | u32 width, u32 height, u32 depth, bool convert_astc, |
| 17 | bool convert_s8z24); | ||
| 17 | 18 | ||
| 18 | void ConvertFromHostToGuest(u8* data, VideoCore::Surface::PixelFormat pixel_format, u32 width, | 19 | void ConvertFromHostToGuest(u8* data, VideoCore::Surface::PixelFormat pixel_format, u32 width, |
| 19 | u32 height, u32 depth, bool convert_astc, bool convert_s8z24); | 20 | u32 height, u32 depth, bool convert_astc, bool convert_s8z24); |
| 20 | 21 | ||
| 21 | } // namespace Tegra::Texture \ No newline at end of file | 22 | } // namespace Tegra::Texture |