diff options
author | Eric Anholt <eric@anholt.net> | 2011-05-13 11:54:15 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2011-05-18 13:57:17 -0700 |
commit | a98dd64af750fb6dae54b2dc02e0c5a3711156af (patch) | |
tree | 4ecad27b14fbbb6200f3712301b6734b0826ffcb /src/mesa/drivers/dri/i965/gen7_misc_state.c | |
parent | 64f8ddaf9b89e99396862fa38af631dd08b8c0c5 (diff) | |
download | external_mesa3d-a98dd64af750fb6dae54b2dc02e0c5a3711156af.zip external_mesa3d-a98dd64af750fb6dae54b2dc02e0c5a3711156af.tar.gz external_mesa3d-a98dd64af750fb6dae54b2dc02e0c5a3711156af.tar.bz2 |
i965: Stop caching the combined depth/stencil region in brw_context.c.
This was going to get in the way of separate depth/stencil (which
wants to know about both, and whether they are the same rb), and also
wasn't a sufficient flag for the fix in the following commit.
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen7_misc_state.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_misc_state.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_misc_state.c b/src/mesa/drivers/dri/i965/gen7_misc_state.c index adcb31f..68a222e 100644 --- a/src/mesa/drivers/dri/i965/gen7_misc_state.c +++ b/src/mesa/drivers/dri/i965/gen7_misc_state.c @@ -23,6 +23,7 @@ #include "intel_batchbuffer.h" #include "intel_regions.h" +#include "intel_fbo.h" #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" @@ -30,10 +31,18 @@ unsigned int gen7_depth_format(struct brw_context *brw) { - struct intel_region *region = brw->state.depth_region; struct intel_context *intel = &brw->intel; + struct gl_context *ctx = &intel->ctx; + struct gl_framebuffer *fb = ctx->DrawBuffer; + struct intel_renderbuffer *drb = intel_get_renderbuffer(fb, BUFFER_DEPTH); + struct intel_renderbuffer *srb = intel_get_renderbuffer(fb, BUFFER_STENCIL); + struct intel_region *region = NULL; - if (region == NULL) + if (drb) + region = drb->region; + else if (srb) + region = srb->region; + else return BRW_DEPTHFORMAT_D32_FLOAT; switch (region->cpp) { @@ -52,9 +61,18 @@ gen7_depth_format(struct brw_context *brw) static void emit_depthbuffer(struct brw_context *brw) { - struct intel_region *region = brw->state.depth_region; struct intel_context *intel = &brw->intel; struct gl_context *ctx = &intel->ctx; + struct gl_framebuffer *fb = ctx->DrawBuffer; + struct intel_renderbuffer *drb = intel_get_renderbuffer(fb, BUFFER_DEPTH); + struct intel_renderbuffer *srb = intel_get_renderbuffer(fb, BUFFER_STENCIL); + struct intel_region *region = NULL; + + /* _NEW_BUFFERS */ + if (drb) + region = drb->region; + else if (srb) + region = srb->region; if (region == NULL) { BEGIN_BATCH(7); @@ -114,8 +132,8 @@ static void emit_depthbuffer(struct brw_context *brw) */ const struct brw_tracked_state gen7_depthbuffer = { .dirty = { - .mesa = 0, - .brw = BRW_NEW_DEPTH_BUFFER | BRW_NEW_BATCH, + .mesa = _NEW_BUFFERS, + .brw = BRW_NEW_BATCH, .cache = 0, }, .emit = emit_depthbuffer, |