1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
|
/* $Id: state_bits_globalop.h $ */
/** @file
* Global State bits operation
*/
/*
* Copyright (C) 2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include <iprt/cdefs.h>
#include <cr_version.h>
#ifndef CRSTATE_BITS_OP
# error "CRSTATE_BITS_OP must be defined!"
#endif
#define _CRSTATE_BITS_OP_SIZEOF(_val) CRSTATE_BITS_OP(_val, RT_SIZEOFMEMB(CRStateBits, _val))
#ifndef CRSTATE_BITS_OP_VERSION
# define CRSTATE_BITS_OP_VERSION SHCROGL_SSM_VERSION
#endif
do {
int i;
#ifdef _CRSTATE_BITS_OP_STENCIL_V_33
# error "_CRSTATE_BITS_OP_STENCIL_V_33 must no be defined!"
#endif
#if CRSTATE_BITS_OP_VERSION < SHCROGL_SSM_VERSION_WITH_FIXED_STENCIL
# define _CRSTATE_BITS_OP_STENCIL_V_33
#endif
#ifdef _CRSTATE_BITS_OP_STENCIL_V_33
# ifndef CRSTATE_BITS_OP_STENCIL_OP_V_33
# error "CRSTATE_BITS_OP_STENCIL_OP_V_33 undefined!"
# endif
# ifndef CRSTATE_BITS_OP_STENCIL_FUNC_V_33
# error "CRSTATE_BITS_OP_STENCIL_FUNC_V_33 undefined!"
# endif
#endif
_CRSTATE_BITS_OP_SIZEOF(attrib.dirty);
_CRSTATE_BITS_OP_SIZEOF(buffer.dirty);
_CRSTATE_BITS_OP_SIZEOF(buffer.enable);
_CRSTATE_BITS_OP_SIZEOF(buffer.alphaFunc);
_CRSTATE_BITS_OP_SIZEOF(buffer.depthFunc);
_CRSTATE_BITS_OP_SIZEOF(buffer.blendFunc);
_CRSTATE_BITS_OP_SIZEOF(buffer.logicOp);
_CRSTATE_BITS_OP_SIZEOF(buffer.indexLogicOp);
_CRSTATE_BITS_OP_SIZEOF(buffer.drawBuffer);
_CRSTATE_BITS_OP_SIZEOF(buffer.readBuffer);
_CRSTATE_BITS_OP_SIZEOF(buffer.indexMask);
_CRSTATE_BITS_OP_SIZEOF(buffer.colorWriteMask);
_CRSTATE_BITS_OP_SIZEOF(buffer.clearColor);
_CRSTATE_BITS_OP_SIZEOF(buffer.clearIndex);
_CRSTATE_BITS_OP_SIZEOF(buffer.clearDepth);
_CRSTATE_BITS_OP_SIZEOF(buffer.clearAccum);
_CRSTATE_BITS_OP_SIZEOF(buffer.depthMask);
#ifdef CR_EXT_blend_color
_CRSTATE_BITS_OP_SIZEOF(buffer.blendColor);
#endif
#if defined(CR_EXT_blend_minmax) || defined(CR_EXT_blend_subtract) || defined(CR_EXT_blend_logic_op)
_CRSTATE_BITS_OP_SIZEOF(buffer.blendEquation);
#endif
#if defined(CR_EXT_blend_func_separate)
_CRSTATE_BITS_OP_SIZEOF(buffer.blendFuncSeparate);
#endif
#ifdef CR_ARB_vertex_buffer_object
_CRSTATE_BITS_OP_SIZEOF(bufferobject.dirty);
_CRSTATE_BITS_OP_SIZEOF(bufferobject.arrayBinding);
_CRSTATE_BITS_OP_SIZEOF(bufferobject.elementsBinding);
# ifdef CR_ARB_pixel_buffer_object
_CRSTATE_BITS_OP_SIZEOF(bufferobject.packBinding);
_CRSTATE_BITS_OP_SIZEOF(bufferobject.unpackBinding);
# endif
#endif
_CRSTATE_BITS_OP_SIZEOF(client.dirty);
_CRSTATE_BITS_OP_SIZEOF(client.pack);
_CRSTATE_BITS_OP_SIZEOF(client.unpack);
_CRSTATE_BITS_OP_SIZEOF(client.enableClientState);
_CRSTATE_BITS_OP_SIZEOF(client.clientPointer);
CRSTATE_BITS_OP(client.v, GLCLIENT_BIT_ALLOC*sizeof(CRbitvalue));
CRSTATE_BITS_OP(client.n, GLCLIENT_BIT_ALLOC*sizeof(CRbitvalue));
CRSTATE_BITS_OP(client.c, GLCLIENT_BIT_ALLOC*sizeof(CRbitvalue));
CRSTATE_BITS_OP(client.i, GLCLIENT_BIT_ALLOC*sizeof(CRbitvalue));
CRSTATE_BITS_OP(client.e, GLCLIENT_BIT_ALLOC*sizeof(CRbitvalue));
CRSTATE_BITS_OP(client.s, GLCLIENT_BIT_ALLOC*sizeof(CRbitvalue));
CRSTATE_BITS_OP(client.f, GLCLIENT_BIT_ALLOC*sizeof(CRbitvalue));
for (i=0; i<CR_MAX_TEXTURE_UNITS; i++)
{
CRSTATE_BITS_OP(client.t[i], GLCLIENT_BIT_ALLOC*sizeof(CRbitvalue));
}
#ifdef CR_NV_vertex_program
for (i=0; i<CR_MAX_VERTEX_ATTRIBS; i++)
{
CRSTATE_BITS_OP(client.a[i], GLCLIENT_BIT_ALLOC*sizeof(CRbitvalue));
}
#endif
_CRSTATE_BITS_OP_SIZEOF(current.dirty);
for (i=0; i<CR_MAX_VERTEX_ATTRIBS; i++)
{
_CRSTATE_BITS_OP_SIZEOF(current.vertexAttrib[i]);
}
_CRSTATE_BITS_OP_SIZEOF(current.edgeFlag);
_CRSTATE_BITS_OP_SIZEOF(current.colorIndex);
_CRSTATE_BITS_OP_SIZEOF(current.rasterPos);
_CRSTATE_BITS_OP_SIZEOF(eval.dirty);
for (i=0; i<GLEVAL_TOT; i++)
{
_CRSTATE_BITS_OP_SIZEOF(eval.eval1D[i]);
_CRSTATE_BITS_OP_SIZEOF(eval.eval2D[i]);
_CRSTATE_BITS_OP_SIZEOF(eval.enable1D[i]);
_CRSTATE_BITS_OP_SIZEOF(eval.enable2D[i]);
}
_CRSTATE_BITS_OP_SIZEOF(eval.enable);
_CRSTATE_BITS_OP_SIZEOF(eval.grid1D);
_CRSTATE_BITS_OP_SIZEOF(eval.grid2D);
#ifdef CR_NV_vertex_program
/*@todo Those seems to be unused?
_CRSTATE_BITS_OP_SIZEOF(eval.enableAttrib1D);
_CRSTATE_BITS_OP_SIZEOF(eval.enableAttrib2D);
*/
#endif
_CRSTATE_BITS_OP_SIZEOF(feedback.dirty);
_CRSTATE_BITS_OP_SIZEOF(selection.dirty);
_CRSTATE_BITS_OP_SIZEOF(fog.dirty);
_CRSTATE_BITS_OP_SIZEOF(fog.color);
_CRSTATE_BITS_OP_SIZEOF(fog.index);
_CRSTATE_BITS_OP_SIZEOF(fog.density);
_CRSTATE_BITS_OP_SIZEOF(fog.start);
_CRSTATE_BITS_OP_SIZEOF(fog.end);
_CRSTATE_BITS_OP_SIZEOF(fog.mode);
_CRSTATE_BITS_OP_SIZEOF(fog.enable);
#ifdef CR_NV_fog_distance
_CRSTATE_BITS_OP_SIZEOF(fog.fogDistanceMode);
#endif
#ifdef CR_EXT_fog_coord
_CRSTATE_BITS_OP_SIZEOF(fog.fogCoordinateSource);
#endif
_CRSTATE_BITS_OP_SIZEOF(hint.dirty);
_CRSTATE_BITS_OP_SIZEOF(hint.perspectiveCorrection);
_CRSTATE_BITS_OP_SIZEOF(hint.pointSmooth);
_CRSTATE_BITS_OP_SIZEOF(hint.lineSmooth);
_CRSTATE_BITS_OP_SIZEOF(hint.polygonSmooth);
_CRSTATE_BITS_OP_SIZEOF(hint.fog);
#ifdef CR_EXT_clip_volume_hint
_CRSTATE_BITS_OP_SIZEOF(hint.clipVolumeClipping);
#endif
#ifdef CR_ARB_texture_compression
_CRSTATE_BITS_OP_SIZEOF(hint.textureCompression);
#endif
#ifdef CR_SGIS_generate_mipmap
_CRSTATE_BITS_OP_SIZEOF(hint.generateMipmap);
#endif
_CRSTATE_BITS_OP_SIZEOF(lighting.dirty);
_CRSTATE_BITS_OP_SIZEOF(lighting.shadeModel);
_CRSTATE_BITS_OP_SIZEOF(lighting.colorMaterial);
_CRSTATE_BITS_OP_SIZEOF(lighting.lightModel);
_CRSTATE_BITS_OP_SIZEOF(lighting.material);
_CRSTATE_BITS_OP_SIZEOF(lighting.enable);
for (i=0; i<CR_MAX_LIGHTS; ++i)
{
_CRSTATE_BITS_OP_SIZEOF(lighting.light[i].dirty);
_CRSTATE_BITS_OP_SIZEOF(lighting.light[i].enable);
_CRSTATE_BITS_OP_SIZEOF(lighting.light[i].ambient);
_CRSTATE_BITS_OP_SIZEOF(lighting.light[i].diffuse);
_CRSTATE_BITS_OP_SIZEOF(lighting.light[i].specular);
_CRSTATE_BITS_OP_SIZEOF(lighting.light[i].position);
_CRSTATE_BITS_OP_SIZEOF(lighting.light[i].attenuation);
_CRSTATE_BITS_OP_SIZEOF(lighting.light[i].spot);
}
_CRSTATE_BITS_OP_SIZEOF(line.dirty);
_CRSTATE_BITS_OP_SIZEOF(line.enable);
_CRSTATE_BITS_OP_SIZEOF(line.width);
_CRSTATE_BITS_OP_SIZEOF(line.stipple);
_CRSTATE_BITS_OP_SIZEOF(lists.dirty);
_CRSTATE_BITS_OP_SIZEOF(lists.base);
_CRSTATE_BITS_OP_SIZEOF(multisample.dirty);
_CRSTATE_BITS_OP_SIZEOF(multisample.enable);
_CRSTATE_BITS_OP_SIZEOF(multisample.sampleAlphaToCoverage);
_CRSTATE_BITS_OP_SIZEOF(multisample.sampleAlphaToOne);
_CRSTATE_BITS_OP_SIZEOF(multisample.sampleCoverage);
_CRSTATE_BITS_OP_SIZEOF(multisample.sampleCoverageValue);
#if CR_ARB_occlusion_query
_CRSTATE_BITS_OP_SIZEOF(occlusion.dirty);
#endif
_CRSTATE_BITS_OP_SIZEOF(pixel.dirty);
_CRSTATE_BITS_OP_SIZEOF(pixel.transfer);
_CRSTATE_BITS_OP_SIZEOF(pixel.zoom);
_CRSTATE_BITS_OP_SIZEOF(pixel.maps);
_CRSTATE_BITS_OP_SIZEOF(point.dirty);
_CRSTATE_BITS_OP_SIZEOF(point.enableSmooth);
_CRSTATE_BITS_OP_SIZEOF(point.size);
#ifdef CR_ARB_point_parameters
_CRSTATE_BITS_OP_SIZEOF(point.minSize);
_CRSTATE_BITS_OP_SIZEOF(point.maxSize);
_CRSTATE_BITS_OP_SIZEOF(point.fadeThresholdSize);
_CRSTATE_BITS_OP_SIZEOF(point.distanceAttenuation);
#endif
#ifdef CR_ARB_point_sprite
_CRSTATE_BITS_OP_SIZEOF(point.enableSprite);
for (i=0; i<CR_MAX_TEXTURE_UNITS; ++i)
{
_CRSTATE_BITS_OP_SIZEOF(point.coordReplacement[i]);
}
#endif
#if CRSTATE_BITS_OP_VERSION >= SHCROGL_SSM_VERSION_WITH_SPRITE_COORD_ORIGIN
_CRSTATE_BITS_OP_SIZEOF(point.spriteCoordOrigin);
#endif
_CRSTATE_BITS_OP_SIZEOF(polygon.dirty);
_CRSTATE_BITS_OP_SIZEOF(polygon.enable);
_CRSTATE_BITS_OP_SIZEOF(polygon.offset);
_CRSTATE_BITS_OP_SIZEOF(polygon.mode);
_CRSTATE_BITS_OP_SIZEOF(polygon.stipple);
_CRSTATE_BITS_OP_SIZEOF(program.dirty);
_CRSTATE_BITS_OP_SIZEOF(program.vpEnable);
_CRSTATE_BITS_OP_SIZEOF(program.fpEnable);
_CRSTATE_BITS_OP_SIZEOF(program.vpBinding);
_CRSTATE_BITS_OP_SIZEOF(program.fpBinding);
for (i=0; i<CR_MAX_VERTEX_ATTRIBS; ++i)
{
_CRSTATE_BITS_OP_SIZEOF(program.vertexAttribArrayEnable[i]);
_CRSTATE_BITS_OP_SIZEOF(program.map1AttribArrayEnable[i]);
_CRSTATE_BITS_OP_SIZEOF(program.map2AttribArrayEnable[i]);
}
for (i=0; i<CR_MAX_VERTEX_PROGRAM_ENV_PARAMS; ++i)
{
_CRSTATE_BITS_OP_SIZEOF(program.vertexEnvParameter[i]);
}
for (i=0; i<CR_MAX_FRAGMENT_PROGRAM_ENV_PARAMS; ++i)
{
_CRSTATE_BITS_OP_SIZEOF(program.fragmentEnvParameter[i]);
}
_CRSTATE_BITS_OP_SIZEOF(program.vertexEnvParameters);
_CRSTATE_BITS_OP_SIZEOF(program.fragmentEnvParameters);
for (i=0; i<CR_MAX_VERTEX_PROGRAM_ENV_PARAMS/4; ++i)
{
_CRSTATE_BITS_OP_SIZEOF(program.trackMatrix[i]);
}
_CRSTATE_BITS_OP_SIZEOF(regcombiner.dirty);
_CRSTATE_BITS_OP_SIZEOF(regcombiner.enable);
_CRSTATE_BITS_OP_SIZEOF(regcombiner.regCombinerVars);
_CRSTATE_BITS_OP_SIZEOF(regcombiner.regCombinerColor0);
_CRSTATE_BITS_OP_SIZEOF(regcombiner.regCombinerColor1);
for (i=0; i<CR_MAX_GENERAL_COMBINERS; ++i)
{
_CRSTATE_BITS_OP_SIZEOF(regcombiner.regCombinerStageColor0[i]);
_CRSTATE_BITS_OP_SIZEOF(regcombiner.regCombinerStageColor1[i]);
_CRSTATE_BITS_OP_SIZEOF(regcombiner.regCombinerInput[i]);
_CRSTATE_BITS_OP_SIZEOF(regcombiner.regCombinerOutput[i]);
}
_CRSTATE_BITS_OP_SIZEOF(regcombiner.regCombinerFinalInput);
_CRSTATE_BITS_OP_SIZEOF(stencil.dirty);
_CRSTATE_BITS_OP_SIZEOF(stencil.enable);
#ifdef _CRSTATE_BITS_OP_STENCIL_V_33
_CRSTATE_BITS_OP_SIZEOF(stencil.bufferRefs[CRSTATE_STENCIL_BUFFER_REF_ID_FRONT_AND_BACK].func);
_CRSTATE_BITS_OP_SIZEOF(stencil.bufferRefs[CRSTATE_STENCIL_BUFFER_REF_ID_FRONT_AND_BACK].op);
for (i = CRSTATE_STENCIL_BUFFER_REF_ID_FRONT_AND_BACK + 1; i < CRSTATE_STENCIL_BUFFER_REF_COUNT; ++i)
{
CRSTATE_BITS_OP_STENCIL_FUNC_V_33(i, stencil.bufferRefs[i].func);
CRSTATE_BITS_OP_STENCIL_OP_V_33(i, stencil.bufferRefs[i].op);
}
_CRSTATE_BITS_OP_SIZEOF(stencil.clearValue);
_CRSTATE_BITS_OP_SIZEOF(stencil.writeMask);
#else
_CRSTATE_BITS_OP_SIZEOF(stencil.enableTwoSideEXT);
_CRSTATE_BITS_OP_SIZEOF(stencil.activeStencilFace);
_CRSTATE_BITS_OP_SIZEOF(stencil.clearValue);
_CRSTATE_BITS_OP_SIZEOF(stencil.writeMask);
for (i = 0; i < CRSTATE_STENCIL_BUFFER_REF_COUNT; ++i)
{
_CRSTATE_BITS_OP_SIZEOF(stencil.bufferRefs[i].func);
_CRSTATE_BITS_OP_SIZEOF(stencil.bufferRefs[i].op);
}
#endif
_CRSTATE_BITS_OP_SIZEOF(texture.dirty);
for (i=0; i<CR_MAX_TEXTURE_UNITS; ++i)
{
_CRSTATE_BITS_OP_SIZEOF(texture.enable[i]);
_CRSTATE_BITS_OP_SIZEOF(texture.current[i]);
_CRSTATE_BITS_OP_SIZEOF(texture.objGen[i]);
_CRSTATE_BITS_OP_SIZEOF(texture.eyeGen[i]);
_CRSTATE_BITS_OP_SIZEOF(texture.genMode[i]);
_CRSTATE_BITS_OP_SIZEOF(texture.envBit[i]);
}
_CRSTATE_BITS_OP_SIZEOF(transform.dirty);
_CRSTATE_BITS_OP_SIZEOF(transform.matrixMode);
_CRSTATE_BITS_OP_SIZEOF(transform.modelviewMatrix);
_CRSTATE_BITS_OP_SIZEOF(transform.projectionMatrix);
_CRSTATE_BITS_OP_SIZEOF(transform.colorMatrix);
_CRSTATE_BITS_OP_SIZEOF(transform.textureMatrix);
_CRSTATE_BITS_OP_SIZEOF(transform.programMatrix);
_CRSTATE_BITS_OP_SIZEOF(transform.clipPlane);
_CRSTATE_BITS_OP_SIZEOF(transform.enable);
_CRSTATE_BITS_OP_SIZEOF(transform.base);
_CRSTATE_BITS_OP_SIZEOF(viewport.dirty);
_CRSTATE_BITS_OP_SIZEOF(viewport.v_dims);
_CRSTATE_BITS_OP_SIZEOF(viewport.s_dims);
_CRSTATE_BITS_OP_SIZEOF(viewport.enable);
_CRSTATE_BITS_OP_SIZEOF(viewport.depth);
} while (0);
#undef CRSTATE_BITS_OP_VERSION
#undef _CRSTATE_BITS_OP_STENCIL_V_33
|