summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-12-10 11:44:43 -0700
committerBrian Paul <[email protected]>2011-12-13 06:45:37 -0700
commit6e1228976b6ff91492b2fc338282e21404870d26 (patch)
tree55d978e60b46ea1b615eab6224e0e5b3e2f9ee54 /src/mesa
parent2ac02ea29fad959d1011513bf7e90da875ba675b (diff)
mesa: move depth/stencil buffer validation to swrast
Since gl_framebuffer::_DepthBuffer and _StencilBuffer are only used by swrast, do the validation of those fields in swrast too. The main/depthstencil.[ch] code is no longer used and will be removed next. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/framebuffer.c3
-rw-r--r--src/mesa/swrast/s_context.c23
2 files changed, 23 insertions, 3 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 0185622009a..4a4ade0961e 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -34,7 +34,6 @@
#include "imports.h"
#include "buffers.h"
#include "context.h"
-#include "depthstencil.h"
#include "enums.h"
#include "formats.h"
#include "macros.h"
@@ -738,8 +737,6 @@ update_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
*/
update_color_draw_buffers(ctx, fb);
update_color_read_buffer(ctx, fb);
- _mesa_update_depth_buffer(ctx, fb);
- _mesa_update_stencil_buffer(ctx, fb);
compute_depth_max(fb);
}
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 924612578e2..6850a09f364 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -36,6 +36,7 @@
#include "swrast.h"
#include "s_blend.h"
#include "s_context.h"
+#include "s_depthstencil.h"
#include "s_lines.h"
#include "s_points.h"
#include "s_span.h"
@@ -545,6 +546,25 @@ _swrast_update_active_attribs(struct gl_context *ctx)
}
+/**
+ * Update the depth/stencil renderbuffers, if needed.
+ */
+static void
+_swrast_update_depth_stencil(struct gl_context *ctx)
+{
+ struct gl_framebuffer *drawFb = ctx->DrawBuffer;
+ struct gl_framebuffer *readFb = ctx->ReadBuffer;
+
+ _swrast_update_depth_buffer(ctx, drawFb);
+ _swrast_update_stencil_buffer(ctx, drawFb);
+
+ if (readFb != drawFb) {
+ _swrast_update_depth_buffer(ctx, readFb);
+ _swrast_update_stencil_buffer(ctx, readFb);
+ }
+}
+
+
void
_swrast_validate_derived( struct gl_context *ctx )
{
@@ -589,6 +609,9 @@ _swrast_validate_derived( struct gl_context *ctx )
_NEW_TEXTURE))
_swrast_update_specular_vertex_add(ctx);
+ if (swrast->NewState & _NEW_BUFFERS)
+ _swrast_update_depth_stencil(ctx);
+
swrast->NewState = 0;
swrast->StateChanges = 0;
swrast->InvalidateState = _swrast_invalidate_state;