~ubuntu-branches/ubuntu/precise/mesa/precise-updates

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/i965/gen6_depthstencil.c

  • Committer: Package Import Robot
  • Author(s): Robert Hooker
  • Date: 2012-02-02 12:05:48 UTC
  • mfrom: (1.7.1) (3.3.27 sid)
  • Revision ID: package-import@ubuntu.com-20120202120548-nvkma85jq0h4coix
Tags: 8.0~rc2-0ubuntu4
Drop drisearchdir handling, it is no longer needed with multiarch
and dri-alternates being removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 *
26
26
 */
27
27
 
 
28
#include "intel_fbo.h"
28
29
#include "brw_context.h"
29
30
#include "brw_state.h"
30
31
 
31
32
static void
32
 
gen6_prepare_depth_stencil_state(struct brw_context *brw)
 
33
gen6_upload_depth_stencil_state(struct brw_context *brw)
33
34
{
34
35
   struct gl_context *ctx = &brw->intel.ctx;
35
36
   struct gen6_depth_stencil_state *ds;
36
 
 
37
 
   ds = brw_state_batch(brw, sizeof(*ds), 64,
 
37
   struct intel_renderbuffer *depth_irb;
 
38
 
 
39
   /* _NEW_BUFFERS */
 
40
   depth_irb = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_DEPTH);
 
41
 
 
42
   ds = brw_state_batch(brw, AUB_TRACE_DEPTH_STENCIL_STATE,
 
43
                        sizeof(*ds), 64,
38
44
                        &brw->cc.depth_stencil_state_offset);
39
45
   memset(ds, 0, sizeof(*ds));
40
46
 
76
82
   }
77
83
 
78
84
   /* _NEW_DEPTH */
79
 
   if (ctx->Depth.Test) {
80
 
      ds->ds2.depth_test_enable = 1;
 
85
   if ((ctx->Depth.Test || brw->hiz.op) && depth_irb) {
 
86
      assert(brw->hiz.op != BRW_HIZ_OP_DEPTH_RESOLVE || ctx->Depth.Test);
 
87
      assert(brw->hiz.op != BRW_HIZ_OP_HIZ_RESOLVE   || !ctx->Depth.Test);
 
88
      assert(brw->hiz.op != BRW_HIZ_OP_DEPTH_CLEAR   || !ctx->Depth.Test);
 
89
 
 
90
      ds->ds2.depth_test_enable = ctx->Depth.Test;
81
91
      ds->ds2.depth_test_func = intel_translate_compare_func(ctx->Depth.Func);
82
92
      ds->ds2.depth_write_enable = ctx->Depth.Mask;
83
93
   }
87
97
 
88
98
const struct brw_tracked_state gen6_depth_stencil_state = {
89
99
   .dirty = {
90
 
      .mesa = _NEW_DEPTH | _NEW_STENCIL,
91
 
      .brw = BRW_NEW_BATCH,
 
100
      .mesa = _NEW_DEPTH | _NEW_STENCIL | _NEW_BUFFERS,
 
101
      .brw  = (BRW_NEW_BATCH |
 
102
               BRW_NEW_HIZ),
92
103
      .cache = 0,
93
104
   },
94
 
   .prepare = gen6_prepare_depth_stencil_state,
 
105
   .emit = gen6_upload_depth_stencil_state,
95
106
};