~ubuntu-branches/ubuntu/quantal/mesa/quantal

« back to all changes in this revision

Viewing changes to src/mesa/main/stencil.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-02-21 12:44:07 UTC
  • mfrom: (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20070221124407-rgcacs32mycrtadl
ImportĀ upstreamĀ versionĀ 6.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Mesa 3-D graphics library
3
 
 * Version:  6.5
 
3
 * Version:  6.5.2
4
4
 *
5
 
 * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
 
5
 * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
6
6
 *
7
7
 * Permission is hereby granted, free of charge, to any person obtaining a
8
8
 * copy of this software and associated documentation files (the "Software"),
38
38
 *
39
39
 * So either we advertise the GL_EXT_stencil_two_side extension, or OpenGL
40
40
 * 2.0, but not both.
 
41
 *
 
42
 * Also, note that GL_ATI_separate_stencil is different as well:
 
43
 * glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, ...)  vs.
 
44
 * glStencilFuncSeparate(GLenum face, GLenum func, ...).
41
45
 */
42
46
 
43
47
 
406
410
 
407
411
   FLUSH_VERTICES(ctx, _NEW_STENCIL);
408
412
 
409
 
   if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
 
413
   if (face != GL_BACK) {
410
414
      ctx->Stencil.FailFunc[0] = fail;
411
415
      ctx->Stencil.ZFailFunc[0] = zfail;
412
416
      ctx->Stencil.ZPassFunc[0] = zpass;
413
417
   }
414
 
   if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
 
418
   if (face != GL_FRONT) {
415
419
      ctx->Stencil.FailFunc[1] = fail;
416
420
      ctx->Stencil.ZFailFunc[1] = zfail;
417
421
      ctx->Stencil.ZPassFunc[1] = zpass;
418
422
   }
419
 
 
420
423
   if (ctx->Driver.StencilOpSeparate) {
421
424
      ctx->Driver.StencilOpSeparate(ctx, face, fail, zfail, zpass);
422
425
   }
465
468
      ctx->Stencil.Ref[1] = ref;
466
469
      ctx->Stencil.ValueMask[1] = mask;
467
470
   }
468
 
 
469
471
   if (ctx->Driver.StencilFuncSeparate) {
470
472
      ctx->Driver.StencilFuncSeparate(ctx, face, func, ref, mask);
471
473
   }
486
488
 
487
489
   FLUSH_VERTICES(ctx, _NEW_STENCIL);
488
490
 
489
 
   if (face == GL_FRONT || face == GL_FRONT_AND_BACK) {
 
491
   if (face != GL_BACK) {
490
492
      ctx->Stencil.WriteMask[0] = mask;
491
493
   }
492
 
   if (face == GL_BACK || face == GL_FRONT_AND_BACK) {
 
494
   if (face != GL_FRONT) {
493
495
      ctx->Stencil.WriteMask[1] = mask;
494
496
   }
495
 
 
496
497
   if (ctx->Driver.StencilMaskSeparate) {
497
498
      ctx->Driver.StencilMaskSeparate(ctx, face, mask);
498
499
   }