2 * Copyright © 2012 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 FN_NAME(struct gl_context
*ctx
,
34 case GL_RED_INTEGER_EXT
:
36 dst
[i
] = SRC_CONVERT(rgba
[i
][RCOMP
]);
40 case GL_GREEN_INTEGER_EXT
:
42 dst
[i
] = SRC_CONVERT(rgba
[i
][GCOMP
]);
46 case GL_BLUE_INTEGER_EXT
:
48 dst
[i
] = SRC_CONVERT(rgba
[i
][BCOMP
]);
52 case GL_ALPHA_INTEGER_EXT
:
54 dst
[i
] = SRC_CONVERT(rgba
[i
][ACOMP
]);
60 dst
[i
*2+0] = SRC_CONVERT(rgba
[i
][RCOMP
]);
61 dst
[i
*2+1] = SRC_CONVERT(rgba
[i
][GCOMP
]);
65 case GL_RGB_INTEGER_EXT
:
67 dst
[i
*3+0] = SRC_CONVERT(rgba
[i
][RCOMP
]);
68 dst
[i
*3+1] = SRC_CONVERT(rgba
[i
][GCOMP
]);
69 dst
[i
*3+2] = SRC_CONVERT(rgba
[i
][BCOMP
]);
73 case GL_RGBA_INTEGER_EXT
:
75 dst
[i
*4+0] = SRC_CONVERT(rgba
[i
][RCOMP
]);
76 dst
[i
*4+1] = SRC_CONVERT(rgba
[i
][GCOMP
]);
77 dst
[i
*4+2] = SRC_CONVERT(rgba
[i
][BCOMP
]);
78 dst
[i
*4+3] = SRC_CONVERT(rgba
[i
][ACOMP
]);
82 case GL_BGR_INTEGER_EXT
:
84 dst
[i
*3+0] = SRC_CONVERT(rgba
[i
][BCOMP
]);
85 dst
[i
*3+1] = SRC_CONVERT(rgba
[i
][GCOMP
]);
86 dst
[i
*3+2] = SRC_CONVERT(rgba
[i
][RCOMP
]);
90 case GL_BGRA_INTEGER_EXT
:
92 dst
[i
*4+0] = SRC_CONVERT(rgba
[i
][BCOMP
]);
93 dst
[i
*4+1] = SRC_CONVERT(rgba
[i
][GCOMP
]);
94 dst
[i
*4+2] = SRC_CONVERT(rgba
[i
][RCOMP
]);
95 dst
[i
*4+3] = SRC_CONVERT(rgba
[i
][ACOMP
]);
99 case GL_LUMINANCE_INTEGER_EXT
:
101 dst
[i
] = SRC_CONVERT(rgba
[i
][RCOMP
] +
107 case GL_LUMINANCE_ALPHA_INTEGER_EXT
:
109 dst
[i
*2+0] = SRC_CONVERT(rgba
[i
][RCOMP
] +
112 dst
[i
*2+1] = SRC_CONVERT(rgba
[i
][ACOMP
]);
118 "Unsupported format (%s)",
119 _mesa_lookup_enum_by_nr(dstFormat
));