diff options
| author | 2018-04-24 21:58:45 -0500 | |
|---|---|---|
| committer | 2018-04-25 11:55:30 -0500 | |
| commit | 1dd4861d38b862724052a5db66067d77ede468d4 (patch) | |
| tree | 8e6db1e5dcbe180ce341f9872ba6e382d8baaac9 /src/video_core/textures | |
| parent | GPU: Added a function to retrieve the bytes per pixel of the render target fo... (diff) | |
| download | yuzu-1dd4861d38b862724052a5db66067d77ede468d4.tar.gz yuzu-1dd4861d38b862724052a5db66067d77ede468d4.tar.xz yuzu-1dd4861d38b862724052a5db66067d77ede468d4.zip | |
GPU: Make the Textures::CopySwizzledData function accessible from the outside of the file.
Diffstat (limited to 'src/video_core/textures')
| -rw-r--r-- | src/video_core/textures/decoders.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/textures/decoders.h | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index 9c3ae875c..8b39b2bdf 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -27,9 +27,8 @@ static u32 GetSwizzleOffset(u32 x, u32 y, u32 image_width, u32 bytes_per_pixel, | |||
| 27 | return address; | 27 | return address; |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | static void CopySwizzledData(u32 width, u32 height, u32 bytes_per_pixel, u32 out_bytes_per_pixel, | 30 | void CopySwizzledData(u32 width, u32 height, u32 bytes_per_pixel, u32 out_bytes_per_pixel, |
| 31 | u8* swizzled_data, u8* unswizzled_data, bool unswizzle, | 31 | u8* swizzled_data, u8* unswizzled_data, bool unswizzle, u32 block_height) { |
| 32 | u32 block_height) { | ||
| 33 | u8* data_ptrs[2]; | 32 | u8* data_ptrs[2]; |
| 34 | for (unsigned y = 0; y < height; ++y) { | 33 | for (unsigned y = 0; y < height; ++y) { |
| 35 | for (unsigned x = 0; x < width; ++x) { | 34 | for (unsigned x = 0; x < width; ++x) { |
diff --git a/src/video_core/textures/decoders.h b/src/video_core/textures/decoders.h index a700911cf..2562c4b06 100644 --- a/src/video_core/textures/decoders.h +++ b/src/video_core/textures/decoders.h | |||
| @@ -17,6 +17,10 @@ namespace Texture { | |||
| 17 | std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width, u32 height, | 17 | std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width, u32 height, |
| 18 | u32 block_height = TICEntry::DefaultBlockHeight); | 18 | u32 block_height = TICEntry::DefaultBlockHeight); |
| 19 | 19 | ||
| 20 | /// Copies texture data from a buffer and performs swizzling/unswizzling as necessary. | ||
| 21 | void CopySwizzledData(u32 width, u32 height, u32 bytes_per_pixel, u32 out_bytes_per_pixel, | ||
| 22 | u8* swizzled_data, u8* unswizzled_data, bool unswizzle, u32 block_height); | ||
| 23 | |||
| 20 | /** | 24 | /** |
| 21 | * Decodes an unswizzled texture into a A8R8G8B8 texture. | 25 | * Decodes an unswizzled texture into a A8R8G8B8 texture. |
| 22 | */ | 26 | */ |