diff options
| author | 2018-03-26 15:45:05 -0500 | |
|---|---|---|
| committer | 2018-03-26 15:45:05 -0500 | |
| commit | 56e2013c1fa849b12b30efaa9c01a685a8302d13 (patch) | |
| tree | faa37ee8bf6eb04e7b12a238e03b3d836ade4054 /src | |
| parent | GPU: Added more fields to the TIC structure. (diff) | |
| download | yuzu-56e2013c1fa849b12b30efaa9c01a685a8302d13.tar.gz yuzu-56e2013c1fa849b12b30efaa9c01a685a8302d13.tar.xz yuzu-56e2013c1fa849b12b30efaa9c01a685a8302d13.zip | |
GPU: Added the TSC structure. It contains information about the sampler.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/textures/texture.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h index ac3b110fc..07936f8a3 100644 --- a/src/video_core/textures/texture.h +++ b/src/video_core/textures/texture.h | |||
| @@ -80,6 +80,56 @@ struct TICEntry { | |||
| 80 | }; | 80 | }; |
| 81 | static_assert(sizeof(TICEntry) == 0x20, "TICEntry has wrong size"); | 81 | static_assert(sizeof(TICEntry) == 0x20, "TICEntry has wrong size"); |
| 82 | 82 | ||
| 83 | enum class WrapMode : u32 { | ||
| 84 | Wrap = 0, | ||
| 85 | Mirror = 1, | ||
| 86 | ClampToEdge = 2, | ||
| 87 | Border = 3, | ||
| 88 | ClampOGL = 4, | ||
| 89 | MirrorOnceClampToEdge = 5, | ||
| 90 | MirrorOnceBorder = 6, | ||
| 91 | MirrorOnceClampOGL = 7, | ||
| 92 | }; | ||
| 93 | |||
| 94 | enum class TextureFilter : u32 { | ||
| 95 | Nearest = 1, | ||
| 96 | Linear = 2, | ||
| 97 | }; | ||
| 98 | |||
| 99 | enum class TextureMipmapFilter : u32 { | ||
| 100 | None = 1, | ||
| 101 | Nearest = 2, | ||
| 102 | Linear = 3, | ||
| 103 | }; | ||
| 104 | |||
| 105 | struct TSCEntry { | ||
| 106 | union { | ||
| 107 | BitField<0, 3, WrapMode> wrap_u; | ||
| 108 | BitField<3, 3, WrapMode> wrap_v; | ||
| 109 | BitField<6, 3, WrapMode> wrap_p; | ||
| 110 | BitField<9, 1, u32> depth_compare_enabled; | ||
| 111 | BitField<10, 3, u32> depth_compare_func; | ||
| 112 | }; | ||
| 113 | union { | ||
| 114 | BitField<0, 2, TextureFilter> mag_filter; | ||
| 115 | BitField<4, 2, TextureFilter> min_filter; | ||
| 116 | BitField<6, 2, TextureMipmapFilter> mip_filter; | ||
| 117 | }; | ||
| 118 | INSERT_PADDING_BYTES(8); | ||
| 119 | u32 border_color_r; | ||
| 120 | u32 border_color_g; | ||
| 121 | u32 border_color_b; | ||
| 122 | u32 border_color_a; | ||
| 123 | }; | ||
| 124 | static_assert(sizeof(TSCEntry) == 0x20, "TSCEntry has wrong size"); | ||
| 125 | |||
| 126 | struct FullTextureInfo { | ||
| 127 | u32 index; | ||
| 128 | TICEntry tic; | ||
| 129 | TSCEntry tsc; | ||
| 130 | bool enabled; | ||
| 131 | }; | ||
| 132 | |||
| 83 | /// Returns the number of bytes per pixel of the input texture format. | 133 | /// Returns the number of bytes per pixel of the input texture format. |
| 84 | u32 BytesPerPixel(TextureFormat format); | 134 | u32 BytesPerPixel(TextureFormat format); |
| 85 | 135 | ||