mesa: Restore 78-column wrapping of license text in C-style comments.
[mesa.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 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 * OTHER DEALINGS IN THE SOFTWARE.
25 *
26 * Authors:
27 * Gareth Hughes
28 */
29
30 #ifndef X86_XFORM_H
31 #define X86_XFORM_H
32
33
34 /* =============================================================
35 * Transformation function declarations:
36 */
37
38 #define XFORM_ARGS GLvector4f *to_vec, \
39 const GLfloat m[16], \
40 const GLvector4f *from_vec
41
42 #define DECLARE_XFORM_GROUP( pfx, sz ) \
43 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_general( XFORM_ARGS ); \
44 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_identity( XFORM_ARGS ); \
45 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d_no_rot( XFORM_ARGS ); \
46 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_perspective( XFORM_ARGS ); \
47 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d( XFORM_ARGS ); \
48 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d_no_rot( XFORM_ARGS ); \
49 extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d( XFORM_ARGS );
50
51 #define ASSIGN_XFORM_GROUP( pfx, sz ) \
52 _mesa_transform_tab[sz][MATRIX_GENERAL] = \
53 _mesa_##pfx##_transform_points##sz##_general; \
54 _mesa_transform_tab[sz][MATRIX_IDENTITY] = \
55 _mesa_##pfx##_transform_points##sz##_identity; \
56 _mesa_transform_tab[sz][MATRIX_3D_NO_ROT] = \
57 _mesa_##pfx##_transform_points##sz##_3d_no_rot; \
58 _mesa_transform_tab[sz][MATRIX_PERSPECTIVE] = \
59 _mesa_##pfx##_transform_points##sz##_perspective; \
60 _mesa_transform_tab[sz][MATRIX_2D] = \
61 _mesa_##pfx##_transform_points##sz##_2d; \
62 _mesa_transform_tab[sz][MATRIX_2D_NO_ROT] = \
63 _mesa_##pfx##_transform_points##sz##_2d_no_rot; \
64 _mesa_transform_tab[sz][MATRIX_3D] = \
65 _mesa_##pfx##_transform_points##sz##_3d;
66
67
68 /* =============================================================
69 * Normal transformation function declarations:
70 */
71
72 #define NORM_ARGS const GLmatrix *mat, \
73 GLfloat scale, \
74 const GLvector4f *in, \
75 const GLfloat *lengths, \
76 GLvector4f *dest
77
78 #define DECLARE_NORM_GROUP( pfx ) \
79 extern void _ASMAPI _mesa_##pfx##_rescale_normals( NORM_ARGS ); \
80 extern void _ASMAPI _mesa_##pfx##_normalize_normals( NORM_ARGS ); \
81 extern void _ASMAPI _mesa_##pfx##_transform_normals( NORM_ARGS ); \
82 extern void _ASMAPI _mesa_##pfx##_transform_normals_no_rot( NORM_ARGS ); \
83 extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals( NORM_ARGS ); \
84 extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals_no_rot( NORM_ARGS ); \
85 extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals( NORM_ARGS ); \
86 extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals_no_rot( NORM_ARGS );
87
88 #define ASSIGN_NORM_GROUP( pfx ) \
89 _mesa_normal_tab[NORM_RESCALE] = \
90 _mesa_##pfx##_rescale_normals; \
91 _mesa_normal_tab[NORM_NORMALIZE] = \
92 _mesa_##pfx##_normalize_normals; \
93 _mesa_normal_tab[NORM_TRANSFORM] = \
94 _mesa_##pfx##_transform_normals; \
95 _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] = \
96 _mesa_##pfx##_transform_normals_no_rot; \
97 _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] = \
98 _mesa_##pfx##_transform_rescale_normals; \
99 _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] = \
100 _mesa_##pfx##_transform_rescale_normals_no_rot; \
101 _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE] = \
102 _mesa_##pfx##_transform_normalize_normals; \
103 _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE] = \
104 _mesa_##pfx##_transform_normalize_normals_no_rot;
105
106
107 #endif