From aa4d0836fe25693acabb54894a09d032a242f96d Mon Sep 17 00:00:00 2001 From: Erico Nunes Date: Wed, 3 Jul 2024 16:24:42 +0200 Subject: [PATCH] lima: fix surface reload flags assignment These flags are set at the end of the job based on its buffer usage and then checked by following jobs. If an application toggles stencil and depth tests alternatigly in a sequence of jobs while also relying on previous contents to render, with the current assignment the reload flags for depth or stencil may be cleared incorrectly and a depth/stencil buffer may not be properly reloaded. Cc: mesa-stable Signed-off-by: Erico Nunes Reviewed-by: Vasily Khoruzhick Part-of: --- src/gallium/drivers/lima/ci/lima-fails.txt | 6 ------ src/gallium/drivers/lima/lima_job.c | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/lima/ci/lima-fails.txt b/src/gallium/drivers/lima/ci/lima-fails.txt index d6c4edbb5ef..d02f58c8872 100644 --- a/src/gallium/drivers/lima/ci/lima-fails.txt +++ b/src/gallium/drivers/lima/ci/lima-fails.txt @@ -47,18 +47,12 @@ dEQP-GLES2.functional.texture.mipmap.cube.projected.linear_nearest,Fail wayland-dEQP-EGL.functional.create_context.no_config,Fail wayland-dEQP-EGL.functional.image.modify.renderbuffer_depth16_renderbuffer_clear_depth,Fail -wayland-dEQP-EGL.functional.render.multi_context.gles2.rgb888_window,Fail -wayland-dEQP-EGL.functional.render.multi_thread.gles2.rgb888_window,Fail wayland-dEQP-EGL.functional.wide_color.window_fp16_default_colorspace,Fail wayland-dEQP-EGL.functional.wide_color.window_8888_colorspace_srgb,Fail wayland-dEQP-EGL.functional.wide_color.window_888_colorspace_srgb,Fail x11-dEQP-EGL.functional.create_context.no_config,Fail x11-dEQP-EGL.functional.image.modify.renderbuffer_depth16_renderbuffer_clear_depth,Fail -x11-dEQP-EGL.functional.render.multi_context.gles2.rgb888_window,Fail -x11-dEQP-EGL.functional.render.multi_context.gles2.rgba8888_pbuffer,Fail -x11-dEQP-EGL.functional.render.multi_thread.gles2.rgb888_window,Fail -x11-dEQP-EGL.functional.render.multi_thread.gles2.rgba8888_pbuffer,Fail x11-dEQP-EGL.functional.wide_color.pbuffer_8888_colorspace_srgb,Fail x11-dEQP-EGL.functional.wide_color.window_8888_colorspace_srgb,Fail diff --git a/src/gallium/drivers/lima/lima_job.c b/src/gallium/drivers/lima/lima_job.c index 6400fdb2dd9..78743bc35f0 100644 --- a/src/gallium/drivers/lima/lima_job.c +++ b/src/gallium/drivers/lima/lima_job.c @@ -1004,12 +1004,12 @@ lima_do_job(struct lima_job *job) /* Set reload flags for next draw. It'll be unset if buffer is cleared */ if (job->key.cbuf && (job->resolve & PIPE_CLEAR_COLOR0)) { struct lima_surface *surf = lima_surface(job->key.cbuf); - surf->reload = PIPE_CLEAR_COLOR0; + surf->reload |= PIPE_CLEAR_COLOR0; } if (job->key.zsbuf && (job->resolve & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL))) { struct lima_surface *surf = lima_surface(job->key.zsbuf); - surf->reload = (job->resolve & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)); + surf->reload |= (job->resolve & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)); } if (ctx->job == job)