Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Mesa 3-D graphics library |
Brian | a99114a | 2007-05-22 16:54:25 -0600 | [diff] [blame] | 3 | * Version: 7.1 |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 4 | * |
Brian | 0bf5dbe | 2006-12-19 18:02:41 -0700 | [diff] [blame] | 5 | * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 6 | * |
| 7 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 8 | * copy of this software and associated documentation files (the "Software"), |
| 9 | * to deal in the Software without restriction, including without limitation |
| 10 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 11 | * and/or sell copies of the Software, and to permit persons to whom the |
| 12 | * Software is furnished to do so, subject to the following conditions: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice shall be included |
| 15 | * in all copies or substantial portions of the Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 20 | * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 21 | * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 23 | */ |
| 24 | |
| 25 | |
| 26 | #include "glheader.h" |
| 27 | #include "imports.h" |
root | 9944174 | 2007-09-11 15:24:43 -0600 | [diff] [blame] | 28 | #include "arrayobj.h" |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 29 | #include "buffers.h" |
| 30 | #include "context.h" |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 31 | #include "framebuffer.h" |
Dave Airlie | a638676 | 2008-05-09 13:33:06 +1000 | [diff] [blame] | 32 | #include "mipmap.h" |
Brian | b150258 | 2007-04-21 12:54:23 -0600 | [diff] [blame] | 33 | #include "queryobj.h" |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 34 | #include "renderbuffer.h" |
Brian Paul | 8f04c12 | 2004-04-27 13:39:20 +0000 | [diff] [blame] | 35 | #include "texcompress.h" |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 36 | #include "texformat.h" |
| 37 | #include "teximage.h" |
| 38 | #include "texobj.h" |
| 39 | #include "texstore.h" |
Brian Paul | 2c6f911 | 2005-02-24 05:47:06 +0000 | [diff] [blame] | 40 | #if FEATURE_ARB_vertex_buffer_object |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 41 | #include "bufferobj.h" |
Brian Paul | 2c6f911 | 2005-02-24 05:47:06 +0000 | [diff] [blame] | 42 | #endif |
| 43 | #if FEATURE_EXT_framebuffer_object |
| 44 | #include "fbobject.h" |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 45 | #include "texrender.h" |
Brian Paul | 2c6f911 | 2005-02-24 05:47:06 +0000 | [diff] [blame] | 46 | #endif |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 47 | |
root | 9944174 | 2007-09-11 15:24:43 -0600 | [diff] [blame] | 48 | #include "shader/program.h" |
| 49 | #include "shader/prog_execute.h" |
| 50 | #include "shader/shader_api.h" |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 51 | #include "driverfuncs.h" |
Brian Paul | b5ee368 | 2005-10-28 14:32:49 +0000 | [diff] [blame] | 52 | #include "tnl/tnl.h" |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 53 | #include "swrast/swrast.h" |
| 54 | |
| 55 | |
| 56 | |
| 57 | /** |
| 58 | * Plug in default functions for all pointers in the dd_function_table |
| 59 | * structure. |
| 60 | * Device drivers should call this function and then plug in any |
| 61 | * functions which it wants to override. |
| 62 | * Some functions (pointers) MUST be implemented by all drivers (REQUIRED). |
| 63 | * |
| 64 | * \param table the dd_function_table to initialize |
| 65 | */ |
| 66 | void |
| 67 | _mesa_init_driver_functions(struct dd_function_table *driver) |
| 68 | { |
| 69 | _mesa_bzero(driver, sizeof(*driver)); |
| 70 | |
| 71 | driver->GetString = NULL; /* REQUIRED! */ |
| 72 | driver->UpdateState = NULL; /* REQUIRED! */ |
| 73 | driver->GetBufferSize = NULL; /* REQUIRED! */ |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 74 | driver->ResizeBuffers = _mesa_resize_framebuffer; |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 75 | driver->Error = NULL; |
| 76 | |
| 77 | driver->Finish = NULL; |
| 78 | driver->Flush = NULL; |
| 79 | |
| 80 | /* framebuffer/image functions */ |
| 81 | driver->Clear = _swrast_Clear; |
| 82 | driver->Accum = _swrast_Accum; |
| 83 | driver->DrawPixels = _swrast_DrawPixels; |
| 84 | driver->ReadPixels = _swrast_ReadPixels; |
| 85 | driver->CopyPixels = _swrast_CopyPixels; |
| 86 | driver->Bitmap = _swrast_Bitmap; |
| 87 | |
| 88 | /* Texture functions */ |
| 89 | driver->ChooseTextureFormat = _mesa_choose_tex_format; |
| 90 | driver->TexImage1D = _mesa_store_teximage1d; |
| 91 | driver->TexImage2D = _mesa_store_teximage2d; |
| 92 | driver->TexImage3D = _mesa_store_teximage3d; |
| 93 | driver->TexSubImage1D = _mesa_store_texsubimage1d; |
| 94 | driver->TexSubImage2D = _mesa_store_texsubimage2d; |
| 95 | driver->TexSubImage3D = _mesa_store_texsubimage3d; |
Brian Paul | 68d293b | 2004-12-12 19:03:16 +0000 | [diff] [blame] | 96 | driver->GetTexImage = _mesa_get_teximage; |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 97 | driver->CopyTexImage1D = _swrast_copy_teximage1d; |
| 98 | driver->CopyTexImage2D = _swrast_copy_teximage2d; |
| 99 | driver->CopyTexSubImage1D = _swrast_copy_texsubimage1d; |
| 100 | driver->CopyTexSubImage2D = _swrast_copy_texsubimage2d; |
| 101 | driver->CopyTexSubImage3D = _swrast_copy_texsubimage3d; |
Dave Airlie | a638676 | 2008-05-09 13:33:06 +1000 | [diff] [blame] | 102 | driver->GenerateMipmap = _mesa_generate_mipmap; |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 103 | driver->TestProxyTexImage = _mesa_test_proxy_teximage; |
| 104 | driver->CompressedTexImage1D = _mesa_store_compressed_teximage1d; |
| 105 | driver->CompressedTexImage2D = _mesa_store_compressed_teximage2d; |
| 106 | driver->CompressedTexImage3D = _mesa_store_compressed_teximage3d; |
| 107 | driver->CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d; |
| 108 | driver->CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d; |
| 109 | driver->CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; |
Brian Paul | 68d293b | 2004-12-12 19:03:16 +0000 | [diff] [blame] | 110 | driver->GetCompressedTexImage = _mesa_get_compressed_teximage; |
Brian Paul | 8f04c12 | 2004-04-27 13:39:20 +0000 | [diff] [blame] | 111 | driver->CompressedTextureSize = _mesa_compressed_texture_size; |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 112 | driver->BindTexture = NULL; |
| 113 | driver->NewTextureObject = _mesa_new_texture_object; |
| 114 | driver->DeleteTexture = _mesa_delete_texture_object; |
| 115 | driver->NewTextureImage = _mesa_new_texture_image; |
Keith Whitwell | 3e62d3a | 2005-03-22 14:27:10 +0000 | [diff] [blame] | 116 | driver->FreeTexImageData = _mesa_free_texture_image_data; |
Brian | 61fbc81 | 2007-11-29 08:12:33 -0700 | [diff] [blame] | 117 | driver->MapTexture = NULL; |
| 118 | driver->UnmapTexture = NULL; |
Keith Whitwell | 17bcf9f | 2005-05-23 12:17:27 +0000 | [diff] [blame] | 119 | driver->TextureMemCpy = _mesa_memcpy; |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 120 | driver->IsTextureResident = NULL; |
| 121 | driver->PrioritizeTexture = NULL; |
| 122 | driver->ActiveTexture = NULL; |
| 123 | driver->UpdateTexturePalette = NULL; |
| 124 | |
| 125 | /* imaging */ |
| 126 | driver->CopyColorTable = _swrast_CopyColorTable; |
| 127 | driver->CopyColorSubTable = _swrast_CopyColorSubTable; |
| 128 | driver->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; |
| 129 | driver->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; |
| 130 | |
Brian Paul | 4d859f7 | 2004-01-23 18:57:05 +0000 | [diff] [blame] | 131 | /* Vertex/fragment programs */ |
| 132 | driver->BindProgram = NULL; |
| 133 | driver->NewProgram = _mesa_new_program; |
| 134 | driver->DeleteProgram = _mesa_delete_program; |
Brian Paul | 39c4daa | 2006-10-10 21:43:31 +0000 | [diff] [blame] | 135 | #if FEATURE_MESA_program_debug |
Brian | 21bcb2e | 2007-02-25 18:35:47 -0700 | [diff] [blame] | 136 | driver->GetProgramRegister = _mesa_get_program_register; |
Brian Paul | 39c4daa | 2006-10-10 21:43:31 +0000 | [diff] [blame] | 137 | #endif /* FEATURE_MESA_program_debug */ |
Brian Paul | 4d859f7 | 2004-01-23 18:57:05 +0000 | [diff] [blame] | 138 | |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 139 | /* simple state commands */ |
| 140 | driver->AlphaFunc = NULL; |
| 141 | driver->BlendColor = NULL; |
Ian Romanick | c93105e | 2004-01-27 18:52:40 +0000 | [diff] [blame] | 142 | driver->BlendEquationSeparate = NULL; |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 143 | driver->BlendFuncSeparate = NULL; |
| 144 | driver->ClearColor = NULL; |
| 145 | driver->ClearDepth = NULL; |
| 146 | driver->ClearIndex = NULL; |
| 147 | driver->ClearStencil = NULL; |
| 148 | driver->ClipPlane = NULL; |
| 149 | driver->ColorMask = NULL; |
| 150 | driver->ColorMaterial = NULL; |
| 151 | driver->CullFace = NULL; |
Brian Paul | acafeeb | 2005-09-03 16:57:58 +0000 | [diff] [blame] | 152 | driver->DrawBuffer = NULL; |
| 153 | driver->DrawBuffers = NULL; |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 154 | driver->FrontFace = NULL; |
| 155 | driver->DepthFunc = NULL; |
| 156 | driver->DepthMask = NULL; |
| 157 | driver->DepthRange = NULL; |
| 158 | driver->Enable = NULL; |
| 159 | driver->Fogfv = NULL; |
| 160 | driver->Hint = NULL; |
| 161 | driver->IndexMask = NULL; |
| 162 | driver->Lightfv = NULL; |
| 163 | driver->LightModelfv = NULL; |
| 164 | driver->LineStipple = NULL; |
| 165 | driver->LineWidth = NULL; |
| 166 | driver->LogicOpcode = NULL; |
| 167 | driver->PointParameterfv = NULL; |
| 168 | driver->PointSize = NULL; |
| 169 | driver->PolygonMode = NULL; |
| 170 | driver->PolygonOffset = NULL; |
| 171 | driver->PolygonStipple = NULL; |
| 172 | driver->ReadBuffer = NULL; |
| 173 | driver->RenderMode = NULL; |
| 174 | driver->Scissor = NULL; |
| 175 | driver->ShadeModel = NULL; |
Brian Paul | 878c371 | 2005-09-13 04:42:09 +0000 | [diff] [blame] | 176 | driver->StencilFuncSeparate = NULL; |
Brian Paul | 5179f67 | 2005-09-13 01:17:01 +0000 | [diff] [blame] | 177 | driver->StencilOpSeparate = NULL; |
Brian Paul | 878c371 | 2005-09-13 04:42:09 +0000 | [diff] [blame] | 178 | driver->StencilMaskSeparate = NULL; |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 179 | driver->TexGen = NULL; |
| 180 | driver->TexEnv = NULL; |
| 181 | driver->TexParameter = NULL; |
| 182 | driver->TextureMatrix = NULL; |
| 183 | driver->Viewport = NULL; |
| 184 | |
| 185 | /* vertex arrays */ |
| 186 | driver->VertexPointer = NULL; |
| 187 | driver->NormalPointer = NULL; |
| 188 | driver->ColorPointer = NULL; |
| 189 | driver->FogCoordPointer = NULL; |
| 190 | driver->IndexPointer = NULL; |
| 191 | driver->SecondaryColorPointer = NULL; |
| 192 | driver->TexCoordPointer = NULL; |
| 193 | driver->EdgeFlagPointer = NULL; |
| 194 | driver->VertexAttribPointer = NULL; |
| 195 | driver->LockArraysEXT = NULL; |
| 196 | driver->UnlockArraysEXT = NULL; |
| 197 | |
| 198 | /* state queries */ |
| 199 | driver->GetBooleanv = NULL; |
| 200 | driver->GetDoublev = NULL; |
| 201 | driver->GetFloatv = NULL; |
| 202 | driver->GetIntegerv = NULL; |
| 203 | driver->GetPointerv = NULL; |
| 204 | |
| 205 | #if FEATURE_ARB_vertex_buffer_object |
| 206 | driver->NewBufferObject = _mesa_new_buffer_object; |
| 207 | driver->DeleteBuffer = _mesa_delete_buffer_object; |
| 208 | driver->BindBuffer = NULL; |
| 209 | driver->BufferData = _mesa_buffer_data; |
| 210 | driver->BufferSubData = _mesa_buffer_subdata; |
| 211 | driver->GetBufferSubData = _mesa_buffer_get_subdata; |
| 212 | driver->MapBuffer = _mesa_buffer_map; |
Brian Paul | 7eab337 | 2004-10-31 15:23:42 +0000 | [diff] [blame] | 213 | driver->UnmapBuffer = _mesa_buffer_unmap; |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 214 | #endif |
| 215 | |
Brian Paul | 2c6f911 | 2005-02-24 05:47:06 +0000 | [diff] [blame] | 216 | #if FEATURE_EXT_framebuffer_object |
| 217 | driver->NewFramebuffer = _mesa_new_framebuffer; |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 218 | driver->NewRenderbuffer = _mesa_new_soft_renderbuffer; |
Brian Paul | ea4fe66 | 2006-03-26 05:22:17 +0000 | [diff] [blame] | 219 | driver->RenderTexture = _mesa_render_texture; |
| 220 | driver->FinishRenderTexture = _mesa_finish_render_texture; |
Brian Paul | e4b2356 | 2005-05-04 20:11:35 +0000 | [diff] [blame] | 221 | driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer; |
Brian Paul | 2c6f911 | 2005-02-24 05:47:06 +0000 | [diff] [blame] | 222 | #endif |
| 223 | |
Brian Paul | afa1df5 | 2006-03-02 03:45:28 +0000 | [diff] [blame] | 224 | #if FEATURE_EXT_framebuffer_blit |
| 225 | driver->BlitFramebuffer = _swrast_BlitFramebuffer; |
| 226 | #endif |
| 227 | |
Brian Paul | 23ffc3a | 2005-08-27 13:56:08 +0000 | [diff] [blame] | 228 | /* query objects */ |
Brian Paul | 4fb9950 | 2005-09-02 13:42:49 +0000 | [diff] [blame] | 229 | driver->NewQueryObject = _mesa_new_query_object; |
Brian Paul | 23ffc3a | 2005-08-27 13:56:08 +0000 | [diff] [blame] | 230 | driver->BeginQuery = NULL; |
| 231 | driver->EndQuery = NULL; |
| 232 | |
Ian Romanick | ee34e6e | 2006-06-12 16:26:29 +0000 | [diff] [blame] | 233 | /* APPLE_vertex_array_object */ |
| 234 | driver->NewArrayObject = _mesa_new_array_object; |
| 235 | driver->DeleteArrayObject = _mesa_delete_array_object; |
| 236 | driver->BindArrayObject = NULL; |
| 237 | |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 238 | /* T&L stuff */ |
| 239 | driver->NeedValidate = GL_FALSE; |
| 240 | driver->ValidateTnlModule = NULL; |
| 241 | driver->CurrentExecPrimitive = 0; |
| 242 | driver->CurrentSavePrimitive = 0; |
| 243 | driver->NeedFlush = 0; |
| 244 | driver->SaveNeedFlush = 0; |
| 245 | |
Brian Paul | b5ee368 | 2005-10-28 14:32:49 +0000 | [diff] [blame] | 246 | driver->ProgramStringNotify = _tnl_program_string; |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 247 | driver->FlushVertices = NULL; |
| 248 | driver->SaveFlushVertices = NULL; |
| 249 | driver->NotifySaveBegin = NULL; |
| 250 | driver->LightingSpaceChange = NULL; |
Brian Paul | 988a886 | 2004-01-20 02:36:44 +0000 | [diff] [blame] | 251 | |
| 252 | /* display list */ |
| 253 | driver->NewList = NULL; |
| 254 | driver->EndList = NULL; |
| 255 | driver->BeginCallList = NULL; |
| 256 | driver->EndCallList = NULL; |
Brian | 0bf5dbe | 2006-12-19 18:02:41 -0700 | [diff] [blame] | 257 | |
| 258 | |
| 259 | /* XXX temporary here */ |
| 260 | _mesa_init_glsl_driver_functions(driver); |
| 261 | } |
| 262 | |
| 263 | |
| 264 | /** |
Brian | a99114a | 2007-05-22 16:54:25 -0600 | [diff] [blame] | 265 | * Call the ctx->Driver.* state functions with current values to initialize |
| 266 | * driver state. |
| 267 | * Only the Intel drivers use this so far. |
| 268 | */ |
| 269 | void |
| 270 | _mesa_init_driver_state(GLcontext *ctx) |
| 271 | { |
| 272 | ctx->Driver.AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef); |
| 273 | |
| 274 | ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor); |
| 275 | |
| 276 | ctx->Driver.BlendEquationSeparate(ctx, |
| 277 | ctx->Color.BlendEquationRGB, |
| 278 | ctx->Color.BlendEquationA); |
| 279 | |
| 280 | ctx->Driver.BlendFuncSeparate(ctx, |
| 281 | ctx->Color.BlendSrcRGB, |
| 282 | ctx->Color.BlendDstRGB, |
| 283 | ctx->Color.BlendSrcA, ctx->Color.BlendDstA); |
| 284 | |
| 285 | ctx->Driver.ColorMask(ctx, |
| 286 | ctx->Color.ColorMask[RCOMP], |
| 287 | ctx->Color.ColorMask[GCOMP], |
| 288 | ctx->Color.ColorMask[BCOMP], |
| 289 | ctx->Color.ColorMask[ACOMP]); |
| 290 | |
| 291 | ctx->Driver.CullFace(ctx, ctx->Polygon.CullFaceMode); |
| 292 | ctx->Driver.DepthFunc(ctx, ctx->Depth.Func); |
| 293 | ctx->Driver.DepthMask(ctx, ctx->Depth.Mask); |
| 294 | |
| 295 | ctx->Driver.Enable(ctx, GL_ALPHA_TEST, ctx->Color.AlphaEnabled); |
| 296 | ctx->Driver.Enable(ctx, GL_BLEND, ctx->Color.BlendEnabled); |
| 297 | ctx->Driver.Enable(ctx, GL_COLOR_LOGIC_OP, ctx->Color.ColorLogicOpEnabled); |
| 298 | ctx->Driver.Enable(ctx, GL_COLOR_SUM, ctx->Fog.ColorSumEnabled); |
| 299 | ctx->Driver.Enable(ctx, GL_CULL_FACE, ctx->Polygon.CullFlag); |
| 300 | ctx->Driver.Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test); |
| 301 | ctx->Driver.Enable(ctx, GL_DITHER, ctx->Color.DitherFlag); |
| 302 | ctx->Driver.Enable(ctx, GL_FOG, ctx->Fog.Enabled); |
| 303 | ctx->Driver.Enable(ctx, GL_LIGHTING, ctx->Light.Enabled); |
| 304 | ctx->Driver.Enable(ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag); |
| 305 | ctx->Driver.Enable(ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag); |
| 306 | ctx->Driver.Enable(ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled); |
| 307 | ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled); |
| 308 | ctx->Driver.Enable(ctx, GL_TEXTURE_1D, GL_FALSE); |
| 309 | ctx->Driver.Enable(ctx, GL_TEXTURE_2D, GL_FALSE); |
| 310 | ctx->Driver.Enable(ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE); |
| 311 | ctx->Driver.Enable(ctx, GL_TEXTURE_3D, GL_FALSE); |
| 312 | ctx->Driver.Enable(ctx, GL_TEXTURE_CUBE_MAP, GL_FALSE); |
| 313 | |
| 314 | ctx->Driver.Fogfv(ctx, GL_FOG_COLOR, ctx->Fog.Color); |
| 315 | ctx->Driver.Fogfv(ctx, GL_FOG_MODE, 0); |
| 316 | ctx->Driver.Fogfv(ctx, GL_FOG_DENSITY, &ctx->Fog.Density); |
| 317 | ctx->Driver.Fogfv(ctx, GL_FOG_START, &ctx->Fog.Start); |
| 318 | ctx->Driver.Fogfv(ctx, GL_FOG_END, &ctx->Fog.End); |
| 319 | |
| 320 | ctx->Driver.FrontFace(ctx, ctx->Polygon.FrontFace); |
| 321 | |
| 322 | { |
| 323 | GLfloat f = (GLfloat) ctx->Light.Model.ColorControl; |
| 324 | ctx->Driver.LightModelfv(ctx, GL_LIGHT_MODEL_COLOR_CONTROL, &f); |
| 325 | } |
| 326 | |
| 327 | ctx->Driver.LineWidth(ctx, ctx->Line.Width); |
| 328 | ctx->Driver.LogicOpcode(ctx, ctx->Color.LogicOp); |
| 329 | ctx->Driver.PointSize(ctx, ctx->Point.Size); |
| 330 | ctx->Driver.PolygonStipple(ctx, (const GLubyte *) ctx->PolygonStipple); |
| 331 | ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, |
| 332 | ctx->Scissor.Width, ctx->Scissor.Height); |
| 333 | ctx->Driver.ShadeModel(ctx, ctx->Light.ShadeModel); |
| 334 | ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT, |
| 335 | ctx->Stencil.Function[0], |
| 336 | ctx->Stencil.Ref[0], |
| 337 | ctx->Stencil.ValueMask[0]); |
| 338 | ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, |
| 339 | ctx->Stencil.Function[1], |
| 340 | ctx->Stencil.Ref[1], |
| 341 | ctx->Stencil.ValueMask[1]); |
| 342 | ctx->Driver.StencilMaskSeparate(ctx, GL_FRONT, ctx->Stencil.WriteMask[0]); |
| 343 | ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, ctx->Stencil.WriteMask[1]); |
| 344 | ctx->Driver.StencilOpSeparate(ctx, GL_FRONT, |
| 345 | ctx->Stencil.FailFunc[0], |
| 346 | ctx->Stencil.ZFailFunc[0], |
| 347 | ctx->Stencil.ZPassFunc[0]); |
| 348 | ctx->Driver.StencilOpSeparate(ctx, GL_BACK, |
| 349 | ctx->Stencil.FailFunc[1], |
| 350 | ctx->Stencil.ZFailFunc[1], |
| 351 | ctx->Stencil.ZPassFunc[1]); |
| 352 | |
| 353 | |
| 354 | ctx->Driver.DrawBuffer(ctx, ctx->Color.DrawBuffer[0]); |
| 355 | } |