diff options
| author | 2018-10-08 14:34:55 -0400 | |
|---|---|---|
| committer | 2018-10-09 21:14:32 -0400 | |
| commit | af653906d0cf38556acae1f8e5d3f8968ff7074a (patch) | |
| tree | 55197afb627984e1756a885a9c4df9b0091d923c /src/video_core/textures | |
| parent | Merge pull request #1423 from DarkLordZach/romfs-file-exts (diff) | |
| download | yuzu-af653906d0cf38556acae1f8e5d3f8968ff7074a.tar.gz yuzu-af653906d0cf38556acae1f8e5d3f8968ff7074a.tar.xz yuzu-af653906d0cf38556acae1f8e5d3f8968ff7074a.zip | |
Fixed block height settings for RenderTargets and Depth Buffers, and added block width and block depth
Diffstat (limited to 'src/video_core/textures')
| -rw-r--r-- | src/video_core/textures/texture.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h index 8f31d825a..58d17abcb 100644 --- a/src/video_core/textures/texture.h +++ b/src/video_core/textures/texture.h | |||
| @@ -161,7 +161,9 @@ struct TICEntry { | |||
| 161 | BitField<21, 3, TICHeaderVersion> header_version; | 161 | BitField<21, 3, TICHeaderVersion> header_version; |
| 162 | }; | 162 | }; |
| 163 | union { | 163 | union { |
| 164 | BitField<0, 3, u32> block_width; | ||
| 164 | BitField<3, 3, u32> block_height; | 165 | BitField<3, 3, u32> block_height; |
| 166 | BitField<6, 3, u32> block_depth; | ||
| 165 | 167 | ||
| 166 | // High 16 bits of the pitch value | 168 | // High 16 bits of the pitch value |
| 167 | BitField<0, 16, u32> pitch_high; | 169 | BitField<0, 16, u32> pitch_high; |
| @@ -202,13 +204,24 @@ struct TICEntry { | |||
| 202 | return depth_minus_1 + 1; | 204 | return depth_minus_1 + 1; |
| 203 | } | 205 | } |
| 204 | 206 | ||
| 207 | u32 BlockWidth() const { | ||
| 208 | ASSERT(IsTiled()); | ||
| 209 | // The block height is stored in log2 format. | ||
| 210 | return 1 << block_width; | ||
| 211 | } | ||
| 212 | |||
| 205 | u32 BlockHeight() const { | 213 | u32 BlockHeight() const { |
| 206 | ASSERT(header_version == TICHeaderVersion::BlockLinear || | 214 | ASSERT(IsTiled()); |
| 207 | header_version == TICHeaderVersion::BlockLinearColorKey); | ||
| 208 | // The block height is stored in log2 format. | 215 | // The block height is stored in log2 format. |
| 209 | return 1 << block_height; | 216 | return 1 << block_height; |
| 210 | } | 217 | } |
| 211 | 218 | ||
| 219 | u32 BlockDepth() const { | ||
| 220 | ASSERT(IsTiled()); | ||
| 221 | // The block height is stored in log2 format. | ||
| 222 | return 1 << block_depth; | ||
| 223 | } | ||
| 224 | |||
| 212 | bool IsTiled() const { | 225 | bool IsTiled() const { |
| 213 | return header_version == TICHeaderVersion::BlockLinear || | 226 | return header_version == TICHeaderVersion::BlockLinear || |
| 214 | header_version == TICHeaderVersion::BlockLinearColorKey; | 227 | header_version == TICHeaderVersion::BlockLinearColorKey; |