llvmpipe: Fix crashes when there is no depth buffer bound.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 18 Mar 2010 10:24:10 +0000 (10:24 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 18 Mar 2010 10:24:10 +0000 (10:24 +0000)
src/gallium/drivers/llvmpipe/lp_state_fs.c

index b38e0f393dc89a4080cc1f146e2ec5c7e66191e5..2cecf7e097415658815360b27c1aeff09e93be34 100644 (file)
@@ -152,6 +152,9 @@ generate_depth_stencil(LLVMBuilderRef builder,
    const struct util_format_description *format_desc;
    struct lp_type dst_type;
 
+   if (!key->depth.enabled && !key->stencil[0].enabled && !key->stencil[1].enabled)
+      return;
+
    format_desc = util_format_description(key->zsbuf_format);
    assert(format_desc);