1 #ifndef __NOUVEAU_GLDEFS_H__
2 #define __NOUVEAU_GLDEFS_H__
5 nvgl_blend_func(unsigned factor
)
8 case PIPE_BLENDFACTOR_ZERO
:
10 case PIPE_BLENDFACTOR_ONE
:
12 case PIPE_BLENDFACTOR_SRC_COLOR
:
14 case PIPE_BLENDFACTOR_INV_SRC_COLOR
:
16 case PIPE_BLENDFACTOR_SRC_ALPHA
:
18 case PIPE_BLENDFACTOR_INV_SRC_ALPHA
:
20 case PIPE_BLENDFACTOR_DST_ALPHA
:
22 case PIPE_BLENDFACTOR_INV_DST_ALPHA
:
24 case PIPE_BLENDFACTOR_DST_COLOR
:
26 case PIPE_BLENDFACTOR_INV_DST_COLOR
:
28 case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE
:
30 case PIPE_BLENDFACTOR_CONST_COLOR
:
32 case PIPE_BLENDFACTOR_INV_CONST_COLOR
:
34 case PIPE_BLENDFACTOR_CONST_ALPHA
:
36 case PIPE_BLENDFACTOR_INV_CONST_ALPHA
:
43 static INLINE
unsigned
44 nvgl_blend_eqn(unsigned func
)
53 case PIPE_BLEND_SUBTRACT
:
55 case PIPE_BLEND_REVERSE_SUBTRACT
:
62 static INLINE
unsigned
63 nvgl_logicop_func(unsigned func
)
66 case PIPE_LOGICOP_CLEAR
:
68 case PIPE_LOGICOP_NOR
:
70 case PIPE_LOGICOP_AND_INVERTED
:
72 case PIPE_LOGICOP_COPY_INVERTED
:
74 case PIPE_LOGICOP_AND_REVERSE
:
76 case PIPE_LOGICOP_INVERT
:
78 case PIPE_LOGICOP_XOR
:
80 case PIPE_LOGICOP_NAND
:
82 case PIPE_LOGICOP_AND
:
84 case PIPE_LOGICOP_EQUIV
:
86 case PIPE_LOGICOP_NOOP
:
88 case PIPE_LOGICOP_OR_INVERTED
:
90 case PIPE_LOGICOP_COPY
:
92 case PIPE_LOGICOP_OR_REVERSE
:
96 case PIPE_LOGICOP_SET
:
103 static INLINE
unsigned
104 nvgl_comparison_op(unsigned op
)
107 case PIPE_FUNC_NEVER
:
111 case PIPE_FUNC_EQUAL
:
113 case PIPE_FUNC_LEQUAL
:
115 case PIPE_FUNC_GREATER
:
117 case PIPE_FUNC_NOTEQUAL
:
119 case PIPE_FUNC_GEQUAL
:
121 case PIPE_FUNC_ALWAYS
:
128 static INLINE
unsigned
129 nvgl_polygon_mode(unsigned mode
)
132 case PIPE_POLYGON_MODE_POINT
:
134 case PIPE_POLYGON_MODE_LINE
:
136 case PIPE_POLYGON_MODE_FILL
:
143 static INLINE
unsigned
144 nvgl_stencil_op(unsigned op
)
147 case PIPE_STENCIL_OP_ZERO
:
149 case PIPE_STENCIL_OP_INVERT
:
151 case PIPE_STENCIL_OP_KEEP
:
153 case PIPE_STENCIL_OP_REPLACE
:
155 case PIPE_STENCIL_OP_INCR
:
157 case PIPE_STENCIL_OP_DECR
:
159 case PIPE_STENCIL_OP_INCR_WRAP
:
161 case PIPE_STENCIL_OP_DECR_WRAP
:
168 static INLINE
unsigned
169 nvgl_primitive(unsigned prim
) {
171 case PIPE_PRIM_POINTS
:
173 case PIPE_PRIM_LINES
:
175 case PIPE_PRIM_LINE_LOOP
:
177 case PIPE_PRIM_LINE_STRIP
:
179 case PIPE_PRIM_TRIANGLES
:
181 case PIPE_PRIM_TRIANGLE_STRIP
:
183 case PIPE_PRIM_TRIANGLE_FAN
:
185 case PIPE_PRIM_QUADS
:
187 case PIPE_PRIM_QUAD_STRIP
:
189 case PIPE_PRIM_POLYGON
: