aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/aux/tgsi/util/tgsi_util.h
blob: ef14446f0e4dd427fac392df4d387f676ece4a0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#if !defined TGSI_UTIL_H
#define TGSI_UTIL_H

#if defined __cplusplus
extern "C" {
#endif // defined __cplusplus

void *
tgsi_align_128bit(
   void *unaligned );

unsigned
tgsi_util_get_src_register_swizzle(
   const struct tgsi_src_register *reg,
   unsigned component );

unsigned
tgsi_util_get_src_register_extswizzle(
   const struct tgsi_src_register_ext_swz *reg,
   unsigned component);

unsigned
tgsi_util_get_full_src_register_extswizzle(
   const struct tgsi_full_src_register *reg,
   unsigned component );

void
tgsi_util_set_src_register_swizzle(
   struct tgsi_src_register *reg,
   unsigned swizzle,
   unsigned component );

void
tgsi_util_set_src_register_extswizzle(
   struct tgsi_src_register_ext_swz *reg,
   unsigned swizzle,
   unsigned component );

unsigned
tgsi_util_get_src_register_extnegate(
   const struct tgsi_src_register_ext_swz *reg,
   unsigned component );

void
tgsi_util_set_src_register_extnegate(
   struct tgsi_src_register_ext_swz *reg,
   unsigned negate,
   unsigned component );

#define TGSI_UTIL_SIGN_CLEAR    0   /* Force positive */
#define TGSI_UTIL_SIGN_SET      1   /* Force negative */
#define TGSI_UTIL_SIGN_TOGGLE   2   /* Negate */
#define TGSI_UTIL_SIGN_KEEP     3   /* No change */

unsigned
tgsi_util_get_full_src_register_sign_mode(
   const struct tgsi_full_src_register *reg,
   unsigned component );

void
tgsi_util_set_full_src_register_sign_mode(
   struct tgsi_full_src_register *reg,
   unsigned sign_mode );

#if defined __cplusplus
} // extern "C"
#endif // defined __cplusplus

#endif // !defined TGSI_UTIL_H