1 #ifndef __NV_SHADERS_H__
2 #define __NV_SHADERS_H__
4 #define NV_SHADER_MAX_PROGRAM_LENGTH 256
6 typedef struct nv_shader {
18 uint32_t data[NV_SHADER_MAX_PROGRAM_LENGTH];
21 /*******************************************************************************
22 * NV40/G70 vertex shaders
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,
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,
39 /*******************************************************************************
40 * NV30/NV40/G70 fragment shaders
43 static nv_shader_t nv30_fp_pass_col0 = {
44 .card_priv.NV30FP.num_regs = 2,
47 /* MOV R0, fragment.color */
48 0x01403e81, 0x1c9dc801, 0x0001c800, 0x3fe1c800
52 static nv_shader_t nv30_fp_pass_tex0 = {
53 .card_priv.NV30FP.num_regs = 2,
56 /* TEX R0, fragment.texcoord[0], texture[0], 2D */
57 0x17009e00, 0x1c9dc801, 0x0001c800, 0x3fe1c800,
59 0x01401e81, 0x1c9dc800, 0x0001c800, 0x0001c800
63 static nv_shader_t nv30_fp_composite_mask = {
64 .card_priv.NV30FP.num_regs = 2,
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
76 static nv_shader_t nv30_fp_composite_mask_sa_ca = {
77 .card_priv.NV30FP.num_regs = 2,
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
89 static nv_shader_t nv30_fp_composite_mask_ca = {
90 .card_priv.NV30FP.num_regs = 2,
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,
98 0x02001e81, 0x1c9dc800, 0x0001c804, 0x0001c800