aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2013-04-20 09:43:54 +0100
committerJosé Fonseca <[email protected]>2013-04-20 23:25:36 +0100
commitc08b04992ad5251cde651fab5cabb90d3528cc92 (patch)
tree64ec17fc631d7f0abbfd941f027920ab059d73e2 /src
parentf701a5a0feac9e5cbc1205142e4ef27d65326343 (diff)
llvmpipe: Ignore depth-stencil state if format has no depth/stencil.
Prevents assertion failures inside the driver for such state combinations. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_fs.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 87128858c46..1a9a194c8be 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -2478,12 +2478,18 @@ make_variant_key(struct llvmpipe_context *lp,
memset(key, 0, shader->variant_key_size);
if (lp->framebuffer.zsbuf) {
- if (lp->depth_stencil->depth.enabled) {
- key->zsbuf_format = lp->framebuffer.zsbuf->format;
+ enum pipe_format zsbuf_format = lp->framebuffer.zsbuf->format;
+ const struct util_format_description *zsbuf_desc =
+ util_format_description(zsbuf_format);
+
+ if (lp->depth_stencil->depth.enabled &&
+ util_format_has_depth(zsbuf_desc)) {
+ key->zsbuf_format = zsbuf_format;
memcpy(&key->depth, &lp->depth_stencil->depth, sizeof key->depth);
}
- if (lp->depth_stencil->stencil[0].enabled) {
- key->zsbuf_format = lp->framebuffer.zsbuf->format;
+ if (lp->depth_stencil->stencil[0].enabled &&
+ util_format_has_stencil(zsbuf_desc)) {
+ key->zsbuf_format = zsbuf_format;
memcpy(&key->stencil, &lp->depth_stencil->stencil, sizeof key->stencil);
}
}