summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_atom_depth.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-03-02 11:27:32 -0700
committerBrian Paul <brianp@vmware.com>2009-03-02 11:51:46 -0700
commitf1a083d4b8c86e0ba335ab162f60b6f2b8391c31 (patch)
treecd2c992899bb7da6e48c82ab42053b235a74edcb /src/mesa/state_tracker/st_atom_depth.c
parent8fec37c0f11e624644da48d612c60e736861a212 (diff)
gallium: only enable depth test if a depth bufffer is available
Diffstat (limited to 'src/mesa/state_tracker/st_atom_depth.c')
-rw-r--r--src/mesa/state_tracker/st_atom_depth.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c
index 4ea62dda18..0aa128f947 100644
--- a/src/mesa/state_tracker/st_atom_depth.c
+++ b/src/mesa/state_tracker/st_atom_depth.c
@@ -98,9 +98,11 @@ update_depth_stencil_alpha(struct st_context *st)
memset(dsa, 0, sizeof(*dsa));
- dsa->depth.enabled = ctx->Depth.Test;
- dsa->depth.writemask = ctx->Depth.Mask;
- dsa->depth.func = st_compare_func_to_pipe(ctx->Depth.Func);
+ if (ctx->Depth.Test && ctx->DrawBuffer->Visual.depthBits > 0) {
+ dsa->depth.enabled = 1;
+ dsa->depth.writemask = ctx->Depth.Mask;
+ dsa->depth.func = st_compare_func_to_pipe(ctx->Depth.Func);
+ }
if (ctx->Query.CurrentOcclusionObject &&
ctx->Query.CurrentOcclusionObject->Active)