Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.7 KiB

  1. /*
  2. ** Copyright 1991,1992,1993, Silicon Graphics, Inc.
  3. ** All Rights Reserved.
  4. **
  5. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6. ** the contents of this file may not be disclosed to third parties, copied or
  7. ** duplicated in any form, in whole or in part, without the prior written
  8. ** permission of Silicon Graphics, Inc.
  9. **
  10. ** RESTRICTED RIGHTS LEGEND:
  11. ** Use, duplication or disclosure by the Government is subject to restrictions
  12. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15. ** rights reserved under the Copyright Laws of the United States.
  16. */
  17. #include "precomp.h"
  18. #pragma hdrstop
  19. #ifdef __GL_USEASMCODE
  20. static void (*SDepthTestPixel[16])(void) = {
  21. NULL,
  22. __glDTS_LESS,
  23. __glDTS_EQUAL,
  24. __glDTS_LEQUAL,
  25. __glDTS_GREATER,
  26. __glDTS_NOTEQUAL,
  27. __glDTS_GEQUAL,
  28. __glDTS_ALWAYS,
  29. NULL,
  30. __glDTS_LESS_M,
  31. __glDTS_EQUAL_M,
  32. __glDTS_LEQUAL_M,
  33. __glDTS_GREATER_M,
  34. __glDTS_NOTEQUAL_M,
  35. __glDTS_GEQUAL_M,
  36. __glDTS_ALWAYS_M,
  37. };
  38. #endif
  39. typedef void (FASTCALL *StoreProc)(__GLcolorBuffer *cfb, const __GLfragment *frag);
  40. static StoreProc storeProcs[8] = {
  41. &__glDoStore,
  42. &__glDoStore_A,
  43. &__glDoStore_S,
  44. &__glDoStore_AS,
  45. &__glDoStore_D,
  46. &__glDoStore_AD,
  47. &__glDoStore_SD,
  48. &__glDoStore_ASD,
  49. };
  50. void FASTCALL __glGenPickStoreProcs(__GLcontext *gc)
  51. {
  52. GLint ix = 0;
  53. GLuint enables = gc->state.enables.general;
  54. if ((enables & __GL_ALPHA_TEST_ENABLE) && gc->modes.rgbMode) {
  55. ix |= 1;
  56. }
  57. if (enables & __GL_STENCIL_TEST_ENABLE) {
  58. ix |= 2;
  59. }
  60. if (enables & __GL_DEPTH_TEST_ENABLE) {
  61. ix |= 4;
  62. }
  63. switch (gc->state.raster.drawBuffer) {
  64. case GL_NONE:
  65. gc->procs.store = storeProcs[ix];
  66. gc->procs.cfbStore = __glDoNullStore;
  67. break;
  68. case GL_FRONT_AND_BACK:
  69. if (gc->buffers.doubleStore) {
  70. gc->procs.store = storeProcs[ix];
  71. gc->procs.cfbStore = __glDoDoubleStore;
  72. break;
  73. }
  74. /*
  75. ** Note that there is an intentional drop through here. If double
  76. ** store is not set, then storing to this buffer is no different
  77. ** that storing to the front buffer.
  78. */
  79. case GL_FRONT:
  80. case GL_BACK:
  81. case GL_AUX0:
  82. case GL_AUX1:
  83. case GL_AUX2:
  84. case GL_AUX3:
  85. /*
  86. ** This code knows that gc->drawBuffer will point to the
  87. ** current buffer as chosen by glDrawBuffer
  88. */
  89. gc->procs.store = storeProcs[ix];
  90. gc->procs.cfbStore = gc->drawBuffer->store;
  91. break;
  92. }
  93. }