1 //
2 //------------------------------------------------------------
3 // Copyright(c) 2009-2010 by Digital Media Professionals Inc.
4 // All rights reserved.
5 //------------------------------------------------------------
6 // This source code is the confidential and proprietary
7 // of Digital Media Professionals Inc.
8 //------------------------------------------------------------
9 //
10 
11 //------------------------------------------
12 //  related cmp
13 //------------------------------------------
14 #define CMP_MODE_EQ         0
15 #define CMP_MODE_NE         1
16 #define CMP_MODE_LT         2
17 #define CMP_MODE_LE         3
18 #define CMP_MODE_GT         4
19 #define CMP_MODE_GE         5
20 
21 //------------------------------------------
22 //  related condition
23 //------------------------------------------
24 #define COND_MODE_OR        0
25 #define COND_MODE_AND       1
26 #define COND_MODE_STA0      2
27 #define COND_MODE_STA1      3
28 
29 //------------------------------------------
30 //  related status reg
31 //------------------------------------------
32 #define STAT0_0             0
33 #define STAT0_1             1
34 #define STAT1_0             0
35 #define STAT1_1             1
36 
37 // Constant registers map
38 #define dmp_projection_matrix           c0
39 #define dmp_local_to_view_matrix        c4
40 #define dmp_local_to_world_matrix       c8
41 // default input registers
42 #define dmp_position                    v0
43 #define dmp_normal                      v1
44 #define dmp_tangent                     v2
45 
46 // default output registers
47 #define gl_Position                     o0
48 #define dmp_lrQuat                      o1
49 #define dmp_lrView                      o2
50 #define gl_TexCoord0                    o3
51 
52 #define EQ                  0
53 #define NEQ                 1
54 #define LESS                2
55 #define LEQ                 3
56 #define GT                  4
57 #define GEQ                 5
58 
59 // Temporary registers map
60 #define TEMP0               r0
61 #define TEMP1               r1
62 #define TEMP2               r2
63 #define TEMP3               r3
64 #define TEMP4               r4
65 
66 #define TEMP_TEX0           r10
67 #define TEMP_TEX1           r11
68 #define TEMP_TEX2           r12
69 #define TEMP_TEX3           r13
70 #define TEMP_TANG           r13
71 #define TEMP_NORM           r14
72 #define TEMP_VIEW           r15
73 #define TEMP_POS            r12
74 
75 // Constant registers
76 #define CONSTANT            c93
77 
78 def     CONSTANT[0], 0.0, 1.0, 2.0, 3.0
79 def     CONSTANT[1], 0.125, 0.00390625, 0.5, 0.25
80 
81 #define CONST_0                 CONSTANT[0].x
82 #define CONST_1                 CONSTANT[0].y
83 #define CONST_2                 CONSTANT[0].z
84 #define CONST_3                 CONSTANT[0].w
85 #define CONST_HALF              CONSTANT[1].z
86 #define CONST_QUARTER           CONSTANT[1].w
87 #define CONST_1_0               CONSTANT[0].yx
88 #define CONST_1__4              CONSTANT[1].w
89 #define CONST_1__8              CONSTANT[1].x
90 #define CONST_1__256            CONSTANT[1].y
91 
92