r300: invalidate texture cache when clearing texture bound for sampling
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38842>
This commit is contained in:
Pavel Ondračka 2025-12-12 12:32:48 +01:00 committed by Marge Bot
parent 48d30ce5bf
commit 7abe0363c7
5 changed files with 18 additions and 11 deletions

View file

@ -32,9 +32,6 @@ dEQP-GLES2.functional.draw.random.8,Fail
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_half_float_oes,Fail
dEQP-GLES2.functional.fbo.render.repeated_clear.tex2d_rgb,Fail
dEQP-GLES2.functional.fbo.render.repeated_clear.tex2d_rgba,Fail
# This bunch is not reproducible outside of CI
dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.8,Fail
dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.86,Fail

View file

@ -1,7 +1,5 @@
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_half_float_oes,Fail
dEQP-GLES2.functional.fbo.render.repeated_clear.tex2d_rgb,Fail
dEQP-GLES2.functional.fbo.render.repeated_clear.tex2d_rgba,Fail
dEQP-GLES2.functional.polygon_offset.fixed16_displacement_with_units,Fail
dEQP-GLES2.functional.polygon_offset.fixed16_render_with_units,Fail
dEQP-GLES2.functional.shaders.builtin_variable.frontfacing,Fail

View file

@ -1,8 +1,5 @@
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_half_float_oes,Fail
dEQP-GLES2.functional.fbo.render.repeated_clear.tex2d_rgb,Fail
dEQP-GLES2.functional.fbo.render.repeated_clear.tex2d_rgba,Fail
# This bunch is not reproducible outside of CI
dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.8,Fail
dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.20,Fail

View file

@ -1,9 +1,6 @@
# "Framebuffer checked as complete, expected incomplete"
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_half_float_oes,Fail
dEQP-GLES2.functional.fbo.render.repeated_clear.tex2d_rgb,Fail
dEQP-GLES2.functional.fbo.render.repeated_clear.tex2d_rgba,Fail
dEQP-GLES2.functional.polygon_offset.default_factor_1_slope,Fail
dEQP-GLES2.functional.polygon_offset.fixed16_displacement_with_units,Fail
dEQP-GLES2.functional.polygon_offset.fixed16_render_with_units,Fail

View file

@ -411,6 +411,24 @@ static void r300_clear(struct pipe_context* pipe,
r300_mark_fb_state_dirty(r300, R300_CHANGED_HYPERZ_FLAG);
}
/* If we are clearing texture currently bound for sampling we need to invalidate the cache. */
if (buffers & PIPE_CLEAR_COLOR) {
struct r300_textures_state *texstate =
(struct r300_textures_state*)r300->textures_state.state;
for (unsigned i = 0; i < fb->nr_cbufs; i++) {
struct pipe_resource *cbuf_tex = fb->cbufs[i].texture;
if (!cbuf_tex)
continue;
for (unsigned s = 0; s < texstate->sampler_view_count; s++) {
struct r300_sampler_view *view = texstate->sampler_views[s];
if (view && view->base.texture == cbuf_tex) {
r300_mark_atom_dirty(r300, &r300->texture_cache_inval);
break;
}
}
}
}
/* Enable fastfill and/or hiz.
*
* If we cleared zmask/hiz, it's in use now. The Hyper-Z state update