summaryrefslogtreecommitdiffstats
path: root/src/video_core/textures
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-11 03:24:07 +0200
committerGitHub <noreply@github.com>2018-10-11 03:24:07 +0200
commit6d82c4adf92f743eadf0749bf01646baaabfa735 (patch)
tree5a5a9aa040e600202bee1c99c74a6bfc57e1b52a /src/video_core/textures
parentMerge pull request #1460 from FernandoS27/scissor_test (diff)
parentAdd memory Layout to Render Targets and Depth Buffers (diff)
downloadyuzu-6d82c4adf92f743eadf0749bf01646baaabfa735.tar
yuzu-6d82c4adf92f743eadf0749bf01646baaabfa735.tar.gz
yuzu-6d82c4adf92f743eadf0749bf01646baaabfa735.tar.bz2
yuzu-6d82c4adf92f743eadf0749bf01646baaabfa735.tar.lz
yuzu-6d82c4adf92f743eadf0749bf01646baaabfa735.tar.xz
yuzu-6d82c4adf92f743eadf0749bf01646baaabfa735.tar.zst
yuzu-6d82c4adf92f743eadf0749bf01646baaabfa735.zip
Diffstat (limited to 'src/video_core/textures')
-rw-r--r--src/video_core/textures/texture.h17
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 {
BitField<21, 3, TICHeaderVersion> header_version;
};
union {
+ BitField<0, 3, u32> block_width;
BitField<3, 3, u32> block_height;
+ BitField<6, 3, u32> block_depth;
// High 16 bits of the pitch value
BitField<0, 16, u32> pitch_high;
@@ -202,13 +204,24 @@ struct TICEntry {
return depth_minus_1 + 1;
}
+ u32 BlockWidth() const {
+ ASSERT(IsTiled());
+ // The block height is stored in log2 format.
+ return 1 << block_width;
+ }
+
u32 BlockHeight() const {
- ASSERT(header_version == TICHeaderVersion::BlockLinear ||
- header_version == TICHeaderVersion::BlockLinearColorKey);
+ ASSERT(IsTiled());
// The block height is stored in log2 format.
return 1 << block_height;
}
+ u32 BlockDepth() const {
+ ASSERT(IsTiled());
+ // The block height is stored in log2 format.
+ return 1 << block_depth;
+ }
+
bool IsTiled() const {
return header_version == TICHeaderVersion::BlockLinear ||
header_version == TICHeaderVersion::BlockLinearColorKey;