wgl: Fix depth/stencil image support when using zink kopper

Kopper requires that any depth/stencil images are created through winsys which
was not taken into account by the WGL frontend causing it to hit an assert:
'Assertion failed: ctx->fb_state.zsbuf->texture->bind & PIPE_BIND_DISPLAY_TARGET'

fixes #9256
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24055>
This commit is contained in:
Billy Laws
2023-06-29 22:59:29 +01:00
committed by Marge Bot
parent 544c0b572e
commit d3662ba461
2 changed files with 13 additions and 1 deletions
+7 -1
View File
@@ -204,7 +204,8 @@ stw_pixelformat_add(struct stw_device *stw_dev,
/*
* since gallium frontend can allocate depth/stencil/accum buffers, we provide
* only color buffers here
* only color buffers here in the non-zink case, however in the zink case
* kopper requires that we allocate depth/stencil through the winsys
*/
pfi->stvis.buffer_mask = ST_ATTACHMENT_FRONT_LEFT_MASK;
if (doublebuffer)
@@ -213,6 +214,11 @@ stw_pixelformat_add(struct stw_device *stw_dev,
pfi->stvis.color_format = color->format;
pfi->stvis.depth_stencil_format = depth->format;
#ifdef GALLIUM_ZINK
if (stw_dev->zink && (depth->bits.depth > 0 || depth->bits.stencil > 0))
pfi->stvis.buffer_mask |= ST_ATTACHMENT_DEPTH_STENCIL_MASK;
#endif
pfi->stvis.accum_format = (accum) ?
PIPE_FORMAT_R16G16B16A16_SNORM : PIPE_FORMAT_NONE;
+6
View File
@@ -227,6 +227,12 @@ stw_st_framebuffer_validate_locked(struct st_context *st,
case ST_ATTACHMENT_DEPTH_STENCIL:
format = stwfb->stvis.depth_stencil_format;
bind = PIPE_BIND_DEPTH_STENCIL;
#ifdef GALLIUM_ZINK
if (stw_dev->zink)
bind |= PIPE_BIND_DISPLAY_TARGET;
#endif
break;
default:
format = PIPE_FORMAT_NONE;