mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
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 <brianp@vmware.com>
This commit is contained in:
parent
f701a5a0fe
commit
c08b04992a
1 changed files with 10 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue