/* Recompute the scissor state. */
context_dirty(ctx, SCISSOR);
+ context_dirty(ctx, CONTROL);
}
void
nv04_emit_control(struct gl_context *ctx, int emit)
{
struct nv04_context *nv04 = to_nv04_context(ctx);
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
int cull = ctx->Polygon.CullFaceMode;
int front = ctx->Polygon.FrontFace;
NV04_TEXTURED_TRIANGLE_CONTROL_CULL_MODE_CCW;
/* Depth test. */
- if (ctx->Depth.Test)
+ if (ctx->Depth.Test && fb->Visual.depthBits > 0)
nv04->ctrl[0] |= NV04_TEXTURED_TRIANGLE_CONTROL_Z_ENABLE;
- if (ctx->Depth.Mask)
+ if (ctx->Depth.Mask && fb->Visual.depthBits > 0)
nv04->ctrl[0] |= NV04_TEXTURED_TRIANGLE_CONTROL_Z_WRITE;
nv04->ctrl[0] |= get_comparison_op(ctx->Depth.Func) << 16;
context_dirty(ctx, VIEWPORT);
context_dirty(ctx, SCISSOR);
+ context_dirty(ctx, DEPTH);
}
void
nv10_emit_depth(struct gl_context *ctx, int emit)
{
struct nouveau_pushbuf *push = context_push(ctx);
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
BEGIN_NV04(push, NV10_3D(DEPTH_TEST_ENABLE), 1);
- PUSH_DATAb(push, ctx->Depth.Test);
+ PUSH_DATAb(push, ctx->Depth.Test && fb->Visual.depthBits > 0);
BEGIN_NV04(push, NV10_3D(DEPTH_WRITE_ENABLE), 1);
- PUSH_DATAb(push, ctx->Depth.Mask);
+ PUSH_DATAb(push, ctx->Depth.Mask && fb->Visual.depthBits > 0);
BEGIN_NV04(push, NV10_3D(DEPTH_FUNC), 1);
PUSH_DATA (push, nvgl_comparison_op(ctx->Depth.Func));
}
/* Recompute the viewport/scissor state. */
context_dirty(ctx, VIEWPORT);
context_dirty(ctx, SCISSOR);
+ context_dirty(ctx, DEPTH);
}
void