Tizen 2.0 Release
[profile/ivi/osmesa.git] / src / mesa / x86 / x86_xform.h
1
2 /*
3  * Mesa 3-D graphics library
4  * Version:  3.5
5  *
6  * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining a
9  * copy of this software and associated documentation files (the "Software"),
10  * to deal in the Software without restriction, including without limitation
11  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12  * and/or sell copies of the Software, and to permit persons to whom the
13  * Software is furnished to do so, subject to the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be included
16  * in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
21  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  *
25  * Authors:
26  *    Gareth Hughes
27  */
28
29 #ifndef X86_XFORM_H
30 #define X86_XFORM_H
31
32
33 /* =============================================================
34  * Transformation function declarations:
35  */
36
37 #define XFORM_ARGS      GLvector4f *to_vec,                             \
38                         const GLfloat m[16],                            \
39                         const GLvector4f *from_vec
40
41 #define DECLARE_XFORM_GROUP( pfx, sz ) \
42 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_general( XFORM_ARGS );         \
43 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_identity( XFORM_ARGS );        \
44 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d_no_rot( XFORM_ARGS );       \
45 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_perspective( XFORM_ARGS );     \
46 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d( XFORM_ARGS );              \
47 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d_no_rot( XFORM_ARGS );       \
48 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d( XFORM_ARGS );
49
50 #define ASSIGN_XFORM_GROUP( pfx, sz )                                   \
51    _mesa_transform_tab[sz][MATRIX_GENERAL] =                            \
52       _mesa_##pfx##_transform_points##sz##_general;                     \
53    _mesa_transform_tab[sz][MATRIX_IDENTITY] =                           \
54       _mesa_##pfx##_transform_points##sz##_identity;                    \
55    _mesa_transform_tab[sz][MATRIX_3D_NO_ROT] =                          \
56       _mesa_##pfx##_transform_points##sz##_3d_no_rot;                   \
57    _mesa_transform_tab[sz][MATRIX_PERSPECTIVE] =                        \
58       _mesa_##pfx##_transform_points##sz##_perspective;                 \
59    _mesa_transform_tab[sz][MATRIX_2D] =                                 \
60       _mesa_##pfx##_transform_points##sz##_2d;                          \
61    _mesa_transform_tab[sz][MATRIX_2D_NO_ROT] =                          \
62       _mesa_##pfx##_transform_points##sz##_2d_no_rot;                   \
63    _mesa_transform_tab[sz][MATRIX_3D] =                                 \
64       _mesa_##pfx##_transform_points##sz##_3d;
65
66
67 /* =============================================================
68  * Normal transformation function declarations:
69  */
70
71 #define NORM_ARGS       const GLmatrix *mat,                            \
72                         GLfloat scale,                                  \
73                         const GLvector4f *in,                           \
74                         const GLfloat *lengths,                         \
75                         GLvector4f *dest
76
77 #define DECLARE_NORM_GROUP( pfx ) \
78 extern void _ASMAPI _mesa_##pfx##_rescale_normals( NORM_ARGS );                         \
79 extern void _ASMAPI _mesa_##pfx##_normalize_normals( NORM_ARGS );                       \
80 extern void _ASMAPI _mesa_##pfx##_transform_normals( NORM_ARGS );                       \
81 extern void _ASMAPI _mesa_##pfx##_transform_normals_no_rot( NORM_ARGS );                \
82 extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals( NORM_ARGS );               \
83 extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals_no_rot( NORM_ARGS );        \
84 extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals( NORM_ARGS );             \
85 extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals_no_rot( NORM_ARGS );
86
87 #define ASSIGN_NORM_GROUP( pfx )                                        \
88    _mesa_normal_tab[NORM_RESCALE] =                                     \
89       _mesa_##pfx##_rescale_normals;                                    \
90    _mesa_normal_tab[NORM_NORMALIZE] =                                   \
91       _mesa_##pfx##_normalize_normals;                                  \
92    _mesa_normal_tab[NORM_TRANSFORM] =                                   \
93       _mesa_##pfx##_transform_normals;                                  \
94    _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] =                            \
95       _mesa_##pfx##_transform_normals_no_rot;                           \
96    _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] =                    \
97       _mesa_##pfx##_transform_rescale_normals;                          \
98    _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] =             \
99       _mesa_##pfx##_transform_rescale_normals_no_rot;                   \
100    _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE] =                  \
101       _mesa_##pfx##_transform_normalize_normals;                        \
102    _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE] =           \
103       _mesa_##pfx##_transform_normalize_normals_no_rot;
104
105
106 #endif