summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/softpipe/sp_quad_stencil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_quad_stencil.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_stencil.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/mesa/pipe/softpipe/sp_quad_stencil.c b/src/mesa/pipe/softpipe/sp_quad_stencil.c
index 857f1a5989..47b3b4f089 100644
--- a/src/mesa/pipe/softpipe/sp_quad_stencil.c
+++ b/src/mesa/pipe/softpipe/sp_quad_stencil.c
@@ -4,13 +4,12 @@
*/
-#include "main/glheader.h"
-#include "main/imports.h"
#include "sp_context.h"
#include "sp_headers.h"
#include "sp_surface.h"
#include "sp_quad.h"
#include "pipe/p_defines.h"
+#include "pipe/p_util.h"
/** Only 8-bit stencil supported */
@@ -28,12 +27,12 @@
* values and ref value are to be used.
* \return mask indicating which pixels passed the stencil test
*/
-static GLbitfield
-do_stencil_test(const GLubyte stencilVals[QUAD_SIZE], GLuint func,
- GLbitfield ref, GLbitfield valMask)
+static unsigned
+do_stencil_test(const ubyte stencilVals[QUAD_SIZE], unsigned func,
+ unsigned ref, unsigned valMask)
{
- GLbitfield passMask = 0x0;
- GLuint j;
+ unsigned passMask = 0x0;
+ unsigned j;
ref &= valMask;
@@ -105,11 +104,11 @@ do_stencil_test(const GLubyte stencilVals[QUAD_SIZE], GLuint func,
* stencil values
*/
static void
-apply_stencil_op(GLubyte stencilVals[QUAD_SIZE],
- GLbitfield mask, GLuint op, GLubyte ref, GLubyte wrtMask)
+apply_stencil_op(ubyte stencilVals[QUAD_SIZE],
+ unsigned mask, unsigned op, ubyte ref, ubyte wrtMask)
{
- GLuint j;
- GLubyte newstencil[QUAD_SIZE];
+ unsigned j;
+ ubyte newstencil[QUAD_SIZE];
for (j = 0; j < QUAD_SIZE; j++) {
newstencil[j] = stencilVals[j];
@@ -202,9 +201,9 @@ stencil_test_quad(struct quad_stage *qs, struct quad_header *quad)
{
struct softpipe_context *softpipe = qs->softpipe;
struct softpipe_surface *s_surf = softpipe_surface(softpipe->framebuffer.sbuf);
- GLuint func, zFailOp, zPassOp, failOp;
- GLubyte ref, wrtMask, valMask;
- GLubyte stencilVals[QUAD_SIZE];
+ unsigned func, zFailOp, zPassOp, failOp;
+ ubyte ref, wrtMask, valMask;
+ ubyte stencilVals[QUAD_SIZE];
/* choose front or back face function, operator, etc */
/* XXX we could do these initializations once per primitive */
@@ -232,7 +231,7 @@ stencil_test_quad(struct quad_stage *qs, struct quad_header *quad)
/* do the stencil test first */
{
- GLbitfield passMask, failMask;
+ unsigned passMask, failMask;
passMask = do_stencil_test(stencilVals, func, ref, valMask);
failMask = quad->mask & ~passMask;
quad->mask &= passMask;
@@ -246,18 +245,18 @@ stencil_test_quad(struct quad_stage *qs, struct quad_header *quad)
/* now the pixels that passed the stencil test are depth tested */
if (softpipe->depth_test.enabled) {
- const GLbitfield origMask = quad->mask;
+ const unsigned origMask = quad->mask;
sp_depth_test_quad(qs, quad); /* quad->mask is updated */
/* update stencil buffer values according to z pass/fail result */
if (zFailOp != PIPE_STENCIL_OP_KEEP) {
- const GLbitfield failMask = origMask & ~quad->mask;
+ const unsigned failMask = origMask & ~quad->mask;
apply_stencil_op(stencilVals, failMask, zFailOp, ref, wrtMask);
}
if (zPassOp != PIPE_STENCIL_OP_KEEP) {
- const GLbitfield passMask = origMask & quad->mask;
+ const unsigned passMask = origMask & quad->mask;
apply_stencil_op(stencilVals, passMask, zPassOp, ref, wrtMask);
}
}