summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-04-16 02:52:25 +0200
committerSubv <subv2112@gmail.com>2018-04-18 18:38:39 +0200
commitdb5f2bfa7ef522a56101776248e7cd0daea6d266 (patch)
tree4f14fdf1755aa5f76a0950179c5bb346dec11e7e /src
parentMerge pull request #346 from bunnei/misc-gpu-improvements (diff)
downloadyuzu-db5f2bfa7ef522a56101776248e7cd0daea6d266.tar
yuzu-db5f2bfa7ef522a56101776248e7cd0daea6d266.tar.gz
yuzu-db5f2bfa7ef522a56101776248e7cd0daea6d266.tar.bz2
yuzu-db5f2bfa7ef522a56101776248e7cd0daea6d266.tar.lz
yuzu-db5f2bfa7ef522a56101776248e7cd0daea6d266.tar.xz
yuzu-db5f2bfa7ef522a56101776248e7cd0daea6d266.tar.zst
yuzu-db5f2bfa7ef522a56101776248e7cd0daea6d266.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/textures/texture.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h
index 9d443ea90..58cbb2115 100644
--- a/src/video_core/textures/texture.h
+++ b/src/video_core/textures/texture.h
@@ -4,6 +4,7 @@
#pragma once
+#include "common/assert.h"
#include "common/bit_field.h"
#include "common/common_funcs.h"
#include "common/common_types.h"
@@ -57,6 +58,8 @@ union TextureHandle {
static_assert(sizeof(TextureHandle) == 4, "TextureHandle has wrong size");
struct TICEntry {
+ static constexpr u32 DefaultBlockHeight = 16;
+
union {
u32 raw;
BitField<0, 7, TextureFormat> format;
@@ -70,7 +73,12 @@ struct TICEntry {
BitField<0, 16, u32> address_high;
BitField<21, 3, TICHeaderVersion> header_version;
};
- INSERT_PADDING_BYTES(4);
+ union {
+ BitField<3, 3, u32> block_height;
+
+ // High 16 bits of the pitch value
+ BitField<0, 16, u32> pitch_high;
+ };
union {
BitField<0, 16, u32> width_minus_1;
BitField<23, 4, TextureType> texture_type;
@@ -82,6 +90,13 @@ struct TICEntry {
return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) | address_low);
}
+ u32 Pitch() const {
+ ASSERT(header_version == TICHeaderVersion::Pitch ||
+ header_version == TICHeaderVersion::PitchColorKey);
+ // The pitch value is 21 bits, and is 32B aligned.
+ return pitch_high << 5;
+ }
+
u32 Width() const {
return width_minus_1 + 1;
}