added test implementation of GL_ARB_window_pos
[mesa.git] / src / mesa / main / state.c
1 /* $Id: state.c,v 1.71 2001/11/18 23:52:38 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 4.1
6 *
7 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27
28 /*
29 * This file manages recalculation of derived values in the
30 * __GLcontext.
31 */
32
33
34 #ifdef PC_HEADER
35 #include "all.h"
36 #else
37 #include "glheader.h"
38 #include "accum.h"
39 #include "api_loopback.h"
40 #include "attrib.h"
41 #include "blend.h"
42 #include "buffers.h"
43 #include "clip.h"
44 #include "colortab.h"
45 #include "context.h"
46 #include "convolve.h"
47 #include "depth.h"
48 #include "dlist.h"
49 #include "drawpix.h"
50 #include "enable.h"
51 #include "eval.h"
52 #include "get.h"
53 #include "feedback.h"
54 #include "fog.h"
55 #include "hint.h"
56 #include "histogram.h"
57 #include "light.h"
58 #include "lines.h"
59 #include "matrix.h"
60 #include "mmath.h"
61 #include "pixel.h"
62 #include "points.h"
63 #include "polygon.h"
64 #include "rastpos.h"
65 #include "state.h"
66 #include "stencil.h"
67 #include "teximage.h"
68 #include "texobj.h"
69 #include "texstate.h"
70 #include "mtypes.h"
71 #include "varray.h"
72
73 #include "math/m_matrix.h"
74 #include "math/m_xform.h"
75 #endif
76
77
78 static int
79 generic_noop(void)
80 {
81 #ifdef DEBUG
82 _mesa_problem(NULL, "undefined function dispatch");
83 #endif
84 return 0;
85 }
86
87
88 /*
89 * Set all pointers in the given dispatch table to point to a
90 * generic no-op function.
91 */
92 void
93 _mesa_init_no_op_table(struct _glapi_table *table, GLuint tableSize)
94 {
95 GLuint i;
96 void **dispatch = (void **) table;
97 for (i = 0; i < tableSize; i++) {
98 dispatch[i] = (void *) generic_noop;
99 }
100 }
101
102
103
104 /*
105 * Initialize the given dispatch table with pointers to Mesa's
106 * immediate-mode commands.
107 *
108 * Pointers to begin/end object commands and a few others
109 * are provided via the vtxfmt interface elsewhere.
110 */
111 void
112 _mesa_init_exec_table(struct _glapi_table *exec, GLuint tableSize)
113 {
114 /* first initialize all dispatch slots to no-op */
115 _mesa_init_no_op_table(exec, tableSize);
116
117 _mesa_loopback_init_api_table( exec, GL_TRUE );
118
119 /* load the dispatch slots we understand */
120 exec->Accum = _mesa_Accum;
121 exec->AlphaFunc = _mesa_AlphaFunc;
122 exec->Bitmap = _mesa_Bitmap;
123 exec->BlendFunc = _mesa_BlendFunc;
124 exec->CallList = _mesa_CallList;
125 exec->CallLists = _mesa_CallLists;
126 exec->Clear = _mesa_Clear;
127 exec->ClearAccum = _mesa_ClearAccum;
128 exec->ClearColor = _mesa_ClearColor;
129 exec->ClearDepth = _mesa_ClearDepth;
130 exec->ClearIndex = _mesa_ClearIndex;
131 exec->ClearStencil = _mesa_ClearStencil;
132 exec->ClipPlane = _mesa_ClipPlane;
133 exec->ColorMask = _mesa_ColorMask;
134 exec->ColorMaterial = _mesa_ColorMaterial;
135 exec->CopyPixels = _mesa_CopyPixels;
136 exec->CullFace = _mesa_CullFace;
137 exec->DeleteLists = _mesa_DeleteLists;
138 exec->DepthFunc = _mesa_DepthFunc;
139 exec->DepthMask = _mesa_DepthMask;
140 exec->DepthRange = _mesa_DepthRange;
141 exec->Disable = _mesa_Disable;
142 exec->DrawBuffer = _mesa_DrawBuffer;
143 exec->DrawPixels = _mesa_DrawPixels;
144 exec->Enable = _mesa_Enable;
145 exec->EndList = _mesa_EndList;
146 exec->FeedbackBuffer = _mesa_FeedbackBuffer;
147 exec->Finish = _mesa_Finish;
148 exec->Flush = _mesa_Flush;
149 exec->FogCoordPointerEXT = _mesa_FogCoordPointerEXT;
150 exec->Fogf = _mesa_Fogf;
151 exec->Fogfv = _mesa_Fogfv;
152 exec->Fogi = _mesa_Fogi;
153 exec->Fogiv = _mesa_Fogiv;
154 exec->FrontFace = _mesa_FrontFace;
155 exec->Frustum = _mesa_Frustum;
156 exec->GenLists = _mesa_GenLists;
157 exec->GetBooleanv = _mesa_GetBooleanv;
158 exec->GetClipPlane = _mesa_GetClipPlane;
159 exec->GetDoublev = _mesa_GetDoublev;
160 exec->GetError = _mesa_GetError;
161 exec->GetFloatv = _mesa_GetFloatv;
162 exec->GetIntegerv = _mesa_GetIntegerv;
163 exec->GetLightfv = _mesa_GetLightfv;
164 exec->GetLightiv = _mesa_GetLightiv;
165 exec->GetMapdv = _mesa_GetMapdv;
166 exec->GetMapfv = _mesa_GetMapfv;
167 exec->GetMapiv = _mesa_GetMapiv;
168 exec->GetMaterialfv = _mesa_GetMaterialfv;
169 exec->GetMaterialiv = _mesa_GetMaterialiv;
170 exec->GetPixelMapfv = _mesa_GetPixelMapfv;
171 exec->GetPixelMapuiv = _mesa_GetPixelMapuiv;
172 exec->GetPixelMapusv = _mesa_GetPixelMapusv;
173 exec->GetPolygonStipple = _mesa_GetPolygonStipple;
174 exec->GetString = _mesa_GetString;
175 exec->GetTexEnvfv = _mesa_GetTexEnvfv;
176 exec->GetTexEnviv = _mesa_GetTexEnviv;
177 exec->GetTexGendv = _mesa_GetTexGendv;
178 exec->GetTexGenfv = _mesa_GetTexGenfv;
179 exec->GetTexGeniv = _mesa_GetTexGeniv;
180 exec->GetTexImage = _mesa_GetTexImage;
181 exec->GetTexLevelParameterfv = _mesa_GetTexLevelParameterfv;
182 exec->GetTexLevelParameteriv = _mesa_GetTexLevelParameteriv;
183 exec->GetTexParameterfv = _mesa_GetTexParameterfv;
184 exec->GetTexParameteriv = _mesa_GetTexParameteriv;
185 exec->Hint = _mesa_Hint;
186 exec->IndexMask = _mesa_IndexMask;
187 exec->InitNames = _mesa_InitNames;
188 exec->IsEnabled = _mesa_IsEnabled;
189 exec->IsList = _mesa_IsList;
190 exec->LightModelf = _mesa_LightModelf;
191 exec->LightModelfv = _mesa_LightModelfv;
192 exec->LightModeli = _mesa_LightModeli;
193 exec->LightModeliv = _mesa_LightModeliv;
194 exec->Lightf = _mesa_Lightf;
195 exec->Lightfv = _mesa_Lightfv;
196 exec->Lighti = _mesa_Lighti;
197 exec->Lightiv = _mesa_Lightiv;
198 exec->LineStipple = _mesa_LineStipple;
199 exec->LineWidth = _mesa_LineWidth;
200 exec->ListBase = _mesa_ListBase;
201 exec->LoadIdentity = _mesa_LoadIdentity;
202 exec->LoadMatrixd = _mesa_LoadMatrixd;
203 exec->LoadMatrixf = _mesa_LoadMatrixf;
204 exec->LoadName = _mesa_LoadName;
205 exec->LogicOp = _mesa_LogicOp;
206 exec->Map1d = _mesa_Map1d;
207 exec->Map1f = _mesa_Map1f;
208 exec->Map2d = _mesa_Map2d;
209 exec->Map2f = _mesa_Map2f;
210 exec->MapGrid1d = _mesa_MapGrid1d;
211 exec->MapGrid1f = _mesa_MapGrid1f;
212 exec->MapGrid2d = _mesa_MapGrid2d;
213 exec->MapGrid2f = _mesa_MapGrid2f;
214 exec->MatrixMode = _mesa_MatrixMode;
215 exec->MultMatrixd = _mesa_MultMatrixd;
216 exec->MultMatrixf = _mesa_MultMatrixf;
217 exec->NewList = _mesa_NewList;
218 exec->Ortho = _mesa_Ortho;
219 exec->PassThrough = _mesa_PassThrough;
220 exec->PixelMapfv = _mesa_PixelMapfv;
221 exec->PixelMapuiv = _mesa_PixelMapuiv;
222 exec->PixelMapusv = _mesa_PixelMapusv;
223 exec->PixelStoref = _mesa_PixelStoref;
224 exec->PixelStorei = _mesa_PixelStorei;
225 exec->PixelTransferf = _mesa_PixelTransferf;
226 exec->PixelTransferi = _mesa_PixelTransferi;
227 exec->PixelZoom = _mesa_PixelZoom;
228 exec->PointSize = _mesa_PointSize;
229 exec->PolygonMode = _mesa_PolygonMode;
230 exec->PolygonOffset = _mesa_PolygonOffset;
231 exec->PolygonStipple = _mesa_PolygonStipple;
232 exec->PopAttrib = _mesa_PopAttrib;
233 exec->PopMatrix = _mesa_PopMatrix;
234 exec->PopName = _mesa_PopName;
235 exec->PushAttrib = _mesa_PushAttrib;
236 exec->PushMatrix = _mesa_PushMatrix;
237 exec->PushName = _mesa_PushName;
238 exec->RasterPos2d = _mesa_RasterPos2d;
239 exec->RasterPos2dv = _mesa_RasterPos2dv;
240 exec->RasterPos2f = _mesa_RasterPos2f;
241 exec->RasterPos2fv = _mesa_RasterPos2fv;
242 exec->RasterPos2i = _mesa_RasterPos2i;
243 exec->RasterPos2iv = _mesa_RasterPos2iv;
244 exec->RasterPos2s = _mesa_RasterPos2s;
245 exec->RasterPos2sv = _mesa_RasterPos2sv;
246 exec->RasterPos3d = _mesa_RasterPos3d;
247 exec->RasterPos3dv = _mesa_RasterPos3dv;
248 exec->RasterPos3f = _mesa_RasterPos3f;
249 exec->RasterPos3fv = _mesa_RasterPos3fv;
250 exec->RasterPos3i = _mesa_RasterPos3i;
251 exec->RasterPos3iv = _mesa_RasterPos3iv;
252 exec->RasterPos3s = _mesa_RasterPos3s;
253 exec->RasterPos3sv = _mesa_RasterPos3sv;
254 exec->RasterPos4d = _mesa_RasterPos4d;
255 exec->RasterPos4dv = _mesa_RasterPos4dv;
256 exec->RasterPos4f = _mesa_RasterPos4f;
257 exec->RasterPos4fv = _mesa_RasterPos4fv;
258 exec->RasterPos4i = _mesa_RasterPos4i;
259 exec->RasterPos4iv = _mesa_RasterPos4iv;
260 exec->RasterPos4s = _mesa_RasterPos4s;
261 exec->RasterPos4sv = _mesa_RasterPos4sv;
262 exec->ReadBuffer = _mesa_ReadBuffer;
263 exec->ReadPixels = _mesa_ReadPixels;
264 exec->RenderMode = _mesa_RenderMode;
265 exec->Rotated = _mesa_Rotated;
266 exec->Rotatef = _mesa_Rotatef;
267 exec->Scaled = _mesa_Scaled;
268 exec->Scalef = _mesa_Scalef;
269 exec->Scissor = _mesa_Scissor;
270 exec->SecondaryColorPointerEXT = _mesa_SecondaryColorPointerEXT;
271 exec->SelectBuffer = _mesa_SelectBuffer;
272 exec->ShadeModel = _mesa_ShadeModel;
273 exec->StencilFunc = _mesa_StencilFunc;
274 exec->StencilMask = _mesa_StencilMask;
275 exec->StencilOp = _mesa_StencilOp;
276 exec->TexEnvf = _mesa_TexEnvf;
277 exec->TexEnvfv = _mesa_TexEnvfv;
278 exec->TexEnvi = _mesa_TexEnvi;
279 exec->TexEnviv = _mesa_TexEnviv;
280 exec->TexGend = _mesa_TexGend;
281 exec->TexGendv = _mesa_TexGendv;
282 exec->TexGenf = _mesa_TexGenf;
283 exec->TexGenfv = _mesa_TexGenfv;
284 exec->TexGeni = _mesa_TexGeni;
285 exec->TexGeniv = _mesa_TexGeniv;
286 exec->TexImage1D = _mesa_TexImage1D;
287 exec->TexImage2D = _mesa_TexImage2D;
288 exec->TexParameterf = _mesa_TexParameterf;
289 exec->TexParameterfv = _mesa_TexParameterfv;
290 exec->TexParameteri = _mesa_TexParameteri;
291 exec->TexParameteriv = _mesa_TexParameteriv;
292 exec->Translated = _mesa_Translated;
293 exec->Translatef = _mesa_Translatef;
294 exec->Viewport = _mesa_Viewport;
295
296 /* 1.1 */
297 exec->AreTexturesResident = _mesa_AreTexturesResident;
298 exec->BindTexture = _mesa_BindTexture;
299 exec->ColorPointer = _mesa_ColorPointer;
300 exec->CopyTexImage1D = _mesa_CopyTexImage1D;
301 exec->CopyTexImage2D = _mesa_CopyTexImage2D;
302 exec->CopyTexSubImage1D = _mesa_CopyTexSubImage1D;
303 exec->CopyTexSubImage2D = _mesa_CopyTexSubImage2D;
304 exec->DeleteTextures = _mesa_DeleteTextures;
305 exec->DisableClientState = _mesa_DisableClientState;
306 exec->EdgeFlagPointer = _mesa_EdgeFlagPointer;
307 exec->EnableClientState = _mesa_EnableClientState;
308 exec->GenTextures = _mesa_GenTextures;
309 exec->GetPointerv = _mesa_GetPointerv;
310 exec->IndexPointer = _mesa_IndexPointer;
311 exec->InterleavedArrays = _mesa_InterleavedArrays;
312 exec->IsTexture = _mesa_IsTexture;
313 exec->NormalPointer = _mesa_NormalPointer;
314 exec->PopClientAttrib = _mesa_PopClientAttrib;
315 exec->PrioritizeTextures = _mesa_PrioritizeTextures;
316 exec->PushClientAttrib = _mesa_PushClientAttrib;
317 exec->TexCoordPointer = _mesa_TexCoordPointer;
318 exec->TexSubImage1D = _mesa_TexSubImage1D;
319 exec->TexSubImage2D = _mesa_TexSubImage2D;
320 exec->VertexPointer = _mesa_VertexPointer;
321
322 /* 1.2 */
323 exec->CopyTexSubImage3D = _mesa_CopyTexSubImage3D;
324 exec->TexImage3D = _mesa_TexImage3D;
325 exec->TexSubImage3D = _mesa_TexSubImage3D;
326
327 /* OpenGL 1.2 GL_ARB_imaging */
328 exec->BlendColor = _mesa_BlendColor;
329 exec->BlendEquation = _mesa_BlendEquation;
330 exec->ColorSubTable = _mesa_ColorSubTable;
331 exec->ColorTable = _mesa_ColorTable;
332 exec->ColorTableParameterfv = _mesa_ColorTableParameterfv;
333 exec->ColorTableParameteriv = _mesa_ColorTableParameteriv;
334 exec->ConvolutionFilter1D = _mesa_ConvolutionFilter1D;
335 exec->ConvolutionFilter2D = _mesa_ConvolutionFilter2D;
336 exec->ConvolutionParameterf = _mesa_ConvolutionParameterf;
337 exec->ConvolutionParameterfv = _mesa_ConvolutionParameterfv;
338 exec->ConvolutionParameteri = _mesa_ConvolutionParameteri;
339 exec->ConvolutionParameteriv = _mesa_ConvolutionParameteriv;
340 exec->CopyColorSubTable = _mesa_CopyColorSubTable;
341 exec->CopyColorTable = _mesa_CopyColorTable;
342 exec->CopyConvolutionFilter1D = _mesa_CopyConvolutionFilter1D;
343 exec->CopyConvolutionFilter2D = _mesa_CopyConvolutionFilter2D;
344 exec->GetColorTable = _mesa_GetColorTable;
345 exec->GetColorTableParameterfv = _mesa_GetColorTableParameterfv;
346 exec->GetColorTableParameteriv = _mesa_GetColorTableParameteriv;
347 exec->GetConvolutionFilter = _mesa_GetConvolutionFilter;
348 exec->GetConvolutionParameterfv = _mesa_GetConvolutionParameterfv;
349 exec->GetConvolutionParameteriv = _mesa_GetConvolutionParameteriv;
350 exec->GetHistogram = _mesa_GetHistogram;
351 exec->GetHistogramParameterfv = _mesa_GetHistogramParameterfv;
352 exec->GetHistogramParameteriv = _mesa_GetHistogramParameteriv;
353 exec->GetMinmax = _mesa_GetMinmax;
354 exec->GetMinmaxParameterfv = _mesa_GetMinmaxParameterfv;
355 exec->GetMinmaxParameteriv = _mesa_GetMinmaxParameteriv;
356 exec->GetSeparableFilter = _mesa_GetSeparableFilter;
357 exec->Histogram = _mesa_Histogram;
358 exec->Minmax = _mesa_Minmax;
359 exec->ResetHistogram = _mesa_ResetHistogram;
360 exec->ResetMinmax = _mesa_ResetMinmax;
361 exec->SeparableFilter2D = _mesa_SeparableFilter2D;
362
363 /* 2. GL_EXT_blend_color */
364 #if 0
365 exec->BlendColorEXT = _mesa_BlendColorEXT;
366 #endif
367
368 /* 3. GL_EXT_polygon_offset */
369 exec->PolygonOffsetEXT = _mesa_PolygonOffsetEXT;
370
371 /* 6. GL_EXT_texture3d */
372 #if 0
373 exec->CopyTexSubImage3DEXT = _mesa_CopyTexSubImage3D;
374 exec->TexImage3DEXT = _mesa_TexImage3DEXT;
375 exec->TexSubImage3DEXT = _mesa_TexSubImage3D;
376 #endif
377
378 /* 11. GL_EXT_histogram */
379 exec->GetHistogramEXT = _mesa_GetHistogram;
380 exec->GetHistogramParameterfvEXT = _mesa_GetHistogramParameterfv;
381 exec->GetHistogramParameterivEXT = _mesa_GetHistogramParameteriv;
382 exec->GetMinmaxEXT = _mesa_GetMinmax;
383 exec->GetMinmaxParameterfvEXT = _mesa_GetMinmaxParameterfv;
384 exec->GetMinmaxParameterivEXT = _mesa_GetMinmaxParameteriv;
385
386 /* ?. GL_SGIX_pixel_texture */
387 exec->PixelTexGenSGIX = _mesa_PixelTexGenSGIX;
388
389 /* 15. GL_SGIS_pixel_texture */
390 exec->PixelTexGenParameteriSGIS = _mesa_PixelTexGenParameteriSGIS;
391 exec->PixelTexGenParameterivSGIS = _mesa_PixelTexGenParameterivSGIS;
392 exec->PixelTexGenParameterfSGIS = _mesa_PixelTexGenParameterfSGIS;
393 exec->PixelTexGenParameterfvSGIS = _mesa_PixelTexGenParameterfvSGIS;
394 exec->GetPixelTexGenParameterivSGIS = _mesa_GetPixelTexGenParameterivSGIS;
395 exec->GetPixelTexGenParameterfvSGIS = _mesa_GetPixelTexGenParameterfvSGIS;
396
397 /* 30. GL_EXT_vertex_array */
398 exec->ColorPointerEXT = _mesa_ColorPointerEXT;
399 exec->EdgeFlagPointerEXT = _mesa_EdgeFlagPointerEXT;
400 exec->IndexPointerEXT = _mesa_IndexPointerEXT;
401 exec->NormalPointerEXT = _mesa_NormalPointerEXT;
402 exec->TexCoordPointerEXT = _mesa_TexCoordPointerEXT;
403 exec->VertexPointerEXT = _mesa_VertexPointerEXT;
404
405 /* 37. GL_EXT_blend_minmax */
406 #if 0
407 exec->BlendEquationEXT = _mesa_BlendEquationEXT;
408 #endif
409
410 /* 54. GL_EXT_point_parameters */
411 exec->PointParameterfARB = _mesa_PointParameterfEXT;
412 exec->PointParameterfvARB = _mesa_PointParameterfvEXT;
413
414 /* 78. GL_EXT_paletted_texture */
415 #if 0
416 exec->ColorTableEXT = _mesa_ColorTableEXT;
417 exec->ColorSubTableEXT = _mesa_ColorSubTableEXT;
418 #endif
419 exec->GetColorTableEXT = _mesa_GetColorTable;
420 exec->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfv;
421 exec->GetColorTableParameterivEXT = _mesa_GetColorTableParameteriv;
422
423 /* 97. GL_EXT_compiled_vertex_array */
424 exec->LockArraysEXT = _mesa_LockArraysEXT;
425 exec->UnlockArraysEXT = _mesa_UnlockArraysEXT;
426
427 /* 173. GL_INGR_blend_func_separate */
428 exec->BlendFuncSeparateEXT = _mesa_BlendFuncSeparateEXT;
429
430 /* 196. GL_MESA_resize_buffers */
431 exec->ResizeBuffersMESA = _mesa_ResizeBuffersMESA;
432
433 /* 197. GL_MESA_window_pos */
434 exec->WindowPos2dMESA = _mesa_WindowPos2dMESA;
435 exec->WindowPos2dvMESA = _mesa_WindowPos2dvMESA;
436 exec->WindowPos2fMESA = _mesa_WindowPos2fMESA;
437 exec->WindowPos2fvMESA = _mesa_WindowPos2fvMESA;
438 exec->WindowPos2iMESA = _mesa_WindowPos2iMESA;
439 exec->WindowPos2ivMESA = _mesa_WindowPos2ivMESA;
440 exec->WindowPos2sMESA = _mesa_WindowPos2sMESA;
441 exec->WindowPos2svMESA = _mesa_WindowPos2svMESA;
442 exec->WindowPos3dMESA = _mesa_WindowPos3dMESA;
443 exec->WindowPos3dvMESA = _mesa_WindowPos3dvMESA;
444 exec->WindowPos3fMESA = _mesa_WindowPos3fMESA;
445 exec->WindowPos3fvMESA = _mesa_WindowPos3fvMESA;
446 exec->WindowPos3iMESA = _mesa_WindowPos3iMESA;
447 exec->WindowPos3ivMESA = _mesa_WindowPos3ivMESA;
448 exec->WindowPos3sMESA = _mesa_WindowPos3sMESA;
449 exec->WindowPos3svMESA = _mesa_WindowPos3svMESA;
450 exec->WindowPos4dMESA = _mesa_WindowPos4dMESA;
451 exec->WindowPos4dvMESA = _mesa_WindowPos4dvMESA;
452 exec->WindowPos4fMESA = _mesa_WindowPos4fMESA;
453 exec->WindowPos4fvMESA = _mesa_WindowPos4fvMESA;
454 exec->WindowPos4iMESA = _mesa_WindowPos4iMESA;
455 exec->WindowPos4ivMESA = _mesa_WindowPos4ivMESA;
456 exec->WindowPos4sMESA = _mesa_WindowPos4sMESA;
457 exec->WindowPos4svMESA = _mesa_WindowPos4svMESA;
458
459 /* ARB 1. GL_ARB_multitexture */
460 exec->ActiveTexture = _mesa_ActiveTextureARB;
461 exec->ClientActiveTexture = _mesa_ClientActiveTextureARB;
462
463 /* ARB 3. GL_ARB_transpose_matrix */
464 exec->LoadTransposeMatrixd = _mesa_LoadTransposeMatrixdARB;
465 exec->LoadTransposeMatrixf = _mesa_LoadTransposeMatrixfARB;
466 exec->MultTransposeMatrixd = _mesa_MultTransposeMatrixdARB;
467 exec->MultTransposeMatrixf = _mesa_MultTransposeMatrixfARB;
468
469 /* ARB 5. GL_ARB_multisample */
470 exec->SampleCoverage = _mesa_SampleCoverageARB;
471
472 /* ARB 12. GL_ARB_texture_compression */
473 exec->CompressedTexImage3D = _mesa_CompressedTexImage3DARB;
474 exec->CompressedTexImage2D = _mesa_CompressedTexImage2DARB;
475 exec->CompressedTexImage1D = _mesa_CompressedTexImage1DARB;
476 exec->CompressedTexSubImage3D = _mesa_CompressedTexSubImage3DARB;
477 exec->CompressedTexSubImage2D = _mesa_CompressedTexSubImage2DARB;
478 exec->CompressedTexSubImage1D = _mesa_CompressedTexSubImage1DARB;
479 exec->GetCompressedTexImage = _mesa_GetCompressedTexImageARB;
480
481 /* GL_ARB_window_pos */
482 exec->WindowPos2dARB = _mesa_WindowPos2dARB;
483 exec->WindowPos2dvARB = _mesa_WindowPos2dvARB;
484 exec->WindowPos2fARB = _mesa_WindowPos2fARB;
485 exec->WindowPos2fvARB = _mesa_WindowPos2fvARB;
486 exec->WindowPos2iARB = _mesa_WindowPos2iARB;
487 exec->WindowPos2ivARB = _mesa_WindowPos2ivARB;
488 exec->WindowPos2sARB = _mesa_WindowPos2sARB;
489 exec->WindowPos2svARB = _mesa_WindowPos2svARB;
490 exec->WindowPos3dARB = _mesa_WindowPos3dARB;
491 exec->WindowPos3dvARB = _mesa_WindowPos3dvARB;
492 exec->WindowPos3fARB = _mesa_WindowPos3fARB;
493 exec->WindowPos3fvARB = _mesa_WindowPos3fvARB;
494 exec->WindowPos3iARB = _mesa_WindowPos3iARB;
495 exec->WindowPos3ivARB = _mesa_WindowPos3ivARB;
496 exec->WindowPos3sARB = _mesa_WindowPos3sARB;
497 exec->WindowPos3svARB = _mesa_WindowPos3svARB;
498 }
499
500
501
502 /**********************************************************************/
503 /***** State update logic *****/
504 /**********************************************************************/
505
506
507 static void
508 update_polygon( GLcontext *ctx )
509 {
510 ctx->_TriangleCaps &= ~(DD_TRI_CULL_FRONT_BACK | DD_TRI_OFFSET);
511
512 if (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK)
513 ctx->_TriangleCaps |= DD_TRI_CULL_FRONT_BACK;
514
515 /* Any Polygon offsets enabled? */
516 ctx->Polygon._OffsetAny = GL_FALSE;
517 ctx->_TriangleCaps &= ~DD_TRI_OFFSET;
518
519 if (ctx->Polygon.OffsetPoint ||
520 ctx->Polygon.OffsetLine ||
521 ctx->Polygon.OffsetFill) {
522 ctx->_TriangleCaps |= DD_TRI_OFFSET;
523 ctx->Polygon._OffsetAny = GL_TRUE;
524 }
525 }
526
527 static void
528 calculate_model_project_matrix( GLcontext *ctx )
529 {
530 if (!ctx->_NeedEyeCoords) {
531 _math_matrix_mul_matrix( &ctx->_ModelProjectMatrix,
532 &ctx->ProjectionMatrix,
533 &ctx->ModelView );
534
535 _math_matrix_analyse( &ctx->_ModelProjectMatrix );
536 }
537 }
538
539 static void
540 update_modelview_scale( GLcontext *ctx )
541 {
542 ctx->_ModelViewInvScale = 1.0F;
543 if (ctx->ModelView.flags & (MAT_FLAG_UNIFORM_SCALE |
544 MAT_FLAG_GENERAL_SCALE |
545 MAT_FLAG_GENERAL_3D |
546 MAT_FLAG_GENERAL) ) {
547 const GLfloat *m = ctx->ModelView.inv;
548 GLfloat f = m[2] * m[2] + m[6] * m[6] + m[10] * m[10];
549 if (f < 1e-12) f = 1.0;
550 if (ctx->_NeedEyeCoords)
551 ctx->_ModelViewInvScale = (GLfloat) (1.0/GL_SQRT(f));
552 else
553 ctx->_ModelViewInvScale = (GLfloat) GL_SQRT(f);
554 }
555 }
556
557
558 /* Bring uptodate any state that relies on _NeedEyeCoords.
559 */
560 static void
561 update_tnl_spaces( GLcontext *ctx, GLuint oldneedeyecoords )
562 {
563 /* Check if the truth-value interpretations of the bitfields have
564 * changed:
565 */
566 if ((oldneedeyecoords == 0) != (ctx->_NeedEyeCoords == 0)) {
567 /* Recalculate all state that depends on _NeedEyeCoords.
568 */
569 update_modelview_scale(ctx);
570 calculate_model_project_matrix(ctx);
571 _mesa_compute_light_positions( ctx );
572
573 if (ctx->Driver.LightingSpaceChange)
574 ctx->Driver.LightingSpaceChange( ctx );
575 }
576 else {
577 GLuint new_state = ctx->NewState;
578
579 /* Recalculate that same state only if it has been invalidated
580 * by other statechanges.
581 */
582 if (new_state & _NEW_MODELVIEW)
583 update_modelview_scale(ctx);
584
585 if (new_state & (_NEW_MODELVIEW|_NEW_PROJECTION))
586 calculate_model_project_matrix(ctx);
587
588 if (new_state & (_NEW_LIGHT|_NEW_MODELVIEW))
589 _mesa_compute_light_positions( ctx );
590 }
591 }
592
593
594 static void
595 update_drawbuffer( GLcontext *ctx )
596 {
597 ctx->DrawBuffer->_Xmin = 0;
598 ctx->DrawBuffer->_Ymin = 0;
599 ctx->DrawBuffer->_Xmax = ctx->DrawBuffer->Width;
600 ctx->DrawBuffer->_Ymax = ctx->DrawBuffer->Height;
601 if (ctx->Scissor.Enabled) {
602 if (ctx->Scissor.X > ctx->DrawBuffer->_Xmin) {
603 ctx->DrawBuffer->_Xmin = ctx->Scissor.X;
604 }
605 if (ctx->Scissor.Y > ctx->DrawBuffer->_Ymin) {
606 ctx->DrawBuffer->_Ymin = ctx->Scissor.Y;
607 }
608 if (ctx->Scissor.X + ctx->Scissor.Width < ctx->DrawBuffer->_Xmax) {
609 ctx->DrawBuffer->_Xmax = ctx->Scissor.X + ctx->Scissor.Width;
610 }
611 if (ctx->Scissor.Y + ctx->Scissor.Height < ctx->DrawBuffer->_Ymax) {
612 ctx->DrawBuffer->_Ymax = ctx->Scissor.Y + ctx->Scissor.Height;
613 }
614 }
615 }
616
617
618 /* NOTE: This routine references Tranform attribute values to compute
619 * userclip positions in clip space, but is only called on
620 * _NEW_PROJECTION. The _mesa_ClipPlane() function keeps these values
621 * uptodate across changes to the Transform attributes.
622 */
623 static void
624 update_projection( GLcontext *ctx )
625 {
626 _math_matrix_analyse( &ctx->ProjectionMatrix );
627
628 /* Recompute clip plane positions in clipspace. This is also done
629 * in _mesa_ClipPlane().
630 */
631 if (ctx->Transform._AnyClip) {
632 GLuint p;
633 for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
634 if (ctx->Transform.ClipEnabled[p]) {
635 _mesa_transform_vector( ctx->Transform._ClipUserPlane[p],
636 ctx->Transform.EyeUserPlane[p],
637 ctx->ProjectionMatrix.inv );
638 }
639 }
640 }
641 }
642
643
644 /*
645 * Return a bitmask of IMAGE_*_BIT flags which to indicate which
646 * pixel transfer operations are enabled.
647 */
648 static void
649 update_image_transfer_state(GLcontext *ctx)
650 {
651 GLuint mask = 0;
652
653 if (ctx->Pixel.RedScale != 1.0F || ctx->Pixel.RedBias != 0.0F ||
654 ctx->Pixel.GreenScale != 1.0F || ctx->Pixel.GreenBias != 0.0F ||
655 ctx->Pixel.BlueScale != 1.0F || ctx->Pixel.BlueBias != 0.0F ||
656 ctx->Pixel.AlphaScale != 1.0F || ctx->Pixel.AlphaBias != 0.0F)
657 mask |= IMAGE_SCALE_BIAS_BIT;
658
659 if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset)
660 mask |= IMAGE_SHIFT_OFFSET_BIT;
661
662 if (ctx->Pixel.MapColorFlag)
663 mask |= IMAGE_MAP_COLOR_BIT;
664
665 if (ctx->Pixel.ColorTableEnabled)
666 mask |= IMAGE_COLOR_TABLE_BIT;
667
668 if (ctx->Pixel.Convolution1DEnabled ||
669 ctx->Pixel.Convolution2DEnabled ||
670 ctx->Pixel.Separable2DEnabled) {
671 mask |= IMAGE_CONVOLUTION_BIT;
672 if (ctx->Pixel.PostConvolutionScale[0] != 1.0F ||
673 ctx->Pixel.PostConvolutionScale[1] != 1.0F ||
674 ctx->Pixel.PostConvolutionScale[2] != 1.0F ||
675 ctx->Pixel.PostConvolutionScale[3] != 1.0F ||
676 ctx->Pixel.PostConvolutionBias[0] != 0.0F ||
677 ctx->Pixel.PostConvolutionBias[1] != 0.0F ||
678 ctx->Pixel.PostConvolutionBias[2] != 0.0F ||
679 ctx->Pixel.PostConvolutionBias[3] != 0.0F) {
680 mask |= IMAGE_POST_CONVOLUTION_SCALE_BIAS;
681 }
682 }
683
684 if (ctx->Pixel.PostConvolutionColorTableEnabled)
685 mask |= IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT;
686
687 if (ctx->ColorMatrix.type != MATRIX_IDENTITY ||
688 ctx->Pixel.PostColorMatrixScale[0] != 1.0F ||
689 ctx->Pixel.PostColorMatrixBias[0] != 0.0F ||
690 ctx->Pixel.PostColorMatrixScale[1] != 1.0F ||
691 ctx->Pixel.PostColorMatrixBias[1] != 0.0F ||
692 ctx->Pixel.PostColorMatrixScale[2] != 1.0F ||
693 ctx->Pixel.PostColorMatrixBias[2] != 0.0F ||
694 ctx->Pixel.PostColorMatrixScale[3] != 1.0F ||
695 ctx->Pixel.PostColorMatrixBias[3] != 0.0F)
696 mask |= IMAGE_COLOR_MATRIX_BIT;
697
698 if (ctx->Pixel.PostColorMatrixColorTableEnabled)
699 mask |= IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT;
700
701 if (ctx->Pixel.HistogramEnabled)
702 mask |= IMAGE_HISTOGRAM_BIT;
703
704 if (ctx->Pixel.MinMaxEnabled)
705 mask |= IMAGE_MIN_MAX_BIT;
706
707 ctx->_ImageTransferState = mask;
708 }
709
710
711
712
713 /* Note: This routine refers to derived texture attribute values to
714 * compute the ENABLE_TEXMAT flags, but is only called on
715 * _NEW_TEXTURE_MATRIX. On changes to _NEW_TEXTURE, the ENABLE_TEXMAT
716 * flags are updated by _mesa_update_textures(), below.
717 *
718 * If both TEXTURE and TEXTURE_MATRIX change at once, these values
719 * will be computed twice.
720 */
721 static void
722 update_texture_matrices( GLcontext *ctx )
723 {
724 GLuint i;
725
726 ctx->Texture._TexMatEnabled = 0;
727
728 for (i=0; i < ctx->Const.MaxTextureUnits; i++) {
729 if (ctx->TextureMatrix[i].flags & MAT_DIRTY) {
730 _math_matrix_analyse( &ctx->TextureMatrix[i] );
731
732 if (ctx->Driver.TextureMatrix)
733 ctx->Driver.TextureMatrix( ctx, i, &ctx->TextureMatrix[i] );
734
735 if (ctx->Texture.Unit[i]._ReallyEnabled &&
736 ctx->TextureMatrix[i].type != MATRIX_IDENTITY)
737 ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(i);
738 }
739 }
740 }
741
742
743 /* Note: This routine refers to derived texture matrix values to
744 * compute the ENABLE_TEXMAT flags, but is only called on
745 * _NEW_TEXTURE. On changes to _NEW_TEXTURE_MATRIX, the ENABLE_TEXMAT
746 * flags are updated by _mesa_update_texture_matrices, above.
747 *
748 * If both TEXTURE and TEXTURE_MATRIX change at once, these values
749 * will be computed twice.
750 */
751 static void
752 update_texture_state( GLcontext *ctx )
753 {
754 GLuint i;
755
756 ctx->Texture._ReallyEnabled = 0;
757 ctx->Texture._GenFlags = 0;
758 ctx->_NeedNormals &= ~NEED_NORMALS_TEXGEN;
759 ctx->_NeedEyeCoords &= ~NEED_EYE_TEXGEN;
760 ctx->Texture._TexMatEnabled = 0;
761 ctx->Texture._TexGenEnabled = 0;
762
763 /* Update texture unit state.
764 */
765 for (i=0; i < ctx->Const.MaxTextureUnits; i++) {
766 struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
767
768 texUnit->_ReallyEnabled = 0;
769 texUnit->_GenFlags = 0;
770
771 if (!texUnit->Enabled)
772 continue;
773
774 /* Find the texture of highest dimensionality that is enabled
775 * and complete. We'll use it for texturing.
776 */
777 if (texUnit->Enabled & TEXTURE0_CUBE) {
778 struct gl_texture_object *texObj = texUnit->CurrentCubeMap;
779 if (!texObj->Complete) {
780 _mesa_test_texobj_completeness(ctx, texObj);
781 }
782 if (texObj->Complete) {
783 texUnit->_ReallyEnabled = TEXTURE0_CUBE;
784 texUnit->_Current = texObj;
785 }
786 }
787
788 if (!texUnit->_ReallyEnabled && (texUnit->Enabled & TEXTURE0_3D)) {
789 struct gl_texture_object *texObj = texUnit->Current3D;
790 if (!texObj->Complete) {
791 _mesa_test_texobj_completeness(ctx, texObj);
792 }
793 if (texObj->Complete) {
794 texUnit->_ReallyEnabled = TEXTURE0_3D;
795 texUnit->_Current = texObj;
796 }
797 }
798
799 if (!texUnit->_ReallyEnabled && (texUnit->Enabled & TEXTURE0_2D)) {
800 struct gl_texture_object *texObj = texUnit->Current2D;
801 if (!texObj->Complete) {
802 _mesa_test_texobj_completeness(ctx, texObj);
803 }
804 if (texObj->Complete) {
805 texUnit->_ReallyEnabled = TEXTURE0_2D;
806 texUnit->_Current = texObj;
807 }
808 }
809
810 if (!texUnit->_ReallyEnabled && (texUnit->Enabled & TEXTURE0_1D)) {
811 struct gl_texture_object *texObj = texUnit->Current1D;
812 if (!texObj->Complete) {
813 _mesa_test_texobj_completeness(ctx, texObj);
814 }
815 if (texObj->Complete) {
816 texUnit->_ReallyEnabled = TEXTURE0_1D;
817 texUnit->_Current = texObj;
818 }
819 }
820
821 if (!texUnit->_ReallyEnabled) {
822 texUnit->_Current = NULL;
823 continue;
824 }
825
826 {
827 GLuint flag = texUnit->_ReallyEnabled << (i * 4);
828 ctx->Texture._ReallyEnabled |= flag;
829 }
830
831 if (texUnit->TexGenEnabled) {
832 if (texUnit->TexGenEnabled & S_BIT) {
833 texUnit->_GenFlags |= texUnit->_GenBitS;
834 }
835 if (texUnit->TexGenEnabled & T_BIT) {
836 texUnit->_GenFlags |= texUnit->_GenBitT;
837 }
838 if (texUnit->TexGenEnabled & Q_BIT) {
839 texUnit->_GenFlags |= texUnit->_GenBitQ;
840 }
841 if (texUnit->TexGenEnabled & R_BIT) {
842 texUnit->_GenFlags |= texUnit->_GenBitR;
843 }
844
845 ctx->Texture._TexGenEnabled |= ENABLE_TEXGEN(i);
846 ctx->Texture._GenFlags |= texUnit->_GenFlags;
847 }
848
849 if (ctx->TextureMatrix[i].type != MATRIX_IDENTITY)
850 ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(i);
851 }
852
853 if (ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS) {
854 ctx->_NeedNormals |= NEED_NORMALS_TEXGEN;
855 ctx->_NeedEyeCoords |= NEED_EYE_TEXGEN;
856 }
857
858 if (ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD) {
859 ctx->_NeedEyeCoords |= NEED_EYE_TEXGEN;
860 }
861 }
862
863
864 /*
865 * If ctx->NewState is non-zero then this function MUST be called before
866 * rendering any primitive. Basically, function pointers and miscellaneous
867 * flags are updated to reflect the current state of the state machine.
868 *
869 * The above constraint is now maintained largely by the two Exec
870 * dispatch tables, which trigger the appropriate flush on transition
871 * between State and Geometry modes.
872 *
873 * Special care is taken with the derived value _NeedEyeCoords. This
874 * is a bitflag which is updated with information from a number of
875 * attribute groups (MODELVIEW, LIGHT, TEXTURE). A lot of derived
876 * state references this value, and must be treated with care to
877 * ensure that updates are done correctly. All state dependent on
878 * _NeedEyeCoords is calculated from within _mesa_update_tnl_spaces(),
879 * and from nowhere else.
880 */
881 void _mesa_update_state( GLcontext *ctx )
882 {
883 const GLuint new_state = ctx->NewState;
884 const GLuint oldneedeyecoords = ctx->_NeedEyeCoords;
885
886 if (MESA_VERBOSE & VERBOSE_STATE)
887 _mesa_print_state("", new_state);
888
889 if (new_state & _NEW_MODELVIEW)
890 _math_matrix_analyse( &ctx->ModelView );
891
892 if (new_state & _NEW_PROJECTION)
893 update_projection( ctx );
894
895 if (new_state & _NEW_TEXTURE_MATRIX)
896 update_texture_matrices( ctx );
897
898 if (new_state & _NEW_COLOR_MATRIX)
899 _math_matrix_analyse( &ctx->ColorMatrix );
900
901 /* References ColorMatrix.type (derived above).
902 */
903 if (new_state & _IMAGE_NEW_TRANSFER_STATE)
904 update_image_transfer_state(ctx);
905
906 /* Contributes to NeedEyeCoords, NeedNormals.
907 */
908 if (new_state & _NEW_TEXTURE)
909 update_texture_state( ctx );
910
911 if (new_state & (_NEW_BUFFERS|_NEW_SCISSOR))
912 update_drawbuffer( ctx );
913
914 if (new_state & _NEW_POLYGON)
915 update_polygon( ctx );
916
917 /* Contributes to NeedEyeCoords, NeedNormals.
918 */
919 if (new_state & _NEW_LIGHT)
920 _mesa_update_lighting( ctx );
921
922 /* We can light in object space if the modelview matrix preserves
923 * lengths and relative angles.
924 */
925 if (new_state & (_NEW_MODELVIEW|_NEW_LIGHT)) {
926 ctx->_NeedEyeCoords &= ~NEED_EYE_LIGHT_MODELVIEW;
927 if (ctx->Light.Enabled &&
928 !TEST_MAT_FLAGS( &ctx->ModelView, MAT_FLAGS_LENGTH_PRESERVING))
929 ctx->_NeedEyeCoords |= NEED_EYE_LIGHT_MODELVIEW;
930 }
931
932
933 /* ctx->_NeedEyeCoords is now uptodate.
934 *
935 * If the truth value of this variable has changed, update for the
936 * new lighting space and recompute the positions of lights and the
937 * normal transform.
938 *
939 * If the lighting space hasn't changed, may still need to recompute
940 * light positions & normal transforms for other reasons.
941 */
942 if (new_state & (_NEW_MODELVIEW |
943 _NEW_PROJECTION |
944 _NEW_LIGHT |
945 _MESA_NEW_NEED_EYE_COORDS))
946 update_tnl_spaces( ctx, oldneedeyecoords );
947
948 /*
949 * Here the driver sets up all the ctx->Driver function pointers
950 * to it's specific, private functions, and performs any
951 * internal state management necessary, including invalidating
952 * state of active modules.
953 *
954 * Set ctx->NewState to zero to avoid recursion if
955 * Driver.UpdateState() has to call FLUSH_VERTICES(). (fixed?)
956 */
957 ctx->NewState = 0;
958 ctx->Driver.UpdateState(ctx, new_state);
959 ctx->Array.NewState = 0;
960
961 /* At this point we can do some assertions to be sure the required
962 * device driver function pointers are all initialized.
963 */
964 ASSERT(ctx->Driver.GetString);
965 ASSERT(ctx->Driver.UpdateState);
966 ASSERT(ctx->Driver.Clear);
967 ASSERT(ctx->Driver.SetDrawBuffer);
968 ASSERT(ctx->Driver.GetBufferSize);
969 if (ctx->Visual.accumRedBits > 0) {
970 ASSERT(ctx->Driver.Accum);
971 }
972 ASSERT(ctx->Driver.DrawPixels);
973 ASSERT(ctx->Driver.ReadPixels);
974 ASSERT(ctx->Driver.CopyPixels);
975 ASSERT(ctx->Driver.Bitmap);
976 ASSERT(ctx->Driver.ResizeBuffersMESA);
977 ASSERT(ctx->Driver.TexImage1D);
978 ASSERT(ctx->Driver.TexImage2D);
979 ASSERT(ctx->Driver.TexImage3D);
980 ASSERT(ctx->Driver.TexSubImage1D);
981 ASSERT(ctx->Driver.TexSubImage2D);
982 ASSERT(ctx->Driver.TexSubImage3D);
983 ASSERT(ctx->Driver.CopyTexImage1D);
984 ASSERT(ctx->Driver.CopyTexImage2D);
985 ASSERT(ctx->Driver.CopyTexSubImage1D);
986 ASSERT(ctx->Driver.CopyTexSubImage2D);
987 ASSERT(ctx->Driver.CopyTexSubImage3D);
988 if (ctx->Extensions.ARB_texture_compression) {
989 ASSERT(ctx->Driver.BaseCompressedTexFormat);
990 ASSERT(ctx->Driver.CompressedTextureSize);
991 ASSERT(ctx->Driver.GetCompressedTexImage);
992 #if 0 /* HW drivers need these, but not SW rasterizers */
993 ASSERT(ctx->Driver.CompressedTexImage1D);
994 ASSERT(ctx->Driver.CompressedTexImage2D);
995 ASSERT(ctx->Driver.CompressedTexImage3D);
996 ASSERT(ctx->Driver.CompressedTexSubImage1D);
997 ASSERT(ctx->Driver.CompressedTexSubImage2D);
998 ASSERT(ctx->Driver.CompressedTexSubImage3D);
999 #endif
1000 }
1001 }