1 /* $Id: state.c,v 1.83 2002/05/29 15:16:02 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
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:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
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.
29 * This file manages recalculation of derived values in the
39 #include "api_loopback.h"
56 #include "histogram.h"
74 #include "math/m_matrix.h"
75 #include "math/m_xform.h"
83 _mesa_problem(NULL
, "undefined function dispatch");
90 * Set all pointers in the given dispatch table to point to a
91 * generic no-op function.
94 _mesa_init_no_op_table(struct _glapi_table
*table
, GLuint tableSize
)
97 void **dispatch
= (void **) table
;
98 for (i
= 0; i
< tableSize
; i
++) {
99 dispatch
[i
] = (void *) generic_noop
;
106 * Initialize the given dispatch table with pointers to Mesa's
107 * immediate-mode commands.
109 * Pointers to begin/end object commands and a few others
110 * are provided via the vtxfmt interface elsewhere.
113 _mesa_init_exec_table(struct _glapi_table
*exec
, GLuint tableSize
)
115 /* first initialize all dispatch slots to no-op */
116 _mesa_init_no_op_table(exec
, tableSize
);
118 _mesa_loopback_init_api_table( exec
, GL_TRUE
);
120 /* load the dispatch slots we understand */
121 exec
->Accum
= _mesa_Accum
;
122 exec
->AlphaFunc
= _mesa_AlphaFunc
;
123 exec
->Bitmap
= _mesa_Bitmap
;
124 exec
->BlendFunc
= _mesa_BlendFunc
;
125 exec
->CallList
= _mesa_CallList
;
126 exec
->CallLists
= _mesa_CallLists
;
127 exec
->Clear
= _mesa_Clear
;
128 exec
->ClearAccum
= _mesa_ClearAccum
;
129 exec
->ClearColor
= _mesa_ClearColor
;
130 exec
->ClearDepth
= _mesa_ClearDepth
;
131 exec
->ClearIndex
= _mesa_ClearIndex
;
132 exec
->ClearStencil
= _mesa_ClearStencil
;
133 exec
->ClipPlane
= _mesa_ClipPlane
;
134 exec
->ColorMask
= _mesa_ColorMask
;
135 exec
->ColorMaterial
= _mesa_ColorMaterial
;
136 exec
->CopyPixels
= _mesa_CopyPixels
;
137 exec
->CullFace
= _mesa_CullFace
;
138 exec
->DeleteLists
= _mesa_DeleteLists
;
139 exec
->DepthFunc
= _mesa_DepthFunc
;
140 exec
->DepthMask
= _mesa_DepthMask
;
141 exec
->DepthRange
= _mesa_DepthRange
;
142 exec
->Disable
= _mesa_Disable
;
143 exec
->DrawBuffer
= _mesa_DrawBuffer
;
144 exec
->DrawPixels
= _mesa_DrawPixels
;
145 exec
->Enable
= _mesa_Enable
;
146 exec
->EndList
= _mesa_EndList
;
147 exec
->FeedbackBuffer
= _mesa_FeedbackBuffer
;
148 exec
->Finish
= _mesa_Finish
;
149 exec
->Flush
= _mesa_Flush
;
150 exec
->FogCoordPointerEXT
= _mesa_FogCoordPointerEXT
;
151 exec
->Fogf
= _mesa_Fogf
;
152 exec
->Fogfv
= _mesa_Fogfv
;
153 exec
->Fogi
= _mesa_Fogi
;
154 exec
->Fogiv
= _mesa_Fogiv
;
155 exec
->FrontFace
= _mesa_FrontFace
;
156 exec
->Frustum
= _mesa_Frustum
;
157 exec
->GenLists
= _mesa_GenLists
;
158 exec
->GetBooleanv
= _mesa_GetBooleanv
;
159 exec
->GetClipPlane
= _mesa_GetClipPlane
;
160 exec
->GetDoublev
= _mesa_GetDoublev
;
161 exec
->GetError
= _mesa_GetError
;
162 exec
->GetFloatv
= _mesa_GetFloatv
;
163 exec
->GetIntegerv
= _mesa_GetIntegerv
;
164 exec
->GetLightfv
= _mesa_GetLightfv
;
165 exec
->GetLightiv
= _mesa_GetLightiv
;
166 exec
->GetMapdv
= _mesa_GetMapdv
;
167 exec
->GetMapfv
= _mesa_GetMapfv
;
168 exec
->GetMapiv
= _mesa_GetMapiv
;
169 exec
->GetMaterialfv
= _mesa_GetMaterialfv
;
170 exec
->GetMaterialiv
= _mesa_GetMaterialiv
;
171 exec
->GetPixelMapfv
= _mesa_GetPixelMapfv
;
172 exec
->GetPixelMapuiv
= _mesa_GetPixelMapuiv
;
173 exec
->GetPixelMapusv
= _mesa_GetPixelMapusv
;
174 exec
->GetPolygonStipple
= _mesa_GetPolygonStipple
;
175 exec
->GetString
= _mesa_GetString
;
176 exec
->GetTexEnvfv
= _mesa_GetTexEnvfv
;
177 exec
->GetTexEnviv
= _mesa_GetTexEnviv
;
178 exec
->GetTexGendv
= _mesa_GetTexGendv
;
179 exec
->GetTexGenfv
= _mesa_GetTexGenfv
;
180 exec
->GetTexGeniv
= _mesa_GetTexGeniv
;
181 exec
->GetTexImage
= _mesa_GetTexImage
;
182 exec
->GetTexLevelParameterfv
= _mesa_GetTexLevelParameterfv
;
183 exec
->GetTexLevelParameteriv
= _mesa_GetTexLevelParameteriv
;
184 exec
->GetTexParameterfv
= _mesa_GetTexParameterfv
;
185 exec
->GetTexParameteriv
= _mesa_GetTexParameteriv
;
186 exec
->Hint
= _mesa_Hint
;
187 exec
->IndexMask
= _mesa_IndexMask
;
188 exec
->InitNames
= _mesa_InitNames
;
189 exec
->IsEnabled
= _mesa_IsEnabled
;
190 exec
->IsList
= _mesa_IsList
;
191 exec
->LightModelf
= _mesa_LightModelf
;
192 exec
->LightModelfv
= _mesa_LightModelfv
;
193 exec
->LightModeli
= _mesa_LightModeli
;
194 exec
->LightModeliv
= _mesa_LightModeliv
;
195 exec
->Lightf
= _mesa_Lightf
;
196 exec
->Lightfv
= _mesa_Lightfv
;
197 exec
->Lighti
= _mesa_Lighti
;
198 exec
->Lightiv
= _mesa_Lightiv
;
199 exec
->LineStipple
= _mesa_LineStipple
;
200 exec
->LineWidth
= _mesa_LineWidth
;
201 exec
->ListBase
= _mesa_ListBase
;
202 exec
->LoadIdentity
= _mesa_LoadIdentity
;
203 exec
->LoadMatrixd
= _mesa_LoadMatrixd
;
204 exec
->LoadMatrixf
= _mesa_LoadMatrixf
;
205 exec
->LoadName
= _mesa_LoadName
;
206 exec
->LogicOp
= _mesa_LogicOp
;
207 exec
->Map1d
= _mesa_Map1d
;
208 exec
->Map1f
= _mesa_Map1f
;
209 exec
->Map2d
= _mesa_Map2d
;
210 exec
->Map2f
= _mesa_Map2f
;
211 exec
->MapGrid1d
= _mesa_MapGrid1d
;
212 exec
->MapGrid1f
= _mesa_MapGrid1f
;
213 exec
->MapGrid2d
= _mesa_MapGrid2d
;
214 exec
->MapGrid2f
= _mesa_MapGrid2f
;
215 exec
->MatrixMode
= _mesa_MatrixMode
;
216 exec
->MultMatrixd
= _mesa_MultMatrixd
;
217 exec
->MultMatrixf
= _mesa_MultMatrixf
;
218 exec
->NewList
= _mesa_NewList
;
219 exec
->Ortho
= _mesa_Ortho
;
220 exec
->PassThrough
= _mesa_PassThrough
;
221 exec
->PixelMapfv
= _mesa_PixelMapfv
;
222 exec
->PixelMapuiv
= _mesa_PixelMapuiv
;
223 exec
->PixelMapusv
= _mesa_PixelMapusv
;
224 exec
->PixelStoref
= _mesa_PixelStoref
;
225 exec
->PixelStorei
= _mesa_PixelStorei
;
226 exec
->PixelTransferf
= _mesa_PixelTransferf
;
227 exec
->PixelTransferi
= _mesa_PixelTransferi
;
228 exec
->PixelZoom
= _mesa_PixelZoom
;
229 exec
->PointSize
= _mesa_PointSize
;
230 exec
->PolygonMode
= _mesa_PolygonMode
;
231 exec
->PolygonOffset
= _mesa_PolygonOffset
;
232 exec
->PolygonStipple
= _mesa_PolygonStipple
;
233 exec
->PopAttrib
= _mesa_PopAttrib
;
234 exec
->PopMatrix
= _mesa_PopMatrix
;
235 exec
->PopName
= _mesa_PopName
;
236 exec
->PushAttrib
= _mesa_PushAttrib
;
237 exec
->PushMatrix
= _mesa_PushMatrix
;
238 exec
->PushName
= _mesa_PushName
;
239 exec
->RasterPos2d
= _mesa_RasterPos2d
;
240 exec
->RasterPos2dv
= _mesa_RasterPos2dv
;
241 exec
->RasterPos2f
= _mesa_RasterPos2f
;
242 exec
->RasterPos2fv
= _mesa_RasterPos2fv
;
243 exec
->RasterPos2i
= _mesa_RasterPos2i
;
244 exec
->RasterPos2iv
= _mesa_RasterPos2iv
;
245 exec
->RasterPos2s
= _mesa_RasterPos2s
;
246 exec
->RasterPos2sv
= _mesa_RasterPos2sv
;
247 exec
->RasterPos3d
= _mesa_RasterPos3d
;
248 exec
->RasterPos3dv
= _mesa_RasterPos3dv
;
249 exec
->RasterPos3f
= _mesa_RasterPos3f
;
250 exec
->RasterPos3fv
= _mesa_RasterPos3fv
;
251 exec
->RasterPos3i
= _mesa_RasterPos3i
;
252 exec
->RasterPos3iv
= _mesa_RasterPos3iv
;
253 exec
->RasterPos3s
= _mesa_RasterPos3s
;
254 exec
->RasterPos3sv
= _mesa_RasterPos3sv
;
255 exec
->RasterPos4d
= _mesa_RasterPos4d
;
256 exec
->RasterPos4dv
= _mesa_RasterPos4dv
;
257 exec
->RasterPos4f
= _mesa_RasterPos4f
;
258 exec
->RasterPos4fv
= _mesa_RasterPos4fv
;
259 exec
->RasterPos4i
= _mesa_RasterPos4i
;
260 exec
->RasterPos4iv
= _mesa_RasterPos4iv
;
261 exec
->RasterPos4s
= _mesa_RasterPos4s
;
262 exec
->RasterPos4sv
= _mesa_RasterPos4sv
;
263 exec
->ReadBuffer
= _mesa_ReadBuffer
;
264 exec
->ReadPixels
= _mesa_ReadPixels
;
265 exec
->RenderMode
= _mesa_RenderMode
;
266 exec
->Rotated
= _mesa_Rotated
;
267 exec
->Rotatef
= _mesa_Rotatef
;
268 exec
->Scaled
= _mesa_Scaled
;
269 exec
->Scalef
= _mesa_Scalef
;
270 exec
->Scissor
= _mesa_Scissor
;
271 exec
->SecondaryColorPointerEXT
= _mesa_SecondaryColorPointerEXT
;
272 exec
->SelectBuffer
= _mesa_SelectBuffer
;
273 exec
->ShadeModel
= _mesa_ShadeModel
;
274 exec
->StencilFunc
= _mesa_StencilFunc
;
275 exec
->StencilMask
= _mesa_StencilMask
;
276 exec
->StencilOp
= _mesa_StencilOp
;
277 exec
->TexEnvf
= _mesa_TexEnvf
;
278 exec
->TexEnvfv
= _mesa_TexEnvfv
;
279 exec
->TexEnvi
= _mesa_TexEnvi
;
280 exec
->TexEnviv
= _mesa_TexEnviv
;
281 exec
->TexGend
= _mesa_TexGend
;
282 exec
->TexGendv
= _mesa_TexGendv
;
283 exec
->TexGenf
= _mesa_TexGenf
;
284 exec
->TexGenfv
= _mesa_TexGenfv
;
285 exec
->TexGeni
= _mesa_TexGeni
;
286 exec
->TexGeniv
= _mesa_TexGeniv
;
287 exec
->TexImage1D
= _mesa_TexImage1D
;
288 exec
->TexImage2D
= _mesa_TexImage2D
;
289 exec
->TexParameterf
= _mesa_TexParameterf
;
290 exec
->TexParameterfv
= _mesa_TexParameterfv
;
291 exec
->TexParameteri
= _mesa_TexParameteri
;
292 exec
->TexParameteriv
= _mesa_TexParameteriv
;
293 exec
->Translated
= _mesa_Translated
;
294 exec
->Translatef
= _mesa_Translatef
;
295 exec
->Viewport
= _mesa_Viewport
;
298 exec
->AreTexturesResident
= _mesa_AreTexturesResident
;
299 exec
->BindTexture
= _mesa_BindTexture
;
300 exec
->ColorPointer
= _mesa_ColorPointer
;
301 exec
->CopyTexImage1D
= _mesa_CopyTexImage1D
;
302 exec
->CopyTexImage2D
= _mesa_CopyTexImage2D
;
303 exec
->CopyTexSubImage1D
= _mesa_CopyTexSubImage1D
;
304 exec
->CopyTexSubImage2D
= _mesa_CopyTexSubImage2D
;
305 exec
->DeleteTextures
= _mesa_DeleteTextures
;
306 exec
->DisableClientState
= _mesa_DisableClientState
;
307 exec
->EdgeFlagPointer
= _mesa_EdgeFlagPointer
;
308 exec
->EnableClientState
= _mesa_EnableClientState
;
309 exec
->GenTextures
= _mesa_GenTextures
;
310 exec
->GetPointerv
= _mesa_GetPointerv
;
311 exec
->IndexPointer
= _mesa_IndexPointer
;
312 exec
->InterleavedArrays
= _mesa_InterleavedArrays
;
313 exec
->IsTexture
= _mesa_IsTexture
;
314 exec
->NormalPointer
= _mesa_NormalPointer
;
315 exec
->PopClientAttrib
= _mesa_PopClientAttrib
;
316 exec
->PrioritizeTextures
= _mesa_PrioritizeTextures
;
317 exec
->PushClientAttrib
= _mesa_PushClientAttrib
;
318 exec
->TexCoordPointer
= _mesa_TexCoordPointer
;
319 exec
->TexSubImage1D
= _mesa_TexSubImage1D
;
320 exec
->TexSubImage2D
= _mesa_TexSubImage2D
;
321 exec
->VertexPointer
= _mesa_VertexPointer
;
324 exec
->CopyTexSubImage3D
= _mesa_CopyTexSubImage3D
;
325 exec
->TexImage3D
= _mesa_TexImage3D
;
326 exec
->TexSubImage3D
= _mesa_TexSubImage3D
;
328 /* OpenGL 1.2 GL_ARB_imaging */
329 exec
->BlendColor
= _mesa_BlendColor
;
330 exec
->BlendEquation
= _mesa_BlendEquation
;
331 exec
->ColorSubTable
= _mesa_ColorSubTable
;
332 exec
->ColorTable
= _mesa_ColorTable
;
333 exec
->ColorTableParameterfv
= _mesa_ColorTableParameterfv
;
334 exec
->ColorTableParameteriv
= _mesa_ColorTableParameteriv
;
335 exec
->ConvolutionFilter1D
= _mesa_ConvolutionFilter1D
;
336 exec
->ConvolutionFilter2D
= _mesa_ConvolutionFilter2D
;
337 exec
->ConvolutionParameterf
= _mesa_ConvolutionParameterf
;
338 exec
->ConvolutionParameterfv
= _mesa_ConvolutionParameterfv
;
339 exec
->ConvolutionParameteri
= _mesa_ConvolutionParameteri
;
340 exec
->ConvolutionParameteriv
= _mesa_ConvolutionParameteriv
;
341 exec
->CopyColorSubTable
= _mesa_CopyColorSubTable
;
342 exec
->CopyColorTable
= _mesa_CopyColorTable
;
343 exec
->CopyConvolutionFilter1D
= _mesa_CopyConvolutionFilter1D
;
344 exec
->CopyConvolutionFilter2D
= _mesa_CopyConvolutionFilter2D
;
345 exec
->GetColorTable
= _mesa_GetColorTable
;
346 exec
->GetColorTableParameterfv
= _mesa_GetColorTableParameterfv
;
347 exec
->GetColorTableParameteriv
= _mesa_GetColorTableParameteriv
;
348 exec
->GetConvolutionFilter
= _mesa_GetConvolutionFilter
;
349 exec
->GetConvolutionParameterfv
= _mesa_GetConvolutionParameterfv
;
350 exec
->GetConvolutionParameteriv
= _mesa_GetConvolutionParameteriv
;
351 exec
->GetHistogram
= _mesa_GetHistogram
;
352 exec
->GetHistogramParameterfv
= _mesa_GetHistogramParameterfv
;
353 exec
->GetHistogramParameteriv
= _mesa_GetHistogramParameteriv
;
354 exec
->GetMinmax
= _mesa_GetMinmax
;
355 exec
->GetMinmaxParameterfv
= _mesa_GetMinmaxParameterfv
;
356 exec
->GetMinmaxParameteriv
= _mesa_GetMinmaxParameteriv
;
357 exec
->GetSeparableFilter
= _mesa_GetSeparableFilter
;
358 exec
->Histogram
= _mesa_Histogram
;
359 exec
->Minmax
= _mesa_Minmax
;
360 exec
->ResetHistogram
= _mesa_ResetHistogram
;
361 exec
->ResetMinmax
= _mesa_ResetMinmax
;
362 exec
->SeparableFilter2D
= _mesa_SeparableFilter2D
;
364 /* 2. GL_EXT_blend_color */
366 exec
->BlendColorEXT
= _mesa_BlendColorEXT
;
369 /* 3. GL_EXT_polygon_offset */
370 exec
->PolygonOffsetEXT
= _mesa_PolygonOffsetEXT
;
372 /* 6. GL_EXT_texture3d */
374 exec
->CopyTexSubImage3DEXT
= _mesa_CopyTexSubImage3D
;
375 exec
->TexImage3DEXT
= _mesa_TexImage3DEXT
;
376 exec
->TexSubImage3DEXT
= _mesa_TexSubImage3D
;
379 /* 11. GL_EXT_histogram */
380 exec
->GetHistogramEXT
= _mesa_GetHistogram
;
381 exec
->GetHistogramParameterfvEXT
= _mesa_GetHistogramParameterfv
;
382 exec
->GetHistogramParameterivEXT
= _mesa_GetHistogramParameteriv
;
383 exec
->GetMinmaxEXT
= _mesa_GetMinmax
;
384 exec
->GetMinmaxParameterfvEXT
= _mesa_GetMinmaxParameterfv
;
385 exec
->GetMinmaxParameterivEXT
= _mesa_GetMinmaxParameteriv
;
387 /* ?. GL_SGIX_pixel_texture */
388 exec
->PixelTexGenSGIX
= _mesa_PixelTexGenSGIX
;
390 /* 15. GL_SGIS_pixel_texture */
391 exec
->PixelTexGenParameteriSGIS
= _mesa_PixelTexGenParameteriSGIS
;
392 exec
->PixelTexGenParameterivSGIS
= _mesa_PixelTexGenParameterivSGIS
;
393 exec
->PixelTexGenParameterfSGIS
= _mesa_PixelTexGenParameterfSGIS
;
394 exec
->PixelTexGenParameterfvSGIS
= _mesa_PixelTexGenParameterfvSGIS
;
395 exec
->GetPixelTexGenParameterivSGIS
= _mesa_GetPixelTexGenParameterivSGIS
;
396 exec
->GetPixelTexGenParameterfvSGIS
= _mesa_GetPixelTexGenParameterfvSGIS
;
398 /* 30. GL_EXT_vertex_array */
399 exec
->ColorPointerEXT
= _mesa_ColorPointerEXT
;
400 exec
->EdgeFlagPointerEXT
= _mesa_EdgeFlagPointerEXT
;
401 exec
->IndexPointerEXT
= _mesa_IndexPointerEXT
;
402 exec
->NormalPointerEXT
= _mesa_NormalPointerEXT
;
403 exec
->TexCoordPointerEXT
= _mesa_TexCoordPointerEXT
;
404 exec
->VertexPointerEXT
= _mesa_VertexPointerEXT
;
406 /* 37. GL_EXT_blend_minmax */
408 exec
->BlendEquationEXT
= _mesa_BlendEquationEXT
;
411 /* 54. GL_EXT_point_parameters */
412 exec
->PointParameterfEXT
= _mesa_PointParameterfEXT
;
413 exec
->PointParameterfvEXT
= _mesa_PointParameterfvEXT
;
415 /* 78. GL_EXT_paletted_texture */
417 exec
->ColorTableEXT
= _mesa_ColorTableEXT
;
418 exec
->ColorSubTableEXT
= _mesa_ColorSubTableEXT
;
420 exec
->GetColorTableEXT
= _mesa_GetColorTable
;
421 exec
->GetColorTableParameterfvEXT
= _mesa_GetColorTableParameterfv
;
422 exec
->GetColorTableParameterivEXT
= _mesa_GetColorTableParameteriv
;
424 /* 97. GL_EXT_compiled_vertex_array */
425 exec
->LockArraysEXT
= _mesa_LockArraysEXT
;
426 exec
->UnlockArraysEXT
= _mesa_UnlockArraysEXT
;
428 /* 173. GL_INGR_blend_func_separate */
429 exec
->BlendFuncSeparateEXT
= _mesa_BlendFuncSeparateEXT
;
431 /* 196. GL_MESA_resize_buffers */
432 exec
->ResizeBuffersMESA
= _mesa_ResizeBuffersMESA
;
434 /* 197. GL_MESA_window_pos */
435 exec
->WindowPos2dMESA
= _mesa_WindowPos2dMESA
;
436 exec
->WindowPos2dvMESA
= _mesa_WindowPos2dvMESA
;
437 exec
->WindowPos2fMESA
= _mesa_WindowPos2fMESA
;
438 exec
->WindowPos2fvMESA
= _mesa_WindowPos2fvMESA
;
439 exec
->WindowPos2iMESA
= _mesa_WindowPos2iMESA
;
440 exec
->WindowPos2ivMESA
= _mesa_WindowPos2ivMESA
;
441 exec
->WindowPos2sMESA
= _mesa_WindowPos2sMESA
;
442 exec
->WindowPos2svMESA
= _mesa_WindowPos2svMESA
;
443 exec
->WindowPos3dMESA
= _mesa_WindowPos3dMESA
;
444 exec
->WindowPos3dvMESA
= _mesa_WindowPos3dvMESA
;
445 exec
->WindowPos3fMESA
= _mesa_WindowPos3fMESA
;
446 exec
->WindowPos3fvMESA
= _mesa_WindowPos3fvMESA
;
447 exec
->WindowPos3iMESA
= _mesa_WindowPos3iMESA
;
448 exec
->WindowPos3ivMESA
= _mesa_WindowPos3ivMESA
;
449 exec
->WindowPos3sMESA
= _mesa_WindowPos3sMESA
;
450 exec
->WindowPos3svMESA
= _mesa_WindowPos3svMESA
;
451 exec
->WindowPos4dMESA
= _mesa_WindowPos4dMESA
;
452 exec
->WindowPos4dvMESA
= _mesa_WindowPos4dvMESA
;
453 exec
->WindowPos4fMESA
= _mesa_WindowPos4fMESA
;
454 exec
->WindowPos4fvMESA
= _mesa_WindowPos4fvMESA
;
455 exec
->WindowPos4iMESA
= _mesa_WindowPos4iMESA
;
456 exec
->WindowPos4ivMESA
= _mesa_WindowPos4ivMESA
;
457 exec
->WindowPos4sMESA
= _mesa_WindowPos4sMESA
;
458 exec
->WindowPos4svMESA
= _mesa_WindowPos4svMESA
;
460 /* 233. GL_NV_vertex_program */
461 exec
->BindProgramNV
= _mesa_BindProgramNV
;
462 exec
->DeleteProgramsNV
= _mesa_DeleteProgramsNV
;
463 exec
->ExecuteProgramNV
= _mesa_ExecuteProgramNV
;
464 exec
->GenProgramsNV
= _mesa_GenProgramsNV
;
465 exec
->AreProgramsResidentNV
= _mesa_AreProgramsResidentNV
;
466 exec
->RequestResidentProgramsNV
= _mesa_RequestResidentProgramsNV
;
467 exec
->GetProgramParameterfvNV
= _mesa_GetProgramParameterfvNV
;
468 exec
->GetProgramParameterdvNV
= _mesa_GetProgramParameterdvNV
;
469 exec
->GetProgramivNV
= _mesa_GetProgramivNV
;
470 exec
->GetProgramStringNV
= _mesa_GetProgramStringNV
;
471 exec
->GetTrackMatrixivNV
= _mesa_GetTrackMatrixivNV
;
472 exec
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
473 exec
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
474 exec
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
475 exec
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
476 exec
->IsProgramNV
= _mesa_IsProgramNV
;
477 exec
->LoadProgramNV
= _mesa_LoadProgramNV
;
478 exec
->ProgramParameter4dNV
= _mesa_ProgramParameter4dNV
;
479 exec
->ProgramParameter4dvNV
= _mesa_ProgramParameter4dvNV
;
480 exec
->ProgramParameter4fNV
= _mesa_ProgramParameter4fNV
;
481 exec
->ProgramParameter4fvNV
= _mesa_ProgramParameter4fvNV
;
482 exec
->ProgramParameters4dvNV
= _mesa_ProgramParameters4dvNV
;
483 exec
->ProgramParameters4fvNV
= _mesa_ProgramParameters4fvNV
;
484 exec
->TrackMatrixNV
= _mesa_TrackMatrixNV
;
485 exec
->VertexAttribPointerNV
= _mesa_VertexAttribPointerNV
;
487 /* 262. GL_NV_point_sprite */
488 exec
->PointParameteriNV
= _mesa_PointParameteriNV
;
489 exec
->PointParameterivNV
= _mesa_PointParameterivNV
;
491 /* ARB 1. GL_ARB_multitexture */
492 exec
->ActiveTextureARB
= _mesa_ActiveTextureARB
;
493 exec
->ClientActiveTextureARB
= _mesa_ClientActiveTextureARB
;
495 /* ARB 3. GL_ARB_transpose_matrix */
496 exec
->LoadTransposeMatrixdARB
= _mesa_LoadTransposeMatrixdARB
;
497 exec
->LoadTransposeMatrixfARB
= _mesa_LoadTransposeMatrixfARB
;
498 exec
->MultTransposeMatrixdARB
= _mesa_MultTransposeMatrixdARB
;
499 exec
->MultTransposeMatrixfARB
= _mesa_MultTransposeMatrixfARB
;
501 /* ARB 5. GL_ARB_multisample */
502 exec
->SampleCoverageARB
= _mesa_SampleCoverageARB
;
504 /* ARB 12. GL_ARB_texture_compression */
505 exec
->CompressedTexImage3DARB
= _mesa_CompressedTexImage3DARB
;
506 exec
->CompressedTexImage2DARB
= _mesa_CompressedTexImage2DARB
;
507 exec
->CompressedTexImage1DARB
= _mesa_CompressedTexImage1DARB
;
508 exec
->CompressedTexSubImage3DARB
= _mesa_CompressedTexSubImage3DARB
;
509 exec
->CompressedTexSubImage2DARB
= _mesa_CompressedTexSubImage2DARB
;
510 exec
->CompressedTexSubImage1DARB
= _mesa_CompressedTexSubImage1DARB
;
511 exec
->GetCompressedTexImageARB
= _mesa_GetCompressedTexImageARB
;
513 /* ARB 14. GL_ARB_point_parameters */
514 /* reuse EXT_point_parameters functions */
520 /**********************************************************************/
521 /***** State update logic *****/
522 /**********************************************************************/
526 update_polygon( GLcontext
*ctx
)
528 ctx
->_TriangleCaps
&= ~(DD_TRI_CULL_FRONT_BACK
| DD_TRI_OFFSET
);
530 if (ctx
->Polygon
.CullFlag
&& ctx
->Polygon
.CullFaceMode
== GL_FRONT_AND_BACK
)
531 ctx
->_TriangleCaps
|= DD_TRI_CULL_FRONT_BACK
;
533 /* Any Polygon offsets enabled? */
534 ctx
->Polygon
._OffsetAny
= GL_FALSE
;
535 ctx
->_TriangleCaps
&= ~DD_TRI_OFFSET
;
537 if (ctx
->Polygon
.OffsetPoint
||
538 ctx
->Polygon
.OffsetLine
||
539 ctx
->Polygon
.OffsetFill
) {
540 ctx
->_TriangleCaps
|= DD_TRI_OFFSET
;
541 ctx
->Polygon
._OffsetAny
= GL_TRUE
;
546 calculate_model_project_matrix( GLcontext
*ctx
)
548 _math_matrix_mul_matrix( &ctx
->_ModelProjectMatrix
,
549 ctx
->ProjectionMatrixStack
.Top
,
550 ctx
->ModelviewMatrixStack
.Top
);
552 _math_matrix_analyse( &ctx
->_ModelProjectMatrix
);
556 update_modelview_scale( GLcontext
*ctx
)
558 ctx
->_ModelViewInvScale
= 1.0F
;
559 if (ctx
->ModelviewMatrixStack
.Top
->flags
& (MAT_FLAG_UNIFORM_SCALE
|
560 MAT_FLAG_GENERAL_SCALE
|
561 MAT_FLAG_GENERAL_3D
|
562 MAT_FLAG_GENERAL
) ) {
563 const GLfloat
*m
= ctx
->ModelviewMatrixStack
.Top
->inv
;
564 GLfloat f
= m
[2] * m
[2] + m
[6] * m
[6] + m
[10] * m
[10];
565 if (f
< 1e-12) f
= 1.0;
566 if (ctx
->_NeedEyeCoords
)
567 ctx
->_ModelViewInvScale
= (GLfloat
) (1.0/GL_SQRT(f
));
569 ctx
->_ModelViewInvScale
= (GLfloat
) GL_SQRT(f
);
574 /* Bring uptodate any state that relies on _NeedEyeCoords.
577 update_tnl_spaces( GLcontext
*ctx
, GLuint oldneedeyecoords
)
579 /* Check if the truth-value interpretations of the bitfields have
582 if ((oldneedeyecoords
== 0) != (ctx
->_NeedEyeCoords
== 0)) {
583 /* Recalculate all state that depends on _NeedEyeCoords.
585 update_modelview_scale(ctx
);
586 _mesa_compute_light_positions( ctx
);
588 if (ctx
->Driver
.LightingSpaceChange
)
589 ctx
->Driver
.LightingSpaceChange( ctx
);
592 GLuint new_state
= ctx
->NewState
;
594 /* Recalculate that same state only if it has been invalidated
595 * by other statechanges.
597 if (new_state
& _NEW_MODELVIEW
)
598 update_modelview_scale(ctx
);
600 if (new_state
& (_NEW_LIGHT
|_NEW_MODELVIEW
))
601 _mesa_compute_light_positions( ctx
);
607 update_drawbuffer( GLcontext
*ctx
)
609 ctx
->DrawBuffer
->_Xmin
= 0;
610 ctx
->DrawBuffer
->_Ymin
= 0;
611 ctx
->DrawBuffer
->_Xmax
= ctx
->DrawBuffer
->Width
;
612 ctx
->DrawBuffer
->_Ymax
= ctx
->DrawBuffer
->Height
;
613 if (ctx
->Scissor
.Enabled
) {
614 if (ctx
->Scissor
.X
> ctx
->DrawBuffer
->_Xmin
) {
615 ctx
->DrawBuffer
->_Xmin
= ctx
->Scissor
.X
;
617 if (ctx
->Scissor
.Y
> ctx
->DrawBuffer
->_Ymin
) {
618 ctx
->DrawBuffer
->_Ymin
= ctx
->Scissor
.Y
;
620 if (ctx
->Scissor
.X
+ ctx
->Scissor
.Width
< ctx
->DrawBuffer
->_Xmax
) {
621 ctx
->DrawBuffer
->_Xmax
= ctx
->Scissor
.X
+ ctx
->Scissor
.Width
;
623 if (ctx
->Scissor
.Y
+ ctx
->Scissor
.Height
< ctx
->DrawBuffer
->_Ymax
) {
624 ctx
->DrawBuffer
->_Ymax
= ctx
->Scissor
.Y
+ ctx
->Scissor
.Height
;
630 /* NOTE: This routine references Tranform attribute values to compute
631 * userclip positions in clip space, but is only called on
632 * _NEW_PROJECTION. The _mesa_ClipPlane() function keeps these values
633 * uptodate across changes to the Transform attributes.
636 update_projection( GLcontext
*ctx
)
638 _math_matrix_analyse( ctx
->ProjectionMatrixStack
.Top
);
640 /* Recompute clip plane positions in clipspace. This is also done
641 * in _mesa_ClipPlane().
643 if (ctx
->Transform
.ClipPlanesEnabled
) {
645 for (p
= 0; p
< ctx
->Const
.MaxClipPlanes
; p
++) {
646 if (ctx
->Transform
.ClipPlanesEnabled
& (1 << p
)) {
647 _mesa_transform_vector( ctx
->Transform
._ClipUserPlane
[p
],
648 ctx
->Transform
.EyeUserPlane
[p
],
649 ctx
->ProjectionMatrixStack
.Top
->inv
);
657 * Return a bitmask of IMAGE_*_BIT flags which to indicate which
658 * pixel transfer operations are enabled.
661 update_image_transfer_state(GLcontext
*ctx
)
665 if (ctx
->Pixel
.RedScale
!= 1.0F
|| ctx
->Pixel
.RedBias
!= 0.0F
||
666 ctx
->Pixel
.GreenScale
!= 1.0F
|| ctx
->Pixel
.GreenBias
!= 0.0F
||
667 ctx
->Pixel
.BlueScale
!= 1.0F
|| ctx
->Pixel
.BlueBias
!= 0.0F
||
668 ctx
->Pixel
.AlphaScale
!= 1.0F
|| ctx
->Pixel
.AlphaBias
!= 0.0F
)
669 mask
|= IMAGE_SCALE_BIAS_BIT
;
671 if (ctx
->Pixel
.IndexShift
|| ctx
->Pixel
.IndexOffset
)
672 mask
|= IMAGE_SHIFT_OFFSET_BIT
;
674 if (ctx
->Pixel
.MapColorFlag
)
675 mask
|= IMAGE_MAP_COLOR_BIT
;
677 if (ctx
->Pixel
.ColorTableEnabled
)
678 mask
|= IMAGE_COLOR_TABLE_BIT
;
680 if (ctx
->Pixel
.Convolution1DEnabled
||
681 ctx
->Pixel
.Convolution2DEnabled
||
682 ctx
->Pixel
.Separable2DEnabled
) {
683 mask
|= IMAGE_CONVOLUTION_BIT
;
684 if (ctx
->Pixel
.PostConvolutionScale
[0] != 1.0F
||
685 ctx
->Pixel
.PostConvolutionScale
[1] != 1.0F
||
686 ctx
->Pixel
.PostConvolutionScale
[2] != 1.0F
||
687 ctx
->Pixel
.PostConvolutionScale
[3] != 1.0F
||
688 ctx
->Pixel
.PostConvolutionBias
[0] != 0.0F
||
689 ctx
->Pixel
.PostConvolutionBias
[1] != 0.0F
||
690 ctx
->Pixel
.PostConvolutionBias
[2] != 0.0F
||
691 ctx
->Pixel
.PostConvolutionBias
[3] != 0.0F
) {
692 mask
|= IMAGE_POST_CONVOLUTION_SCALE_BIAS
;
696 if (ctx
->Pixel
.PostConvolutionColorTableEnabled
)
697 mask
|= IMAGE_POST_CONVOLUTION_COLOR_TABLE_BIT
;
699 if (ctx
->ColorMatrixStack
.Top
->type
!= MATRIX_IDENTITY
||
700 ctx
->Pixel
.PostColorMatrixScale
[0] != 1.0F
||
701 ctx
->Pixel
.PostColorMatrixBias
[0] != 0.0F
||
702 ctx
->Pixel
.PostColorMatrixScale
[1] != 1.0F
||
703 ctx
->Pixel
.PostColorMatrixBias
[1] != 0.0F
||
704 ctx
->Pixel
.PostColorMatrixScale
[2] != 1.0F
||
705 ctx
->Pixel
.PostColorMatrixBias
[2] != 0.0F
||
706 ctx
->Pixel
.PostColorMatrixScale
[3] != 1.0F
||
707 ctx
->Pixel
.PostColorMatrixBias
[3] != 0.0F
)
708 mask
|= IMAGE_COLOR_MATRIX_BIT
;
710 if (ctx
->Pixel
.PostColorMatrixColorTableEnabled
)
711 mask
|= IMAGE_POST_COLOR_MATRIX_COLOR_TABLE_BIT
;
713 if (ctx
->Pixel
.HistogramEnabled
)
714 mask
|= IMAGE_HISTOGRAM_BIT
;
716 if (ctx
->Pixel
.MinMaxEnabled
)
717 mask
|= IMAGE_MIN_MAX_BIT
;
719 ctx
->_ImageTransferState
= mask
;
725 /* Note: This routine refers to derived texture attribute values to
726 * compute the ENABLE_TEXMAT flags, but is only called on
727 * _NEW_TEXTURE_MATRIX. On changes to _NEW_TEXTURE, the ENABLE_TEXMAT
728 * flags are updated by _mesa_update_textures(), below.
730 * If both TEXTURE and TEXTURE_MATRIX change at once, these values
731 * will be computed twice.
734 update_texture_matrices( GLcontext
*ctx
)
738 ctx
->Texture
._TexMatEnabled
= 0;
740 for (i
=0; i
< ctx
->Const
.MaxTextureUnits
; i
++) {
741 if (ctx
->TextureMatrixStack
[i
].Top
->flags
& MAT_DIRTY
) {
742 _math_matrix_analyse( ctx
->TextureMatrixStack
[i
].Top
);
744 if (ctx
->Texture
.Unit
[i
]._ReallyEnabled
&&
745 ctx
->TextureMatrixStack
[i
].Top
->type
!= MATRIX_IDENTITY
)
746 ctx
->Texture
._TexMatEnabled
|= ENABLE_TEXMAT(i
);
748 if (ctx
->Driver
.TextureMatrix
)
749 ctx
->Driver
.TextureMatrix( ctx
, i
, ctx
->TextureMatrixStack
[i
].Top
);
755 /* Note: This routine refers to derived texture matrix values to
756 * compute the ENABLE_TEXMAT flags, but is only called on
757 * _NEW_TEXTURE. On changes to _NEW_TEXTURE_MATRIX, the ENABLE_TEXMAT
758 * flags are updated by _mesa_update_texture_matrices, above.
760 * If both TEXTURE and TEXTURE_MATRIX change at once, these values
761 * will be computed twice.
764 update_texture_state( GLcontext
*ctx
)
768 ctx
->Texture
._ReallyEnabled
= 0;
769 ctx
->Texture
._GenFlags
= 0;
770 ctx
->_NeedNormals
&= ~NEED_NORMALS_TEXGEN
;
771 ctx
->_NeedEyeCoords
&= ~NEED_EYE_TEXGEN
;
772 ctx
->Texture
._TexMatEnabled
= 0;
773 ctx
->Texture
._TexGenEnabled
= 0;
775 /* Update texture unit state.
777 for (i
=0; i
< ctx
->Const
.MaxTextureUnits
; i
++) {
778 struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[i
];
780 texUnit
->_ReallyEnabled
= 0;
781 texUnit
->_GenFlags
= 0;
783 if (!texUnit
->Enabled
)
786 /* Find the texture of highest dimensionality that is enabled
787 * and complete. We'll use it for texturing.
789 if (texUnit
->Enabled
& TEXTURE0_CUBE
) {
790 struct gl_texture_object
*texObj
= texUnit
->CurrentCubeMap
;
791 if (!texObj
->Complete
) {
792 _mesa_test_texobj_completeness(ctx
, texObj
);
794 if (texObj
->Complete
) {
795 texUnit
->_ReallyEnabled
= TEXTURE0_CUBE
;
796 texUnit
->_Current
= texObj
;
800 if (!texUnit
->_ReallyEnabled
&& (texUnit
->Enabled
& TEXTURE0_3D
)) {
801 struct gl_texture_object
*texObj
= texUnit
->Current3D
;
802 if (!texObj
->Complete
) {
803 _mesa_test_texobj_completeness(ctx
, texObj
);
805 if (texObj
->Complete
) {
806 texUnit
->_ReallyEnabled
= TEXTURE0_3D
;
807 texUnit
->_Current
= texObj
;
811 if (!texUnit
->_ReallyEnabled
&& (texUnit
->Enabled
& TEXTURE0_2D
)) {
812 struct gl_texture_object
*texObj
= texUnit
->Current2D
;
813 if (!texObj
->Complete
) {
814 _mesa_test_texobj_completeness(ctx
, texObj
);
816 if (texObj
->Complete
) {
817 texUnit
->_ReallyEnabled
= TEXTURE0_2D
;
818 texUnit
->_Current
= texObj
;
822 if (!texUnit
->_ReallyEnabled
&& (texUnit
->Enabled
& TEXTURE0_1D
)) {
823 struct gl_texture_object
*texObj
= texUnit
->Current1D
;
824 if (!texObj
->Complete
) {
825 _mesa_test_texobj_completeness(ctx
, texObj
);
827 if (texObj
->Complete
) {
828 texUnit
->_ReallyEnabled
= TEXTURE0_1D
;
829 texUnit
->_Current
= texObj
;
833 if (!texUnit
->_ReallyEnabled
) {
834 texUnit
->_Current
= NULL
;
839 GLuint flag
= texUnit
->_ReallyEnabled
<< (i
* 4);
840 ctx
->Texture
._ReallyEnabled
|= flag
;
843 if (texUnit
->TexGenEnabled
) {
844 if (texUnit
->TexGenEnabled
& S_BIT
) {
845 texUnit
->_GenFlags
|= texUnit
->_GenBitS
;
847 if (texUnit
->TexGenEnabled
& T_BIT
) {
848 texUnit
->_GenFlags
|= texUnit
->_GenBitT
;
850 if (texUnit
->TexGenEnabled
& Q_BIT
) {
851 texUnit
->_GenFlags
|= texUnit
->_GenBitQ
;
853 if (texUnit
->TexGenEnabled
& R_BIT
) {
854 texUnit
->_GenFlags
|= texUnit
->_GenBitR
;
857 ctx
->Texture
._TexGenEnabled
|= ENABLE_TEXGEN(i
);
858 ctx
->Texture
._GenFlags
|= texUnit
->_GenFlags
;
861 if (ctx
->TextureMatrixStack
[i
].Top
->type
!= MATRIX_IDENTITY
)
862 ctx
->Texture
._TexMatEnabled
|= ENABLE_TEXMAT(i
);
865 if (ctx
->Texture
._GenFlags
& TEXGEN_NEED_NORMALS
) {
866 ctx
->_NeedNormals
|= NEED_NORMALS_TEXGEN
;
867 ctx
->_NeedEyeCoords
|= NEED_EYE_TEXGEN
;
870 if (ctx
->Texture
._GenFlags
& TEXGEN_NEED_EYE_COORD
) {
871 ctx
->_NeedEyeCoords
|= NEED_EYE_TEXGEN
;
878 * If ctx->NewState is non-zero then this function MUST be called before
879 * rendering any primitive. Basically, function pointers and miscellaneous
880 * flags are updated to reflect the current state of the state machine.
882 * The above constraint is now maintained largely by the two Exec
883 * dispatch tables, which trigger the appropriate flush on transition
884 * between State and Geometry modes.
886 * Special care is taken with the derived value _NeedEyeCoords. This
887 * is a bitflag which is updated with information from a number of
888 * attribute groups (MODELVIEW, LIGHT, TEXTURE). A lot of derived
889 * state references this value, and must be treated with care to
890 * ensure that updates are done correctly. All state dependent on
891 * _NeedEyeCoords is calculated from within _mesa_update_tnl_spaces(),
892 * and from nowhere else.
894 void _mesa_update_state( GLcontext
*ctx
)
896 const GLuint new_state
= ctx
->NewState
;
897 const GLuint oldneedeyecoords
= ctx
->_NeedEyeCoords
;
899 if (MESA_VERBOSE
& VERBOSE_STATE
)
900 _mesa_print_state("_mesa_update_state", new_state
);
902 if (new_state
& _NEW_MODELVIEW
)
903 _math_matrix_analyse( ctx
->ModelviewMatrixStack
.Top
);
905 if (new_state
& _NEW_PROJECTION
)
906 update_projection( ctx
);
908 if (new_state
& _NEW_TEXTURE_MATRIX
)
909 update_texture_matrices( ctx
);
911 if (new_state
& _NEW_COLOR_MATRIX
)
912 _math_matrix_analyse( ctx
->ColorMatrixStack
.Top
);
914 /* References ColorMatrix.type (derived above).
916 if (new_state
& _IMAGE_NEW_TRANSFER_STATE
)
917 update_image_transfer_state(ctx
);
919 /* Contributes to NeedEyeCoords, NeedNormals.
921 if (new_state
& _NEW_TEXTURE
)
922 update_texture_state( ctx
);
924 if (new_state
& (_NEW_BUFFERS
|_NEW_SCISSOR
))
925 update_drawbuffer( ctx
);
927 if (new_state
& _NEW_POLYGON
)
928 update_polygon( ctx
);
930 /* Contributes to NeedEyeCoords, NeedNormals.
932 if (new_state
& _NEW_LIGHT
)
933 _mesa_update_lighting( ctx
);
935 /* We can light in object space if the modelview matrix preserves
936 * lengths and relative angles.
938 if (new_state
& (_NEW_MODELVIEW
|_NEW_LIGHT
)) {
939 ctx
->_NeedEyeCoords
&= ~NEED_EYE_LIGHT_MODELVIEW
;
940 if (ctx
->Light
.Enabled
&&
941 !TEST_MAT_FLAGS( ctx
->ModelviewMatrixStack
.Top
, MAT_FLAGS_LENGTH_PRESERVING
))
942 ctx
->_NeedEyeCoords
|= NEED_EYE_LIGHT_MODELVIEW
;
947 /* XXX this is a bit of a hack. We should be checking elsewhere if
948 * vertex program mode is enabled. We set _NeedEyeCoords to zero to
949 * ensure that the combined modelview/projection matrix is computed
950 * in calculate_model_project_matrix().
952 if (ctx
->VertexProgram
.Enabled
)
953 ctx
->_NeedEyeCoords
= 0;
954 /* KW: it's now always computed.
958 /* Keep ModelviewProject uptodate always to allow tnl
959 * implementations that go model->clip even when eye is required.
961 if (new_state
& (_NEW_MODELVIEW
|_NEW_PROJECTION
))
962 calculate_model_project_matrix(ctx
);
964 /* ctx->_NeedEyeCoords is now uptodate.
966 * If the truth value of this variable has changed, update for the
967 * new lighting space and recompute the positions of lights and the
970 * If the lighting space hasn't changed, may still need to recompute
971 * light positions & normal transforms for other reasons.
973 if (new_state
& (_NEW_MODELVIEW
|
975 _MESA_NEW_NEED_EYE_COORDS
))
976 update_tnl_spaces( ctx
, oldneedeyecoords
);
979 * Here the driver sets up all the ctx->Driver function pointers
980 * to it's specific, private functions, and performs any
981 * internal state management necessary, including invalidating
982 * state of active modules.
984 * Set ctx->NewState to zero to avoid recursion if
985 * Driver.UpdateState() has to call FLUSH_VERTICES(). (fixed?)
988 ctx
->Driver
.UpdateState(ctx
, new_state
);
989 ctx
->Array
.NewState
= 0;
991 /* At this point we can do some assertions to be sure the required
992 * device driver function pointers are all initialized.
994 ASSERT(ctx
->Driver
.GetString
);
995 ASSERT(ctx
->Driver
.UpdateState
);
996 ASSERT(ctx
->Driver
.Clear
);
997 ASSERT(ctx
->Driver
.SetDrawBuffer
);
998 ASSERT(ctx
->Driver
.GetBufferSize
);
999 if (ctx
->Visual
.accumRedBits
> 0) {
1000 ASSERT(ctx
->Driver
.Accum
);
1002 ASSERT(ctx
->Driver
.DrawPixels
);
1003 ASSERT(ctx
->Driver
.ReadPixels
);
1004 ASSERT(ctx
->Driver
.CopyPixels
);
1005 ASSERT(ctx
->Driver
.Bitmap
);
1006 ASSERT(ctx
->Driver
.ResizeBuffers
);
1007 ASSERT(ctx
->Driver
.TexImage1D
);
1008 ASSERT(ctx
->Driver
.TexImage2D
);
1009 ASSERT(ctx
->Driver
.TexImage3D
);
1010 ASSERT(ctx
->Driver
.TexSubImage1D
);
1011 ASSERT(ctx
->Driver
.TexSubImage2D
);
1012 ASSERT(ctx
->Driver
.TexSubImage3D
);
1013 ASSERT(ctx
->Driver
.CopyTexImage1D
);
1014 ASSERT(ctx
->Driver
.CopyTexImage2D
);
1015 ASSERT(ctx
->Driver
.CopyTexSubImage1D
);
1016 ASSERT(ctx
->Driver
.CopyTexSubImage2D
);
1017 ASSERT(ctx
->Driver
.CopyTexSubImage3D
);
1018 if (ctx
->Extensions
.ARB_texture_compression
) {
1019 ASSERT(ctx
->Driver
.BaseCompressedTexFormat
);
1020 ASSERT(ctx
->Driver
.CompressedTextureSize
);
1021 ASSERT(ctx
->Driver
.GetCompressedTexImage
);
1022 #if 0 /* HW drivers need these, but not SW rasterizers */
1023 ASSERT(ctx
->Driver
.CompressedTexImage1D
);
1024 ASSERT(ctx
->Driver
.CompressedTexImage2D
);
1025 ASSERT(ctx
->Driver
.CompressedTexImage3D
);
1026 ASSERT(ctx
->Driver
.CompressedTexSubImage1D
);
1027 ASSERT(ctx
->Driver
.CompressedTexSubImage2D
);
1028 ASSERT(ctx
->Driver
.CompressedTexSubImage3D
);
1036 _mesa_allow_light_in_model( GLcontext
*ctx
, GLboolean flag
)
1039 ctx
->_NeedEyeCoords
&= ~NEED_EYE_DRIVER
;
1041 ctx
->_NeedEyeCoords
|= NEED_EYE_DRIVER
;
1043 ctx
->NewState
|= _NEW_POINT
; /* one of the bits from
1044 * _MESA_NEW_NEED_EYE_COORDS.