mesa/st: use has_stencil_export instead of querying screen cap.

We already query at context setup, just use that value.

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14286>
This commit is contained in:
Dave Airlie 2021-12-22 17:05:09 +10:00 committed by Marge Bot
parent 37190ad932
commit be277ace89
1 changed files with 3 additions and 3 deletions

View File

@ -1318,7 +1318,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y,
write_depth = GL_TRUE;
if (write_stencil &&
!st->screen->get_param(st->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) {
!st->has_stencil_export) {
/* software fallback */
draw_stencil_pixels(ctx, x, y, width, height, format, type,
unpack, pixels);
@ -1704,7 +1704,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
/* fallback if the driver can't do stencil exports */
if (type == GL_DEPTH_STENCIL &&
!st->screen->get_param(st->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) {
!st->has_stencil_export) {
st_CopyPixels(ctx, srcx, srcy, width, height, dstx, dsty, GL_STENCIL);
st_CopyPixels(ctx, srcx, srcy, width, height, dstx, dsty, GL_DEPTH);
return;
@ -1712,7 +1712,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
/* fallback if the driver can't do stencil exports */
if (type == GL_STENCIL &&
!st->screen->get_param(st->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) {
!st->has_stencil_export) {
copy_stencil_pixels(ctx, srcx, srcy, width, height, dstx, dsty);
return;
}