+
+void
+nv10_emit_zclear(struct gl_context *ctx, int emit)
+{
+ struct nouveau_context *nctx = to_nouveau_context(ctx);
+ struct nouveau_channel *chan = context_chan(ctx);
+ struct nouveau_grobj *celsius = context_eng3d(ctx);
+ struct nouveau_framebuffer *nfb =
+ to_nouveau_framebuffer(ctx->DrawBuffer);
+
+ if (nfb->hierz.bo) {
+ BEGIN_RING(chan, celsius, NV17TCL_ZCLEAR_ENABLE, 2);
+ OUT_RING(chan, nctx->hierz.clear_blocked ? 0 : 1);
+ OUT_RING(chan, nfb->hierz.clear_value |
+ (nctx->hierz.clear_seq & 0xff));
+ } else {
+ BEGIN_RING(chan, celsius, NV10TCL_DEPTH_RANGE_NEAR, 2);
+ OUT_RINGf(chan, nv10_transform_depth(ctx, 0));
+ OUT_RINGf(chan, nv10_transform_depth(ctx, 1));
+ context_dirty(ctx, VIEWPORT);
+ }
+}