diff options
| author | 2023-08-06 14:49:34 -0400 | |
|---|---|---|
| committer | 2023-08-06 14:54:58 -0400 | |
| commit | b18c1fb1bbbcc235e9a1cbbb2704fed2e5895e61 (patch) | |
| tree | eab3d5b675ddac021b1c2c31c6f3d2cea41ef569 /src/video_core/textures/decoders.cpp | |
| parent | Compute Replicate (diff) | |
| download | yuzu-b18c1fb1bbbcc235e9a1cbbb2704fed2e5895e61.tar.gz yuzu-b18c1fb1bbbcc235e9a1cbbb2704fed2e5895e61.tar.xz yuzu-b18c1fb1bbbcc235e9a1cbbb2704fed2e5895e61.zip | |
HACK: Avoid swizzling and reuploading ASTC image every frame
Diffstat (limited to 'src/video_core/textures/decoders.cpp')
| -rw-r--r-- | src/video_core/textures/decoders.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index 95bcdd37b..dde4b0904 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -88,6 +88,7 @@ void SwizzleImpl(std::span<u8> output, std::span<const u8> input, u32 width, u32 | |||
| 88 | } | 88 | } |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | |||
| 91 | template <bool TO_LINEAR, u32 BYTES_PER_PIXEL> | 92 | template <bool TO_LINEAR, u32 BYTES_PER_PIXEL> |
| 92 | void SwizzleSubrectImpl(std::span<u8> output, std::span<const u8> input, u32 width, u32 height, | 93 | void SwizzleSubrectImpl(std::span<u8> output, std::span<const u8> input, u32 width, u32 height, |
| 93 | u32 depth, u32 origin_x, u32 origin_y, u32 extent_x, u32 num_lines, | 94 | u32 depth, u32 origin_x, u32 origin_y, u32 extent_x, u32 num_lines, |
| @@ -95,6 +96,14 @@ void SwizzleSubrectImpl(std::span<u8> output, std::span<const u8> input, u32 wid | |||
| 95 | // The origin of the transformation can be configured here, leave it as zero as the current API | 96 | // The origin of the transformation can be configured here, leave it as zero as the current API |
| 96 | // doesn't expose it. | 97 | // doesn't expose it. |
| 97 | static constexpr u32 origin_z = 0; | 98 | static constexpr u32 origin_z = 0; |
| 99 | static u32 last_width = 0; | ||
| 100 | static u32 last_height = 0; | ||
| 101 | if (last_width == width && last_height == height) { | ||
| 102 | return; | ||
| 103 | } | ||
| 104 | LOG_ERROR(Debug, "Called"); | ||
| 105 | last_width = width; | ||
| 106 | last_height = height; | ||
| 98 | 107 | ||
| 99 | // We can configure here a custom pitch | 108 | // We can configure here a custom pitch |
| 100 | // As it's not exposed 'width * BYTES_PER_PIXEL' will be the expected pitch. | 109 | // As it's not exposed 'width * BYTES_PER_PIXEL' will be the expected pitch. |