70#define STENCIL_ADDRESS(X,Y) (ctx->Buffer->Stencil + ctx->Buffer->Width * (Y) + (X))
140 ctx->Stencil.FailFunc = fail;
153 ctx->Stencil.ZFailFunc = zfail;
166 ctx->Stencil.ZPassFunc = zpass;
216 wrtmask =
ctx->Stencil.WriteMask;
217 invmask =
~ctx->Stencil.WriteMask;
275 stencil[
i] = (invmask &
s) | (wrtmask & (
s+1));
298 stencil[
i] = (invmask &
s) | (wrtmask & (
s-1));
323 gl_problem(
ctx,
"Bad stencilop in apply_stencil_op_to_span");
359 switch (
ctx->Stencil.Function) {
374 r =
ctx->Stencil.Ref &
ctx->Stencil.ValueMask;
393 r =
ctx->Stencil.Ref &
ctx->Stencil.ValueMask;
412 r =
ctx->Stencil.Ref &
ctx->Stencil.ValueMask;
431 r =
ctx->Stencil.Ref &
ctx->Stencil.ValueMask;
450 r =
ctx->Stencil.Ref &
ctx->Stencil.ValueMask;
469 r =
ctx->Stencil.Ref &
ctx->Stencil.ValueMask;
500 return (allfail) ? 0 : 1;
533 passmask[
i] = failmask[
i] = 0;
538 if (
ctx->Driver.DepthTestSpan)
579 wrtmask =
ctx->Stencil.WriteMask;
580 invmask =
~ctx->Stencil.WriteMask;
601 *sptr = invmask & *sptr;
619 *sptr = (invmask & *sptr ) | (wrtmask &
ref);
640 *sptr = (invmask & *sptr) | (wrtmask & (*sptr+1));
662 *sptr = (invmask & *sptr) | (wrtmask & (*sptr-1));
681 *sptr = (invmask & *sptr) | (wrtmask & ~*sptr);
687 gl_problem(
ctx,
"Bad stencilop in apply_stencil_op_to_pixels");
721 switch (
ctx->Stencil.Function) {
736 r =
ctx->Stencil.Ref &
ctx->Stencil.ValueMask;
740 s = *sptr &
ctx->Stencil.ValueMask;
756 r =
ctx->Stencil.Ref &
ctx->Stencil.ValueMask;
760 s = *sptr &
ctx->Stencil.ValueMask;
776 r =
ctx->Stencil.Ref &
ctx->Stencil.ValueMask;
780 s = *sptr &
ctx->Stencil.ValueMask;
796 r =
ctx->Stencil.Ref &
ctx->Stencil.ValueMask;
800 s = *sptr &
ctx->Stencil.ValueMask;
816 r =
ctx->Stencil.Ref &
ctx->Stencil.ValueMask;
820 s = *sptr &
ctx->Stencil.ValueMask;
836 r =
ctx->Stencil.Ref &
ctx->Stencil.ValueMask;
840 s = *sptr &
ctx->Stencil.ValueMask;
868 return (allfail) ? 0 : 1;
901 passmask[
i] = failmask[
i] = 0;
906 if (
ctx->Driver.DepthTestPixels)
923 ctx->Stencil.ZFailFunc, failmask );
925 ctx->Stencil.ZPassFunc, passmask );
943 if (
ctx->Buffer->Stencil) {
963 if (
ctx->Buffer->Stencil) {
977 GLuint buffersize =
ctx->Buffer->Width *
ctx->Buffer->Height;
980 if (
ctx->Buffer->Stencil) {
987 if (!
ctx->Buffer->Stencil) {
1003 if (
ctx->Visual->StencilBits==0 || !
ctx->Buffer->Stencil) {
1008 if (
ctx->Scissor.Enabled) {
void gl_problem(const GLcontext *ctx, const char *s)
void gl_error(GLcontext *ctx, GLenum error, const char *s)
GLint GLint GLint GLint GLint x
#define GL_INVALID_OPERATION
GLint GLint GLint GLint GLint GLint y
GLdouble GLdouble GLdouble r
GLint GLint GLsizei width
GLint GLfloat GLint stencil
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define MEMSET(DST, VAL, N)
#define MEMCPY(DST, SRC, BYTES)
#define INSIDE_BEGIN_END(CTX)
GLint gl_stencil_span(GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte mask[])
void gl_clear_stencil_buffer(GLcontext *ctx)
void gl_depth_stencil_pixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLdepth z[], GLubyte mask[])
void gl_StencilOp(GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass)
#define STENCIL_ADDRESS(X, Y)
void gl_alloc_stencil_buffer(GLcontext *ctx)
void gl_write_stencil_span(GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte stencil[])
void gl_StencilFunc(GLcontext *ctx, GLenum func, GLint ref, GLuint mask)
void gl_read_stencil_span(GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte stencil[])
GLint gl_stencil_pixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte mask[])
void gl_StencilMask(GLcontext *ctx, GLuint mask)
void gl_ClearStencil(GLcontext *ctx, GLint s)
static void apply_stencil_op_to_span(GLcontext *ctx, GLuint n, GLint x, GLint y, GLenum oper, GLubyte mask[])
void gl_depth_stencil_span(GLcontext *ctx, GLuint n, GLint x, GLint y, const GLdepth z[], GLubyte mask[])
static void apply_stencil_op_to_pixels(GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLenum oper, GLubyte mask[])
#define CLAMP(f, min, max)