Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5564 | serge | 1 | /* |
2 | Copyright (C) Intel Corp. 2006. All Rights Reserved. |
||
3 | Intel funded Tungsten Graphics to |
||
4 | develop this 3D driver. |
||
5 | |||
6 | Permission is hereby granted, free of charge, to any person obtaining |
||
7 | a 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, sublicense, 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: |
||
13 | |||
14 | The above copyright notice and this permission notice (including the |
||
15 | next paragraph) shall be included in all copies or substantial |
||
16 | portions of the Software. |
||
17 | |||
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||
19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||
20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
||
21 | IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE |
||
22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
||
23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
||
24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
||
25 | |||
26 | **********************************************************************/ |
||
27 | /* |
||
28 | * Authors: |
||
29 | * Keith Whitwell |
||
30 | */ |
||
31 | |||
32 | |||
33 | #include |
||
34 | |||
35 | #include "main/mtypes.h" |
||
36 | #include "program/prog_parameter.h" |
||
37 | #include "brw_util.h" |
||
38 | #include "brw_defines.h" |
||
39 | |||
40 | GLuint brw_translate_blend_equation( GLenum mode ) |
||
41 | { |
||
42 | switch (mode) { |
||
43 | case GL_FUNC_ADD: |
||
44 | return BRW_BLENDFUNCTION_ADD; |
||
45 | case GL_MIN: |
||
46 | return BRW_BLENDFUNCTION_MIN; |
||
47 | case GL_MAX: |
||
48 | return BRW_BLENDFUNCTION_MAX; |
||
49 | case GL_FUNC_SUBTRACT: |
||
50 | return BRW_BLENDFUNCTION_SUBTRACT; |
||
51 | case GL_FUNC_REVERSE_SUBTRACT: |
||
52 | return BRW_BLENDFUNCTION_REVERSE_SUBTRACT; |
||
53 | default: |
||
54 | unreachable("not reached"); |
||
55 | } |
||
56 | } |
||
57 | |||
58 | GLuint brw_translate_blend_factor( GLenum factor ) |
||
59 | { |
||
60 | switch(factor) { |
||
61 | case GL_ZERO: |
||
62 | return BRW_BLENDFACTOR_ZERO; |
||
63 | case GL_SRC_ALPHA: |
||
64 | return BRW_BLENDFACTOR_SRC_ALPHA; |
||
65 | case GL_ONE: |
||
66 | return BRW_BLENDFACTOR_ONE; |
||
67 | case GL_SRC_COLOR: |
||
68 | return BRW_BLENDFACTOR_SRC_COLOR; |
||
69 | case GL_ONE_MINUS_SRC_COLOR: |
||
70 | return BRW_BLENDFACTOR_INV_SRC_COLOR; |
||
71 | case GL_DST_COLOR: |
||
72 | return BRW_BLENDFACTOR_DST_COLOR; |
||
73 | case GL_ONE_MINUS_DST_COLOR: |
||
74 | return BRW_BLENDFACTOR_INV_DST_COLOR; |
||
75 | case GL_ONE_MINUS_SRC_ALPHA: |
||
76 | return BRW_BLENDFACTOR_INV_SRC_ALPHA; |
||
77 | case GL_DST_ALPHA: |
||
78 | return BRW_BLENDFACTOR_DST_ALPHA; |
||
79 | case GL_ONE_MINUS_DST_ALPHA: |
||
80 | return BRW_BLENDFACTOR_INV_DST_ALPHA; |
||
81 | case GL_SRC_ALPHA_SATURATE: |
||
82 | return BRW_BLENDFACTOR_SRC_ALPHA_SATURATE; |
||
83 | case GL_CONSTANT_COLOR: |
||
84 | return BRW_BLENDFACTOR_CONST_COLOR; |
||
85 | case GL_ONE_MINUS_CONSTANT_COLOR: |
||
86 | return BRW_BLENDFACTOR_INV_CONST_COLOR; |
||
87 | case GL_CONSTANT_ALPHA: |
||
88 | return BRW_BLENDFACTOR_CONST_ALPHA; |
||
89 | case GL_ONE_MINUS_CONSTANT_ALPHA: |
||
90 | return BRW_BLENDFACTOR_INV_CONST_ALPHA; |
||
91 | |||
92 | case GL_SRC1_COLOR: |
||
93 | return BRW_BLENDFACTOR_SRC1_COLOR; |
||
94 | case GL_SRC1_ALPHA: |
||
95 | return BRW_BLENDFACTOR_SRC1_ALPHA; |
||
96 | case GL_ONE_MINUS_SRC1_COLOR: |
||
97 | return BRW_BLENDFACTOR_INV_SRC1_COLOR; |
||
98 | case GL_ONE_MINUS_SRC1_ALPHA: |
||
99 | return BRW_BLENDFACTOR_INV_SRC1_ALPHA; |
||
100 | |||
101 | default: |
||
102 | unreachable("not reached"); |
||
103 | } |
||
104 | } |