summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-11-15 04:01:29 +0000
committerBrian Paul <[email protected]>2005-11-15 04:01:29 +0000
commit1e134cf7e402a9c16064b19a0c72ed17cb2fc189 (patch)
treeda5cbe1f9f848360b22b673007cf7ff3c85938f8
parent5ef524cd01822dfaf645f3baa659f36b384e809e (diff)
Fix problem in stencil_and_ztest_span() when using h/w stencil buffer.
Fix a comment typo. Remove some unneeded #includes.
-rw-r--r--src/mesa/swrast/s_stencil.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index 2c484d5393c..09dd4ef8837 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -25,9 +25,7 @@
#include "glheader.h"
#include "context.h"
-#include "macros.h"
#include "imports.h"
-#include "fbobject.h"
#include "s_context.h"
#include "s_depth.h"
@@ -441,6 +439,10 @@ stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face)
if (do_stencil_test( ctx, face, n, stencil, mask ) == GL_FALSE) {
/* all fragments failed the stencil test, we're done. */
span->writeAll = GL_FALSE;
+ if (!rb->GetPointer(ctx, rb, 0, 0)) {
+ /* put updated stencil values into buffer */
+ rb->PutRow(ctx, rb, n, x, y, stencil, NULL);
+ }
return GL_FALSE;
}
@@ -498,7 +500,7 @@ stencil_and_ztest_span(GLcontext *ctx, struct sw_span *span, GLuint face)
* Write updated stencil values back into hardware stencil buffer.
*/
if (!rb->GetPointer(ctx, rb, 0, 0)) {
- rb->PutRow(ctx, rb, n, x, y, stencil, mask);
+ rb->PutRow(ctx, rb, n, x, y, stencil, NULL);
}
span->writeAll = GL_FALSE;
@@ -1191,7 +1193,7 @@ _swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
/* no bit masking */
if (width == rb->Width && rb->DataType == GL_UNSIGNED_BYTE) {
/* optimized case */
- /* XXX bottom-to-op raster assumed! */
+ /* Note: bottom-to-top raster assumed! */
GLubyte *stencil = rb->GetPointer(ctx, rb, x, y);
GLuint len = width * height * sizeof(GLubyte);
_mesa_memset(stencil, clearVal, len);