1 /**************************************************************************
3 * Copyright 2003 VMware, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
29 #include "main/glheader.h"
30 #include "main/context.h"
31 #include "main/macros.h"
32 #include "main/enums.h"
35 #include "intel_screen.h"
36 #include "intel_context.h"
39 intel_translate_shadow_compare_func(GLenum func
)
43 return COMPAREFUNC_ALWAYS
;
45 return COMPAREFUNC_LEQUAL
;
47 return COMPAREFUNC_LESS
;
49 return COMPAREFUNC_GEQUAL
;
51 return COMPAREFUNC_GREATER
;
53 return COMPAREFUNC_EQUAL
;
55 return COMPAREFUNC_NOTEQUAL
;
57 return COMPAREFUNC_NEVER
;
60 fprintf(stderr
, "Unknown value in %s: %x\n", __func__
, func
);
61 return COMPAREFUNC_NEVER
;
65 intel_translate_compare_func(GLenum func
)
69 return COMPAREFUNC_NEVER
;
71 return COMPAREFUNC_LESS
;
73 return COMPAREFUNC_LEQUAL
;
75 return COMPAREFUNC_GREATER
;
77 return COMPAREFUNC_GEQUAL
;
79 return COMPAREFUNC_NOTEQUAL
;
81 return COMPAREFUNC_EQUAL
;
83 return COMPAREFUNC_ALWAYS
;
86 fprintf(stderr
, "Unknown value in %s: %x\n", __func__
, func
);
87 return COMPAREFUNC_ALWAYS
;
91 intel_translate_stencil_op(GLenum op
)
95 return STENCILOP_KEEP
;
97 return STENCILOP_ZERO
;
99 return STENCILOP_REPLACE
;
101 return STENCILOP_INCRSAT
;
103 return STENCILOP_DECRSAT
;
105 return STENCILOP_INCR
;
107 return STENCILOP_DECR
;
109 return STENCILOP_INVERT
;
111 return STENCILOP_ZERO
;
116 intel_translate_blend_factor(GLenum factor
)
120 return BLENDFACT_ZERO
;
122 return BLENDFACT_SRC_ALPHA
;
124 return BLENDFACT_ONE
;
126 return BLENDFACT_SRC_COLR
;
127 case GL_ONE_MINUS_SRC_COLOR
:
128 return BLENDFACT_INV_SRC_COLR
;
130 return BLENDFACT_DST_COLR
;
131 case GL_ONE_MINUS_DST_COLOR
:
132 return BLENDFACT_INV_DST_COLR
;
133 case GL_ONE_MINUS_SRC_ALPHA
:
134 return BLENDFACT_INV_SRC_ALPHA
;
136 return BLENDFACT_DST_ALPHA
;
137 case GL_ONE_MINUS_DST_ALPHA
:
138 return BLENDFACT_INV_DST_ALPHA
;
139 case GL_SRC_ALPHA_SATURATE
:
140 return BLENDFACT_SRC_ALPHA_SATURATE
;
141 case GL_CONSTANT_COLOR
:
142 return BLENDFACT_CONST_COLOR
;
143 case GL_ONE_MINUS_CONSTANT_COLOR
:
144 return BLENDFACT_INV_CONST_COLOR
;
145 case GL_CONSTANT_ALPHA
:
146 return BLENDFACT_CONST_ALPHA
;
147 case GL_ONE_MINUS_CONSTANT_ALPHA
:
148 return BLENDFACT_INV_CONST_ALPHA
;
151 fprintf(stderr
, "Unknown value in %s: %x\n", __func__
, factor
);
152 return BLENDFACT_ZERO
;