diff options
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index b81882d04..89d733c50 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h | |||
| @@ -36,7 +36,6 @@ using PixelFormat = VideoCore::Surface::PixelFormat; | |||
| 36 | using ComponentType = VideoCore::Surface::ComponentType; | 36 | using ComponentType = VideoCore::Surface::ComponentType; |
| 37 | 37 | ||
| 38 | struct SurfaceParams { | 38 | struct SurfaceParams { |
| 39 | |||
| 40 | enum class SurfaceClass { | 39 | enum class SurfaceClass { |
| 41 | Uploaded, | 40 | Uploaded, |
| 42 | RenderTarget, | 41 | RenderTarget, |
| @@ -169,20 +168,27 @@ struct SurfaceParams { | |||
| 169 | } | 168 | } |
| 170 | 169 | ||
| 171 | u32 MipBlockDepth(u32 mip_level) const { | 170 | u32 MipBlockDepth(u32 mip_level) const { |
| 172 | if (mip_level == 0) | 171 | if (mip_level == 0) { |
| 173 | return block_depth; | 172 | return block_depth; |
| 174 | if (is_layered) | 173 | } |
| 174 | |||
| 175 | if (is_layered) { | ||
| 175 | return 1; | 176 | return 1; |
| 176 | u32 depth = MipDepth(mip_level); | 177 | } |
| 178 | |||
| 179 | const u32 mip_depth = MipDepth(mip_level); | ||
| 177 | u32 bd = 32; | 180 | u32 bd = 32; |
| 178 | while (bd > 1 && depth * 2 <= bd) { | 181 | while (bd > 1 && mip_depth * 2 <= bd) { |
| 179 | bd >>= 1; | 182 | bd >>= 1; |
| 180 | } | 183 | } |
| 184 | |||
| 181 | if (bd == 32) { | 185 | if (bd == 32) { |
| 182 | u32 bh = MipBlockHeight(mip_level); | 186 | const u32 bh = MipBlockHeight(mip_level); |
| 183 | if (bh >= 4) | 187 | if (bh >= 4) { |
| 184 | return 16; | 188 | return 16; |
| 189 | } | ||
| 185 | } | 190 | } |
| 191 | |||
| 186 | return bd; | 192 | return bd; |
| 187 | } | 193 | } |
| 188 | 194 | ||