Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / r300 / r300_vertprog.h
1 #ifndef __R300_VERTPROG_H_
2 #define __R300_VERTPROG_H_
3
4 #include "r300_reg.h"
5
6 #define VSF_FLAG_X 1
7 #define VSF_FLAG_Y 2
8 #define VSF_FLAG_Z 4
9 #define VSF_FLAG_W 8
10 #define VSF_FLAG_XYZ (VSF_FLAG_X | VSF_FLAG_Y | VSF_FLAG_Z)
11 #define VSF_FLAG_ALL 0xf
12 #define VSF_FLAG_NONE 0
13
14 #define VSF_OUT_CLASS_TMP 0
15 #define VSF_OUT_CLASS_ADDR 1
16 #define VSF_OUT_CLASS_RESULT 2
17
18 /* first DWORD of an instruction */
19
20 /* possible operations:
21 DOT, MUL, ADD, MAD, FRC, MAX, MIN, SGE, SLT, EXP, LOG, LIT, POW, RCP, RSQ, EX2,
22 LG2, MAD_2 */
23
24 #define MAKE_VSF_OP(op, out_reg_index, out_reg_fields, class) \
25 ((op) \
26 | ((out_reg_index) << R300_VPI_OUT_REG_INDEX_SHIFT) \
27 | ((out_reg_fields) << 20) \
28 | ( (class) << 8 ) )
29
30 #define EASY_VSF_OP(op, out_reg_index, out_reg_fields, class) \
31 MAKE_VSF_OP(R300_VPI_OUT_OP_##op, out_reg_index, VSF_FLAG_##out_reg_fields, VSF_OUT_CLASS_##class) \
32
33 /* according to Nikolai, the subsequent 3 DWORDs are sources, use same define for each */
34
35 #define VSF_IN_CLASS_TMP 0
36 #define VSF_IN_CLASS_ATTR 1
37 #define VSF_IN_CLASS_PARAM 2
38 #define VSF_IN_CLASS_NONE 9
39
40 #define VSF_IN_COMPONENT_X 0
41 #define VSF_IN_COMPONENT_Y 1
42 #define VSF_IN_COMPONENT_Z 2
43 #define VSF_IN_COMPONENT_W 3
44 #define VSF_IN_COMPONENT_ZERO 4
45 #define VSF_IN_COMPONENT_ONE 5
46
47 #define MAKE_VSF_SOURCE(in_reg_index, comp_x, comp_y, comp_z, comp_w, class, negate) \
48 ( ((in_reg_index)<<R300_VPI_IN_REG_INDEX_SHIFT) \
49 | ((comp_x)<<R300_VPI_IN_X_SHIFT) \
50 | ((comp_y)<<R300_VPI_IN_Y_SHIFT) \
51 | ((comp_z)<<R300_VPI_IN_Z_SHIFT) \
52 | ((comp_w)<<R300_VPI_IN_W_SHIFT) \
53 | ((negate)<<25) | ((class)))
54
55 #define EASY_VSF_SOURCE(in_reg_index, comp_x, comp_y, comp_z, comp_w, class, negate) \
56 MAKE_VSF_SOURCE(in_reg_index, \
57 VSF_IN_COMPONENT_##comp_x, \
58 VSF_IN_COMPONENT_##comp_y, \
59 VSF_IN_COMPONENT_##comp_z, \
60 VSF_IN_COMPONENT_##comp_w, \
61 VSF_IN_CLASS_##class, VSF_FLAG_##negate)
62
63 /* special sources: */
64
65 /* (1.0,1.0,1.0,1.0) vector (ATTR, plain ) */
66 #define VSF_ATTR_UNITY(reg) EASY_VSF_SOURCE(reg, ONE, ONE, ONE, ONE, ATTR, NONE)
67 #define VSF_UNITY(reg) EASY_VSF_SOURCE(reg, ONE, ONE, ONE, ONE, NONE, NONE)
68
69 /* contents of unmodified register */
70 #define VSF_REG(reg) EASY_VSF_SOURCE(reg, X, Y, Z, W, ATTR, NONE)
71
72 /* contents of unmodified parameter */
73 #define VSF_PARAM(reg) EASY_VSF_SOURCE(reg, X, Y, Z, W, PARAM, NONE)
74
75 /* contents of unmodified temporary register */
76 #define VSF_TMP(reg) EASY_VSF_SOURCE(reg, X, Y, Z, W, TMP, NONE)
77
78 /* components of ATTR register */
79 #define VSF_ATTR_X(reg) EASY_VSF_SOURCE(reg, X, X, X, X, ATTR, NONE)
80 #define VSF_ATTR_Y(reg) EASY_VSF_SOURCE(reg, Y, Y, Y, Y, ATTR, NONE)
81 #define VSF_ATTR_Z(reg) EASY_VSF_SOURCE(reg, Z, Z, Z, Z, ATTR, NONE)
82 #define VSF_ATTR_W(reg) EASY_VSF_SOURCE(reg, W, W, W, W, ATTR, NONE)
83
84 #endif