Xv: work around some overlay bandwidth problems - may break things though
[nouveau] / src / nv_shaders.h
1 #ifndef __NV_SHADERS_H__
2 #define __NV_SHADERS_H__
3
4 #define NV_SHADER_MAX_PROGRAM_LENGTH 256
5
6 typedef struct nv_shader {
7         uint32_t hw_id;
8         uint32_t size;
9         union {
10                 struct {
11                         uint32_t vp_in_reg;
12                         uint32_t vp_out_reg;
13                 } NV30VP;
14                 struct  {
15                         uint32_t num_regs;
16                 } NV30FP;
17         } card_priv;
18         uint32_t data[NV_SHADER_MAX_PROGRAM_LENGTH];
19 } nv_shader_t;
20
21 /*******************************************************************************
22  * NV40/G70 vertex shaders
23  */
24
25 static nv_shader_t nv40_vp_exa_render = {
26   .card_priv.NV30VP.vp_in_reg  = 0x00000309,
27   .card_priv.NV30VP.vp_out_reg = 0x0000c001,
28   .size = (3*4),
29   .data = {
30     /* MOV result.position, vertex.position */
31     0x40041c6c, 0x0040000d, 0x8106c083, 0x6041ff80,
32     /* MOV result.texcoord[0], vertex.texcoord[0] */
33     0x401f9c6c, 0x0040080d, 0x8106c083, 0x6041ff9c,
34     /* MOV result.texcoord[1], vertex.texcoord[1] */
35     0x401f9c6c, 0x0040090d, 0x8106c083, 0x6041ffa1,
36   }
37 };
38
39 /*******************************************************************************
40  * NV30/NV40/G70 fragment shaders
41  */
42
43 static nv_shader_t nv30_fp_pass_col0 = {
44   .card_priv.NV30FP.num_regs = 2,
45   .size = (1*4),
46   .data = {
47     /* MOV R0, fragment.color */
48     0x01403e81, 0x1c9dc801, 0x0001c800, 0x3fe1c800
49   }
50 };
51
52 static nv_shader_t nv30_fp_pass_tex0 = {
53   .card_priv.NV30FP.num_regs = 2,
54   .size = (2*4),
55   .data = {
56     /* TEX R0, fragment.texcoord[0], texture[0], 2D */
57     0x17009e00, 0x1c9dc801, 0x0001c800, 0x3fe1c800,
58     /* MOV R0, R0 */
59     0x01401e81, 0x1c9dc800, 0x0001c800, 0x0001c800
60   }
61 };
62
63 static nv_shader_t nv30_fp_composite_mask = {
64   .card_priv.NV30FP.num_regs = 2,
65   .size = (3*4),
66   .data = {
67     /* TEXC0 R1.w         , fragment.texcoord[1], texture[1], 2D */
68     0x1702b102, 0x1c9dc801, 0x0001c800, 0x3fe1c800,
69     /* TEX   R0 (NE0.wwww), fragment.texcoord[0], texture[0], 2D */
70     0x17009e00, 0x1ff5c801, 0x0001c800, 0x3fe1c800,
71     /* MUL   R0           , R0, R1.w */
72     0x02001e81, 0x1c9dc800, 0x0001fe04, 0x0001c800
73   }
74 };
75
76 static nv_shader_t nv30_fp_composite_mask_sa_ca = {
77   .card_priv.NV30FP.num_regs = 2,
78   .size = (3*4),
79   .data = {
80     /* TEXC0 R1.w         , fragment.texcoord[0], texture[0], 2D */
81     0x17009102, 0x1c9dc801, 0x0001c800, 0x3fe1c800,
82     /* TEX   R0 (NE0.wwww), fragment.texcoord[1], texture[1], 2D */
83     0x1702be00, 0x1ff5c801, 0x0001c800, 0x3fe1c800,
84     /* MUL   R0           , R1,wwww, R0 */
85     0x02001e81, 0x1c9dfe04, 0x0001c800, 0x0001c800
86   }
87 };
88
89 static nv_shader_t nv30_fp_composite_mask_ca = {
90   .card_priv.NV30FP.num_regs = 2,
91   .size = (3*4),
92   .data = {
93     /* TEXC0 R0           , fragment.texcoord[0], texture[0], 2D */
94     0x17009f00, 0x1c9dc801, 0x0001c800, 0x3fe1c800,
95     /* TEX   R1 (NE0.xyzw), fragment.texcoord[1], texture[1], 2D */
96     0x1702be02, 0x1c95c801, 0x0001c800, 0x3fe1c800,
97     /* MUL   R0           , R0, R1 */
98     0x02001e81, 0x1c9dc800, 0x0001c804, 0x0001c800
99   }
100 };
101
102 #endif