• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2009 Nicolai Haehnle.
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #ifndef RADEON_SWIZZLE_H
7 #define RADEON_SWIZZLE_H
8 
9 #include "radeon_program.h"
10 
11 struct rc_swizzle_split {
12    unsigned char NumPhases;
13    unsigned char Phase[4];
14 };
15 
16 /**
17  * Describe the swizzling capability of target hardware.
18  */
19 struct rc_swizzle_caps {
20    /**
21     * Check whether the given swizzle, absolute and negate combination
22     * can be implemented natively by the hardware for this opcode.
23     *
24     * \return 1 if the swizzle is native for the given opcode
25     */
26    int (*IsNative)(rc_opcode opcode, struct rc_src_register reg);
27 
28    /**
29     * Determine how to split access to the masked channels of the
30     * given source register to obtain ALU-native swizzles.
31     */
32    void (*Split)(struct rc_src_register reg, unsigned int mask, struct rc_swizzle_split *split);
33 };
34 
35 extern const struct rc_swizzle_caps r300_vertprog_swizzle_caps;
36 
37 #endif /* RADEON_SWIZZLE_H */
38