VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/packer/pack_matrices.c@ 34356

最後變更 在這個檔案從34356是 33475,由 vboxsync 提交於 14 年 前

crOpenGL/wddm: multithreading fix

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 9.5 KB
 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#include "packer.h"
8#include "cr_opcodes.h"
9
10void PACK_APIENTRY crPackMultMatrixd( const GLdouble *m )
11{
12 CR_GET_PACKER_CONTEXT(pc);
13 unsigned char *data_ptr;
14 int packet_length = 16*sizeof( *m );
15 CR_GET_BUFFERED_POINTER(pc, packet_length );
16 WRITE_DOUBLE( 0*sizeof(double), m[ 0] );
17 WRITE_DOUBLE( 1*sizeof(double), m[ 1] );
18 WRITE_DOUBLE( 2*sizeof(double), m[ 2] );
19 WRITE_DOUBLE( 3*sizeof(double), m[ 3] );
20 WRITE_DOUBLE( 4*sizeof(double), m[ 4] );
21 WRITE_DOUBLE( 5*sizeof(double), m[ 5] );
22 WRITE_DOUBLE( 6*sizeof(double), m[ 6] );
23 WRITE_DOUBLE( 7*sizeof(double), m[ 7] );
24 WRITE_DOUBLE( 8*sizeof(double), m[ 8] );
25 WRITE_DOUBLE( 9*sizeof(double), m[ 9] );
26 WRITE_DOUBLE( 10*sizeof(double), m[10] );
27 WRITE_DOUBLE( 11*sizeof(double), m[11] );
28 WRITE_DOUBLE( 12*sizeof(double), m[12] );
29 WRITE_DOUBLE( 13*sizeof(double), m[13] );
30 WRITE_DOUBLE( 14*sizeof(double), m[14] );
31 WRITE_DOUBLE( 15*sizeof(double), m[15] );
32 WRITE_OPCODE( pc, CR_MULTMATRIXD_OPCODE );
33 CR_UNLOCK_PACKER_CONTEXT(pc);
34}
35
36void PACK_APIENTRY crPackMultMatrixf( const GLfloat *m )
37{
38 CR_GET_PACKER_CONTEXT(pc);
39 unsigned char *data_ptr;
40 int packet_length = 16*sizeof( *m );
41 CR_GET_BUFFERED_POINTER(pc, packet_length );
42 WRITE_DATA( 0*sizeof(GLfloat), GLfloat, m[ 0] );
43 WRITE_DATA( 1*sizeof(GLfloat), GLfloat, m[ 1] );
44 WRITE_DATA( 2*sizeof(GLfloat), GLfloat, m[ 2] );
45 WRITE_DATA( 3*sizeof(GLfloat), GLfloat, m[ 3] );
46 WRITE_DATA( 4*sizeof(GLfloat), GLfloat, m[ 4] );
47 WRITE_DATA( 5*sizeof(GLfloat), GLfloat, m[ 5] );
48 WRITE_DATA( 6*sizeof(GLfloat), GLfloat, m[ 6] );
49 WRITE_DATA( 7*sizeof(GLfloat), GLfloat, m[ 7] );
50 WRITE_DATA( 8*sizeof(GLfloat), GLfloat, m[ 8] );
51 WRITE_DATA( 9*sizeof(GLfloat), GLfloat, m[ 9] );
52 WRITE_DATA( 10*sizeof(GLfloat), GLfloat, m[10] );
53 WRITE_DATA( 11*sizeof(GLfloat), GLfloat, m[11] );
54 WRITE_DATA( 12*sizeof(GLfloat), GLfloat, m[12] );
55 WRITE_DATA( 13*sizeof(GLfloat), GLfloat, m[13] );
56 WRITE_DATA( 14*sizeof(GLfloat), GLfloat, m[14] );
57 WRITE_DATA( 15*sizeof(GLfloat), GLfloat, m[15] );
58 WRITE_OPCODE( pc, CR_MULTMATRIXF_OPCODE );
59 CR_UNLOCK_PACKER_CONTEXT(pc);
60}
61
62void PACK_APIENTRY crPackLoadMatrixd( const GLdouble *m )
63{
64 CR_GET_PACKER_CONTEXT(pc);
65 unsigned char *data_ptr;
66 int packet_length = 16*sizeof( *m );
67 CR_GET_BUFFERED_POINTER(pc, packet_length );
68 WRITE_DOUBLE( 0*sizeof(double), m[ 0] );
69 WRITE_DOUBLE( 1*sizeof(double), m[ 1] );
70 WRITE_DOUBLE( 2*sizeof(double), m[ 2] );
71 WRITE_DOUBLE( 3*sizeof(double), m[ 3] );
72 WRITE_DOUBLE( 4*sizeof(double), m[ 4] );
73 WRITE_DOUBLE( 5*sizeof(double), m[ 5] );
74 WRITE_DOUBLE( 6*sizeof(double), m[ 6] );
75 WRITE_DOUBLE( 7*sizeof(double), m[ 7] );
76 WRITE_DOUBLE( 8*sizeof(double), m[ 8] );
77 WRITE_DOUBLE( 9*sizeof(double), m[ 9] );
78 WRITE_DOUBLE( 10*sizeof(double), m[10] );
79 WRITE_DOUBLE( 11*sizeof(double), m[11] );
80 WRITE_DOUBLE( 12*sizeof(double), m[12] );
81 WRITE_DOUBLE( 13*sizeof(double), m[13] );
82 WRITE_DOUBLE( 14*sizeof(double), m[14] );
83 WRITE_DOUBLE( 15*sizeof(double), m[15] );
84 WRITE_OPCODE( pc, CR_LOADMATRIXD_OPCODE );
85 CR_UNLOCK_PACKER_CONTEXT(pc);
86}
87
88void PACK_APIENTRY crPackLoadMatrixf( const GLfloat *m )
89{
90 CR_GET_PACKER_CONTEXT(pc);
91 unsigned char *data_ptr;
92 int packet_length = 16*sizeof( *m );
93 CR_GET_BUFFERED_POINTER(pc, packet_length );
94 WRITE_DATA( 0*sizeof(GLfloat), GLfloat, m[ 0] );
95 WRITE_DATA( 1*sizeof(GLfloat), GLfloat, m[ 1] );
96 WRITE_DATA( 2*sizeof(GLfloat), GLfloat, m[ 2] );
97 WRITE_DATA( 3*sizeof(GLfloat), GLfloat, m[ 3] );
98 WRITE_DATA( 4*sizeof(GLfloat), GLfloat, m[ 4] );
99 WRITE_DATA( 5*sizeof(GLfloat), GLfloat, m[ 5] );
100 WRITE_DATA( 6*sizeof(GLfloat), GLfloat, m[ 6] );
101 WRITE_DATA( 7*sizeof(GLfloat), GLfloat, m[ 7] );
102 WRITE_DATA( 8*sizeof(GLfloat), GLfloat, m[ 8] );
103 WRITE_DATA( 9*sizeof(GLfloat), GLfloat, m[ 9] );
104 WRITE_DATA( 10*sizeof(GLfloat), GLfloat, m[10] );
105 WRITE_DATA( 11*sizeof(GLfloat), GLfloat, m[11] );
106 WRITE_DATA( 12*sizeof(GLfloat), GLfloat, m[12] );
107 WRITE_DATA( 13*sizeof(GLfloat), GLfloat, m[13] );
108 WRITE_DATA( 14*sizeof(GLfloat), GLfloat, m[14] );
109 WRITE_DATA( 15*sizeof(GLfloat), GLfloat, m[15] );
110 WRITE_OPCODE( pc, CR_LOADMATRIXF_OPCODE );
111 CR_UNLOCK_PACKER_CONTEXT(pc);
112}
113
114void PACK_APIENTRY crPackMultTransposeMatrixdARB( const GLdouble *m )
115{
116 CR_GET_PACKER_CONTEXT(pc);
117 unsigned char *data_ptr;
118 int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
119 CR_GET_BUFFERED_POINTER(pc, packet_length );
120 WRITE_DATA( 0, GLint, packet_length );
121 WRITE_DATA( 4, GLenum, CR_MULTTRANSPOSEMATRIXDARB_EXTEND_OPCODE );
122 WRITE_DOUBLE( 8 + 0*sizeof(double), m[ 0] );
123 WRITE_DOUBLE( 8 + 1*sizeof(double), m[ 1] );
124 WRITE_DOUBLE( 8 + 2*sizeof(double), m[ 2] );
125 WRITE_DOUBLE( 8 + 3*sizeof(double), m[ 3] );
126 WRITE_DOUBLE( 8 + 4*sizeof(double), m[ 4] );
127 WRITE_DOUBLE( 8 + 5*sizeof(double), m[ 5] );
128 WRITE_DOUBLE( 8 + 6*sizeof(double), m[ 6] );
129 WRITE_DOUBLE( 8 + 7*sizeof(double), m[ 7] );
130 WRITE_DOUBLE( 8 + 8*sizeof(double), m[ 8] );
131 WRITE_DOUBLE( 8 + 9*sizeof(double), m[ 9] );
132 WRITE_DOUBLE( 8 + 10*sizeof(double), m[10] );
133 WRITE_DOUBLE( 8 + 11*sizeof(double), m[11] );
134 WRITE_DOUBLE( 8 + 12*sizeof(double), m[12] );
135 WRITE_DOUBLE( 8 + 13*sizeof(double), m[13] );
136 WRITE_DOUBLE( 8 + 14*sizeof(double), m[14] );
137 WRITE_DOUBLE( 8 + 15*sizeof(double), m[15] );
138 WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
139 CR_UNLOCK_PACKER_CONTEXT(pc);
140}
141
142void PACK_APIENTRY crPackMultTransposeMatrixfARB( const GLfloat *m )
143{
144 CR_GET_PACKER_CONTEXT(pc);
145 unsigned char *data_ptr;
146 int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
147 CR_GET_BUFFERED_POINTER(pc, packet_length );
148 WRITE_DATA( 0, GLint, packet_length );
149 WRITE_DATA( 4, GLenum, CR_MULTTRANSPOSEMATRIXFARB_EXTEND_OPCODE );
150 WRITE_DATA( 8 + 0*sizeof(GLfloat), GLfloat, m[ 0] );
151 WRITE_DATA( 8 + 1*sizeof(GLfloat), GLfloat, m[ 1] );
152 WRITE_DATA( 8 + 2*sizeof(GLfloat), GLfloat, m[ 2] );
153 WRITE_DATA( 8 + 3*sizeof(GLfloat), GLfloat, m[ 3] );
154 WRITE_DATA( 8 + 4*sizeof(GLfloat), GLfloat, m[ 4] );
155 WRITE_DATA( 8 + 5*sizeof(GLfloat), GLfloat, m[ 5] );
156 WRITE_DATA( 8 + 6*sizeof(GLfloat), GLfloat, m[ 6] );
157 WRITE_DATA( 8 + 7*sizeof(GLfloat), GLfloat, m[ 7] );
158 WRITE_DATA( 8 + 8*sizeof(GLfloat), GLfloat, m[ 8] );
159 WRITE_DATA( 8 + 9*sizeof(GLfloat), GLfloat, m[ 9] );
160 WRITE_DATA( 8 + 10*sizeof(GLfloat), GLfloat, m[10] );
161 WRITE_DATA( 8 + 11*sizeof(GLfloat), GLfloat, m[11] );
162 WRITE_DATA( 8 + 12*sizeof(GLfloat), GLfloat, m[12] );
163 WRITE_DATA( 8 + 13*sizeof(GLfloat), GLfloat, m[13] );
164 WRITE_DATA( 8 + 14*sizeof(GLfloat), GLfloat, m[14] );
165 WRITE_DATA( 8 + 15*sizeof(GLfloat), GLfloat, m[15] );
166 WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
167 CR_UNLOCK_PACKER_CONTEXT(pc);
168}
169
170void PACK_APIENTRY crPackLoadTransposeMatrixdARB( const GLdouble *m )
171{
172 CR_GET_PACKER_CONTEXT(pc);
173 unsigned char *data_ptr;
174 int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
175 CR_GET_BUFFERED_POINTER(pc, packet_length );
176 WRITE_DATA( 0, GLint, packet_length );
177 WRITE_DATA( 4, GLenum, CR_LOADTRANSPOSEMATRIXDARB_EXTEND_OPCODE );
178 WRITE_DOUBLE( 8 + 0*sizeof(double), m[ 0] );
179 WRITE_DOUBLE( 8 + 1*sizeof(double), m[ 1] );
180 WRITE_DOUBLE( 8 + 2*sizeof(double), m[ 2] );
181 WRITE_DOUBLE( 8 + 3*sizeof(double), m[ 3] );
182 WRITE_DOUBLE( 8 + 4*sizeof(double), m[ 4] );
183 WRITE_DOUBLE( 8 + 5*sizeof(double), m[ 5] );
184 WRITE_DOUBLE( 8 + 6*sizeof(double), m[ 6] );
185 WRITE_DOUBLE( 8 + 7*sizeof(double), m[ 7] );
186 WRITE_DOUBLE( 8 + 8*sizeof(double), m[ 8] );
187 WRITE_DOUBLE( 8 + 9*sizeof(double), m[ 9] );
188 WRITE_DOUBLE( 8 + 10*sizeof(double), m[10] );
189 WRITE_DOUBLE( 8 + 11*sizeof(double), m[11] );
190 WRITE_DOUBLE( 8 + 12*sizeof(double), m[12] );
191 WRITE_DOUBLE( 8 + 13*sizeof(double), m[13] );
192 WRITE_DOUBLE( 8 + 14*sizeof(double), m[14] );
193 WRITE_DOUBLE( 8 + 15*sizeof(double), m[15] );
194 WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
195 CR_UNLOCK_PACKER_CONTEXT(pc);
196}
197
198void PACK_APIENTRY crPackLoadTransposeMatrixfARB( const GLfloat *m )
199{
200 CR_GET_PACKER_CONTEXT(pc);
201 unsigned char *data_ptr;
202 int packet_length = 16*sizeof( *m ) + sizeof(GLint) + sizeof(GLenum);
203 CR_GET_BUFFERED_POINTER(pc, packet_length );
204 WRITE_DATA( 0, GLint, packet_length );
205 WRITE_DATA( 4, GLenum, CR_LOADTRANSPOSEMATRIXFARB_EXTEND_OPCODE );
206 WRITE_DATA( 8 + 0*sizeof(GLfloat), GLfloat, m[ 0] );
207 WRITE_DATA( 8 + 1*sizeof(GLfloat), GLfloat, m[ 1] );
208 WRITE_DATA( 8 + 2*sizeof(GLfloat), GLfloat, m[ 2] );
209 WRITE_DATA( 8 + 3*sizeof(GLfloat), GLfloat, m[ 3] );
210 WRITE_DATA( 8 + 4*sizeof(GLfloat), GLfloat, m[ 4] );
211 WRITE_DATA( 8 + 5*sizeof(GLfloat), GLfloat, m[ 5] );
212 WRITE_DATA( 8 + 6*sizeof(GLfloat), GLfloat, m[ 6] );
213 WRITE_DATA( 8 + 7*sizeof(GLfloat), GLfloat, m[ 7] );
214 WRITE_DATA( 8 + 8*sizeof(GLfloat), GLfloat, m[ 8] );
215 WRITE_DATA( 8 + 9*sizeof(GLfloat), GLfloat, m[ 9] );
216 WRITE_DATA( 8 + 10*sizeof(GLfloat), GLfloat, m[10] );
217 WRITE_DATA( 8 + 11*sizeof(GLfloat), GLfloat, m[11] );
218 WRITE_DATA( 8 + 12*sizeof(GLfloat), GLfloat, m[12] );
219 WRITE_DATA( 8 + 13*sizeof(GLfloat), GLfloat, m[13] );
220 WRITE_DATA( 8 + 14*sizeof(GLfloat), GLfloat, m[14] );
221 WRITE_DATA( 8 + 15*sizeof(GLfloat), GLfloat, m[15] );
222 WRITE_OPCODE( pc, CR_EXTEND_OPCODE );
223 CR_UNLOCK_PACKER_CONTEXT(pc);
224}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette