summaryrefslogtreecommitdiff
path: root/src/video_core/textures/texture.h
diff options
context:
space:
mode:
authorGravatar bunnei2018-04-07 18:46:16 -0400
committerGravatar GitHub2018-04-07 18:46:16 -0400
commit227bc78cbefef0866fc39db1383ea4f012583e11 (patch)
tree4b6979d7483cf98463afa394d2e11001e91aa195 /src/video_core/textures/texture.h
parentMerge pull request #315 from jroweboy/spelling-fix (diff)
parentFix clang format issues (diff)
downloadyuzu-227bc78cbefef0866fc39db1383ea4f012583e11.tar.gz
yuzu-227bc78cbefef0866fc39db1383ea4f012583e11.tar.xz
yuzu-227bc78cbefef0866fc39db1383ea4f012583e11.zip
Merge pull request #314 from jroweboy/tegra-progress-3b
GPU: Bind uploaded textures when drawing (Rebased)
Diffstat (limited to 'src/video_core/textures/texture.h')
-rw-r--r--src/video_core/textures/texture.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h
index 07936f8a3..c12ed6e1d 100644
--- a/src/video_core/textures/texture.h
+++ b/src/video_core/textures/texture.h
@@ -37,6 +37,16 @@ enum class TICHeaderVersion : u32 {
37 BlockLinearColorKey = 4, 37 BlockLinearColorKey = 4,
38}; 38};
39 39
40enum class ComponentType : u32 {
41 SNORM = 1,
42 UNORM = 2,
43 SINT = 3,
44 UINT = 4,
45 SNORM_FORCE_FP16 = 5,
46 UNORM_FORCE_FP16 = 6,
47 FLOAT = 7
48};
49
40union TextureHandle { 50union TextureHandle {
41 u32 raw; 51 u32 raw;
42 BitField<0, 20, u32> tic_id; 52 BitField<0, 20, u32> tic_id;
@@ -48,10 +58,10 @@ struct TICEntry {
48 union { 58 union {
49 u32 raw; 59 u32 raw;
50 BitField<0, 7, TextureFormat> format; 60 BitField<0, 7, TextureFormat> format;
51 BitField<7, 3, u32> r_type; 61 BitField<7, 3, ComponentType> r_type;
52 BitField<10, 3, u32> g_type; 62 BitField<10, 3, ComponentType> g_type;
53 BitField<13, 3, u32> b_type; 63 BitField<13, 3, ComponentType> b_type;
54 BitField<16, 3, u32> a_type; 64 BitField<16, 3, ComponentType> a_type;
55 }; 65 };
56 u32 address_low; 66 u32 address_low;
57 union { 67 union {
@@ -77,6 +87,11 @@ struct TICEntry {
77 u32 Height() const { 87 u32 Height() const {
78 return height_minus_1 + 1; 88 return height_minus_1 + 1;
79 } 89 }
90
91 bool IsTiled() const {
92 return header_version == TICHeaderVersion::BlockLinear ||
93 header_version == TICHeaderVersion::BlockLinearColorKey;
94 }
80}; 95};
81static_assert(sizeof(TICEntry) == 0x20, "TICEntry has wrong size"); 96static_assert(sizeof(TICEntry) == 0x20, "TICEntry has wrong size");
82 97