Skip to main content

source_vtf/header/
flags.rs

1use bitflags::bitflags;
2
3bitflags! {
4    /// Flags stored in the VTF header
5    ///
6    /// Later branches reused some bits, so those flags carry the version they mean that in, e.g. `SRGB_V7_4` vs `PWL_CORRECTED_V7_5`
7    #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
8    #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9    pub struct TextureFlags: u32 {
10        const POINT_SAMPLE = 1 << 0;
11        const TRILINEAR = 1 << 1;
12        const CLAMP_S = 1 << 2;
13        const CLAMP_T = 1 << 3;
14        const ANISOTROPIC = 1 << 4;
15        const VTEX_HINT_DXT5 = 1 << 5;
16        // Oh yeah nice thx Valve: one bit, three meanings :skull:
17        const VTEX_NO_COMPRESS_V7_0 = 1 << 6;
18        const SRGB_V7_4 = 1 << 6;
19        const PWL_CORRECTED_V7_5 = 1 << 6;
20        const NORMAL = 1 << 7;
21        const NO_MIP = 1 << 8;
22        const NO_LOD = 1 << 9;
23        const LOAD_SMALL_MIPS_V7_0 = 1 << 10;
24        const LOAD_ALL_MIPS_V7_3 = 1 << 10;
25        const PROCEDURAL = 1 << 11;
26        const ONE_BIT_ALPHA = 1 << 12;
27        const MULTI_BIT_ALPHA = 1 << 13;
28        const ENVMAP = 1 << 14;
29        const RENDER_TARGET = 1 << 15;
30        const DEPTH_RENDER_TARGET = 1 << 16;
31        const NO_DEBUG_OVERRIDE = 1 << 17;
32        const SINGLE_COPY = 1 << 18;
33        const VTEX_ONE_OVER_MIP_LEVEL_IN_ALPHA = 1 << 19;
34        const TF2_STAGING_MEMORY_V7_4 = 1 << 19;
35        const SRGB_V7_5 = 1 << 19;
36        const VTEX_PREMULTIPLY_COLOR_BY_ONE_OVER_MIP_LEVEL = 1 << 20;
37        const TF2_IMMEDIATE_CLEANUP_V7_4 = 1 << 20;
38        const DEFAULT_POOL_V7_5 = 1 << 20;
39        const VTEX_CONVERT_NORMAL_TO_DUDV = 1 << 21;
40        const TF2_IGNORE_PICMIP_V7_4 = 1 << 21;
41        const CSGO_COMBINED_V7_5 = 1 << 21;
42        const VTEX_ALPHA_TEST_MIP_GENERATION = 1 << 22;
43        const CSGO_ASYNC_DOWNLOAD_V7_5 = 1 << 22;
44        const NO_DEPTH_BUFFER = 1 << 23;
45        const VTEX_NICE_FILTERED = 1 << 24;
46        const CSGO_SKIP_INITIAL_DOWNLOAD_V7_5 = 1 << 24;
47        const CLAMP_U = 1 << 25;
48        const VERTEX_TEXTURE_V7_3 = 1 << 26;
49        const SSBUMP_V7_3 = 1 << 27;
50        const LOAD_MOST_MIPS_V7_5 = 1 << 28;
51        const BORDER = 1 << 29;
52        const TF2_STREAMABLE_COARSE_V7_4 = 1 << 30;
53        const CSGO_YCOCG_V7_5 = 1 << 30;
54        const TF2_STREAMABLE_FINE_V7_4 = 1 << 31;
55        const CSGO_ASYNC_SKIP_INITIAL_LOW_RES_V7_5 = 1 << 31;
56    }
57}