• Home
  • Raw
  • Download

Lines Matching refs:ctx

55 cull_face(struct gl_context *ctx, GLenum mode, bool no_error)  in cull_face()  argument
57 if (ctx->Polygon.CullFaceMode == mode) in cull_face()
62 _mesa_error(ctx, GL_INVALID_ENUM, "glCullFace"); in cull_face()
66 FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON, in cull_face()
68 ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState; in cull_face()
69 ctx->Polygon.CullFaceMode = mode; in cull_face()
71 if (ctx->Driver.CullFace) in cull_face()
72 ctx->Driver.CullFace(ctx, mode); in cull_face()
79 GET_CURRENT_CONTEXT(ctx); in _mesa_CullFace_no_error()
80 cull_face(ctx, mode, true); in _mesa_CullFace_no_error()
87 GET_CURRENT_CONTEXT(ctx); in _mesa_CullFace()
90 _mesa_debug(ctx, "glCullFace %s\n", _mesa_enum_to_string(mode)); in _mesa_CullFace()
92 cull_face(ctx, mode, false); in _mesa_CullFace()
108 front_face(struct gl_context *ctx, GLenum mode, bool no_error) in front_face() argument
110 if (ctx->Polygon.FrontFace == mode) in front_face()
114 _mesa_error(ctx, GL_INVALID_ENUM, "glFrontFace"); in front_face()
118 FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON, in front_face()
120 ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState; in front_face()
121 ctx->Polygon.FrontFace = mode; in front_face()
123 if (ctx->Driver.FrontFace) in front_face()
124 ctx->Driver.FrontFace(ctx, mode); in front_face()
131 GET_CURRENT_CONTEXT(ctx); in _mesa_FrontFace_no_error()
132 front_face(ctx, mode, true); in _mesa_FrontFace_no_error()
139 GET_CURRENT_CONTEXT(ctx); in _mesa_FrontFace()
142 _mesa_debug(ctx, "glFrontFace %s\n", _mesa_enum_to_string(mode)); in _mesa_FrontFace()
144 front_face(ctx, mode, false); in _mesa_FrontFace()
161 polygon_mode(struct gl_context *ctx, GLenum face, GLenum mode, bool no_error) in polygon_mode() argument
164 ctx->Polygon.FrontMode == GL_FILL_RECTANGLE_NV || in polygon_mode()
165 ctx->Polygon.BackMode == GL_FILL_RECTANGLE_NV; in polygon_mode()
168 _mesa_debug(ctx, "glPolygonMode %s %s\n", in polygon_mode()
179 if (ctx->Extensions.NV_fill_rectangle) in polygon_mode()
183 _mesa_error(ctx, GL_INVALID_ENUM, "glPolygonMode(mode)"); in polygon_mode()
190 if (!no_error && ctx->API == API_OPENGL_CORE) { in polygon_mode()
191 _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" ); in polygon_mode()
194 if (ctx->Polygon.FrontMode == mode) in polygon_mode()
196 FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON, in polygon_mode()
198 ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState; in polygon_mode()
199 ctx->Polygon.FrontMode = mode; in polygon_mode()
202 if (ctx->Polygon.FrontMode == mode && ctx->Polygon.BackMode == mode) in polygon_mode()
204 FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON, in polygon_mode()
206 ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState; in polygon_mode()
207 ctx->Polygon.FrontMode = mode; in polygon_mode()
208 ctx->Polygon.BackMode = mode; in polygon_mode()
211 if (!no_error && ctx->API == API_OPENGL_CORE) { in polygon_mode()
212 _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" ); in polygon_mode()
215 if (ctx->Polygon.BackMode == mode) in polygon_mode()
217 FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON, in polygon_mode()
219 ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState; in polygon_mode()
220 ctx->Polygon.BackMode = mode; in polygon_mode()
224 _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" ); in polygon_mode()
228 if (ctx->Driver.PolygonMode) in polygon_mode()
229 ctx->Driver.PolygonMode(ctx, face, mode); in polygon_mode()
231 if (ctx->Extensions.INTEL_conservative_rasterization || in polygon_mode()
233 _mesa_update_valid_to_render_state(ctx); in polygon_mode()
240 GET_CURRENT_CONTEXT(ctx); in _mesa_PolygonMode_no_error()
241 polygon_mode(ctx, face, mode, true); in _mesa_PolygonMode_no_error()
248 GET_CURRENT_CONTEXT(ctx); in _mesa_PolygonMode()
249 polygon_mode(ctx, face, mode, false); in _mesa_PolygonMode()
259 GET_CURRENT_CONTEXT(ctx); in _mesa_PolygonStipple()
262 _mesa_debug(ctx, "glPolygonStipple\n"); in _mesa_PolygonStipple()
264 FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonStipple ? 0 : in _mesa_PolygonStipple()
267 ctx->NewDriverState |= ctx->DriverFlags.NewPolygonStipple; in _mesa_PolygonStipple()
269 pattern = _mesa_map_validate_pbo_source(ctx, 2, in _mesa_PolygonStipple()
270 &ctx->Unpack, 32, 32, 1, in _mesa_PolygonStipple()
277 _mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack); in _mesa_PolygonStipple()
279 _mesa_unmap_pbo_source(ctx, &ctx->Unpack); in _mesa_PolygonStipple()
281 if (ctx->Driver.PolygonStipple) in _mesa_PolygonStipple()
282 ctx->Driver.PolygonStipple(ctx, pattern); in _mesa_PolygonStipple()
292 GET_CURRENT_CONTEXT(ctx); in _mesa_GetnPolygonStippleARB()
295 _mesa_debug(ctx, "glGetPolygonStipple\n"); in _mesa_GetnPolygonStippleARB()
297 dest = _mesa_map_validate_pbo_dest(ctx, 2, in _mesa_GetnPolygonStippleARB()
298 &ctx->Pack, 32, 32, 1, in _mesa_GetnPolygonStippleARB()
304 _mesa_pack_polygon_stipple(ctx->PolygonStipple, dest, &ctx->Pack); in _mesa_GetnPolygonStippleARB()
306 _mesa_unmap_pbo_dest(ctx, &ctx->Pack); in _mesa_GetnPolygonStippleARB()
317 _mesa_polygon_offset_clamp(struct gl_context *ctx, in _mesa_polygon_offset_clamp() argument
320 if (ctx->Polygon.OffsetFactor == factor && in _mesa_polygon_offset_clamp()
321 ctx->Polygon.OffsetUnits == units && in _mesa_polygon_offset_clamp()
322 ctx->Polygon.OffsetClamp == clamp) in _mesa_polygon_offset_clamp()
325 FLUSH_VERTICES(ctx, ctx->DriverFlags.NewPolygonState ? 0 : _NEW_POLYGON, in _mesa_polygon_offset_clamp()
327 ctx->NewDriverState |= ctx->DriverFlags.NewPolygonState; in _mesa_polygon_offset_clamp()
328 ctx->Polygon.OffsetFactor = factor; in _mesa_polygon_offset_clamp()
329 ctx->Polygon.OffsetUnits = units; in _mesa_polygon_offset_clamp()
330 ctx->Polygon.OffsetClamp = clamp; in _mesa_polygon_offset_clamp()
332 if (ctx->Driver.PolygonOffset) in _mesa_polygon_offset_clamp()
333 ctx->Driver.PolygonOffset( ctx, factor, units, clamp ); in _mesa_polygon_offset_clamp()
339 GET_CURRENT_CONTEXT(ctx); in _mesa_PolygonOffset()
342 _mesa_debug(ctx, "glPolygonOffset %f %f\n", factor, units); in _mesa_PolygonOffset()
344 _mesa_polygon_offset_clamp(ctx, factor, units, 0.0); in _mesa_PolygonOffset()
350 GET_CURRENT_CONTEXT(ctx); in _mesa_PolygonOffsetClampEXT()
352 if (!ctx->Extensions.ARB_polygon_offset_clamp) { in _mesa_PolygonOffsetClampEXT()
353 _mesa_error(ctx, GL_INVALID_OPERATION, in _mesa_PolygonOffsetClampEXT()
359 _mesa_debug(ctx, "glPolygonOffsetClamp %f %f %f\n", factor, units, clamp); in _mesa_PolygonOffsetClampEXT()
361 _mesa_polygon_offset_clamp(ctx, factor, units, clamp); in _mesa_PolygonOffsetClampEXT()
376 void _mesa_init_polygon( struct gl_context * ctx ) in _mesa_init_polygon() argument
379 ctx->Polygon.CullFlag = GL_FALSE; in _mesa_init_polygon()
380 ctx->Polygon.CullFaceMode = GL_BACK; in _mesa_init_polygon()
381 ctx->Polygon.FrontFace = GL_CCW; in _mesa_init_polygon()
382 ctx->Polygon.FrontMode = GL_FILL; in _mesa_init_polygon()
383 ctx->Polygon.BackMode = GL_FILL; in _mesa_init_polygon()
384 ctx->Polygon.SmoothFlag = GL_FALSE; in _mesa_init_polygon()
385 ctx->Polygon.StippleFlag = GL_FALSE; in _mesa_init_polygon()
386 ctx->Polygon.OffsetFactor = 0.0F; in _mesa_init_polygon()
387 ctx->Polygon.OffsetUnits = 0.0F; in _mesa_init_polygon()
388 ctx->Polygon.OffsetClamp = 0.0F; in _mesa_init_polygon()
389 ctx->Polygon.OffsetPoint = GL_FALSE; in _mesa_init_polygon()
390 ctx->Polygon.OffsetLine = GL_FALSE; in _mesa_init_polygon()
391 ctx->Polygon.OffsetFill = GL_FALSE; in _mesa_init_polygon()
395 memset( ctx->PolygonStipple, 0xff, 32*sizeof(GLuint) ); in _mesa_init_polygon()