summaryrefslogtreecommitdiffstats
path: root/src/video_core/textures/texture.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/textures/texture.h31
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 {
DXT45 = 0x26,
DXN1 = 0x27,
DXN2 = 0x28,
- Z24S8 = 0x29,
+ S8Z24 = 0x29,
X8Z24 = 0x2a,
- S8Z24 = 0x2b,
+ Z24S8 = 0x2b,
X4V4Z24__COV4R4V = 0x2c,
X4V4Z24__COV8R8V = 0x2d,
V8Z24__COV4R12V = 0x2e,
@@ -172,12 +172,16 @@ struct TICEntry {
BitField<26, 1, u32> use_header_opt_control;
BitField<27, 1, u32> depth_texture;
BitField<28, 4, u32> max_mip_level;
+
+ BitField<0, 16, u32> buffer_high_width_minus_one;
};
union {
BitField<0, 16, u32> width_minus_1;
BitField<22, 1, u32> srgb_conversion;
BitField<23, 4, TextureType> texture_type;
BitField<29, 3, u32> border_size;
+
+ BitField<0, 16, u32> buffer_low_width_minus_one;
};
union {
BitField<0, 16, u32> height_minus_1;
@@ -206,7 +210,10 @@ struct TICEntry {
}
u32 Width() const {
- return width_minus_1 + 1;
+ if (header_version != TICHeaderVersion::OneDBuffer) {
+ return width_minus_1 + 1;
+ }
+ return (buffer_high_width_minus_one << 16) | buffer_low_width_minus_one;
}
u32 Height() const {
@@ -219,20 +226,17 @@ struct TICEntry {
u32 BlockWidth() const {
ASSERT(IsTiled());
- // The block height is stored in log2 format.
- return 1 << block_width;
+ return block_width;
}
u32 BlockHeight() const {
ASSERT(IsTiled());
- // The block height is stored in log2 format.
- return 1 << block_height;
+ return block_height;
}
u32 BlockDepth() const {
ASSERT(IsTiled());
- // The block height is stored in log2 format.
- return 1 << block_depth;
+ return block_depth;
}
bool IsTiled() const {
@@ -240,6 +244,15 @@ struct TICEntry {
header_version == TICHeaderVersion::BlockLinearColorKey;
}
+ bool IsLineal() const {
+ return header_version == TICHeaderVersion::Pitch ||
+ header_version == TICHeaderVersion::PitchColorKey;
+ }
+
+ bool IsBuffer() const {
+ return header_version == TICHeaderVersion::OneDBuffer;
+ }
+
bool IsSrgbConversionEnabled() const {
return srgb_conversion != 0;
}