ir_to_mesa: Support texture rectangle targets
[mesa/nouveau-pmpeg.git] / src / glx / indirect_transpose_matrix.c
blob618db9f5d4ff1d219a215bc976739931d3ac7a7e
1 /*
2 * (C) Copyright IBM Corporation 2004
3 * All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * on the rights to use, copy, modify, merge, publish, distribute, sub
9 * license, and/or sell copies of the Software, and to permit persons to whom
10 * the Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22 * USE OR OTHER DEALINGS IN THE SOFTWARE.
25 #include <GL/gl.h>
26 #include "indirect.h"
28 static void
29 TransposeMatrixf(const GLfloat s[16], GLfloat d[16])
31 int i, j;
32 for (i = 0; i < 4; i++) {
33 for (j = 0; j < 4; j++) {
34 d[i * 4 + j] = s[j * 4 + i];
39 static void
40 TransposeMatrixd(const GLdouble s[16], GLdouble d[16])
42 int i, j;
43 for (i = 0; i < 4; i++) {
44 for (j = 0; j < 4; j++) {
45 d[i * 4 + j] = s[j * 4 + i];
51 void
52 __indirect_glLoadTransposeMatrixdARB(const GLdouble * m)
54 GLdouble mt[16];
56 TransposeMatrixd(m, mt);
57 __indirect_glLoadMatrixd(mt);
60 void
61 __indirect_glLoadTransposeMatrixfARB(const GLfloat * m)
63 GLfloat mt[16];
65 TransposeMatrixf(m, mt);
66 __indirect_glLoadMatrixf(mt);
69 void
70 __indirect_glMultTransposeMatrixdARB(const GLdouble * m)
72 GLdouble mt[16];
74 TransposeMatrixd(m, mt);
75 __indirect_glMultMatrixd(mt);
78 void
79 __indirect_glMultTransposeMatrixfARB(const GLfloat * m)
81 GLfloat mt[16];
83 TransposeMatrixf(m, mt);
84 __indirect_glMultMatrixf(mt);