diff options
Diffstat (limited to 'src/video_core/textures/texture.h')
| -rw-r--r-- | src/video_core/textures/texture.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h index 219bfd559..e3be018b9 100644 --- a/src/video_core/textures/texture.h +++ b/src/video_core/textures/texture.h | |||
| @@ -52,9 +52,9 @@ enum class TextureFormat : u32 { | |||
| 52 | DXT45 = 0x26, | 52 | DXT45 = 0x26, |
| 53 | DXN1 = 0x27, | 53 | DXN1 = 0x27, |
| 54 | DXN2 = 0x28, | 54 | DXN2 = 0x28, |
| 55 | Z24S8 = 0x29, | 55 | S8Z24 = 0x29, |
| 56 | X8Z24 = 0x2a, | 56 | X8Z24 = 0x2a, |
| 57 | S8Z24 = 0x2b, | 57 | Z24S8 = 0x2b, |
| 58 | X4V4Z24__COV4R4V = 0x2c, | 58 | X4V4Z24__COV4R4V = 0x2c, |
| 59 | X4V4Z24__COV8R8V = 0x2d, | 59 | X4V4Z24__COV8R8V = 0x2d, |
| 60 | V8Z24__COV4R12V = 0x2e, | 60 | V8Z24__COV4R12V = 0x2e, |
| @@ -172,12 +172,16 @@ struct TICEntry { | |||
| 172 | BitField<26, 1, u32> use_header_opt_control; | 172 | BitField<26, 1, u32> use_header_opt_control; |
| 173 | BitField<27, 1, u32> depth_texture; | 173 | BitField<27, 1, u32> depth_texture; |
| 174 | BitField<28, 4, u32> max_mip_level; | 174 | BitField<28, 4, u32> max_mip_level; |
| 175 | |||
| 176 | BitField<0, 16, u32> buffer_high_width_minus_one; | ||
| 175 | }; | 177 | }; |
| 176 | union { | 178 | union { |
| 177 | BitField<0, 16, u32> width_minus_1; | 179 | BitField<0, 16, u32> width_minus_1; |
| 178 | BitField<22, 1, u32> srgb_conversion; | 180 | BitField<22, 1, u32> srgb_conversion; |
| 179 | BitField<23, 4, TextureType> texture_type; | 181 | BitField<23, 4, TextureType> texture_type; |
| 180 | BitField<29, 3, u32> border_size; | 182 | BitField<29, 3, u32> border_size; |
| 183 | |||
| 184 | BitField<0, 16, u32> buffer_low_width_minus_one; | ||
| 181 | }; | 185 | }; |
| 182 | union { | 186 | union { |
| 183 | BitField<0, 16, u32> height_minus_1; | 187 | BitField<0, 16, u32> height_minus_1; |
| @@ -206,7 +210,10 @@ struct TICEntry { | |||
| 206 | } | 210 | } |
| 207 | 211 | ||
| 208 | u32 Width() const { | 212 | u32 Width() const { |
| 209 | return width_minus_1 + 1; | 213 | if (header_version != TICHeaderVersion::OneDBuffer) { |
| 214 | return width_minus_1 + 1; | ||
| 215 | } | ||
| 216 | return (buffer_high_width_minus_one << 16) | buffer_low_width_minus_one; | ||
| 210 | } | 217 | } |
| 211 | 218 | ||
| 212 | u32 Height() const { | 219 | u32 Height() const { |
| @@ -219,20 +226,17 @@ struct TICEntry { | |||
| 219 | 226 | ||
| 220 | u32 BlockWidth() const { | 227 | u32 BlockWidth() const { |
| 221 | ASSERT(IsTiled()); | 228 | ASSERT(IsTiled()); |
| 222 | // The block height is stored in log2 format. | 229 | return block_width; |
| 223 | return 1 << block_width; | ||
| 224 | } | 230 | } |
| 225 | 231 | ||
| 226 | u32 BlockHeight() const { | 232 | u32 BlockHeight() const { |
| 227 | ASSERT(IsTiled()); | 233 | ASSERT(IsTiled()); |
| 228 | // The block height is stored in log2 format. | 234 | return block_height; |
| 229 | return 1 << block_height; | ||
| 230 | } | 235 | } |
| 231 | 236 | ||
| 232 | u32 BlockDepth() const { | 237 | u32 BlockDepth() const { |
| 233 | ASSERT(IsTiled()); | 238 | ASSERT(IsTiled()); |
| 234 | // The block height is stored in log2 format. | 239 | return block_depth; |
| 235 | return 1 << block_depth; | ||
| 236 | } | 240 | } |
| 237 | 241 | ||
| 238 | bool IsTiled() const { | 242 | bool IsTiled() const { |
| @@ -240,6 +244,15 @@ struct TICEntry { | |||
| 240 | header_version == TICHeaderVersion::BlockLinearColorKey; | 244 | header_version == TICHeaderVersion::BlockLinearColorKey; |
| 241 | } | 245 | } |
| 242 | 246 | ||
| 247 | bool IsLineal() const { | ||
| 248 | return header_version == TICHeaderVersion::Pitch || | ||
| 249 | header_version == TICHeaderVersion::PitchColorKey; | ||
| 250 | } | ||
| 251 | |||
| 252 | bool IsBuffer() const { | ||
| 253 | return header_version == TICHeaderVersion::OneDBuffer; | ||
| 254 | } | ||
| 255 | |||
| 243 | bool IsSrgbConversionEnabled() const { | 256 | bool IsSrgbConversionEnabled() const { |
| 244 | return srgb_conversion != 0; | 257 | return srgb_conversion != 0; |
| 245 | } | 258 | } |