freedreno: Fix resource tracking on repeated map with discard

In two functions implementing resource discard rebind_resource is called
on resource before its track record is reset. This prevents update of
dirty_resource or dirty_shader_resource because of conditions in
needs_dirty_resource. With rsc->track reset and dirty_resource bits
missing further calls to transfer_map will not try to reallocate
resource storage when needed.

A way to reproduce the issue in both functions is by executing at least
3 draws modifying bound texture or VBO each time. This patch fixes those
cases and some related piglit tests on a5xx and should fix it on other
GPUs. Also it fixes rendering in Firefox and vsraytrace (except vertical
line at right edge).

Fixes: 0a62a874fc ("freedreno: Re-work dirty-resource tracking")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10374
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32167>
This commit is contained in:
Vldly 2024-11-14 20:41:38 +00:00 committed by Marge Bot
parent eb10dc2e73
commit 6d14cad330
3 changed files with 3 additions and 23 deletions

View File

@ -357,9 +357,6 @@ spec@arb_transform_feedback3@gl_nextbuffer-gl_nextbuffer,Fail
spec@arb_transform_feedback_instanced@draw-auto instanced,Fail
spec@arb_uniform_buffer_object@rendering-array,Fail
spec@arb_uniform_buffer_object@execution@std140-array-struct-array-struct,Fail
spec@arb_vertex_buffer_object@vbo-subdata-many drawarrays,Fail
spec@arb_vertex_buffer_object@vbo-subdata-many drawelements,Fail
spec@arb_vertex_buffer_object@vbo-subdata-many drawrangeelements,Fail
spec@egl 1.4@eglterminate then unbind context,Fail
spec@egl_chromium_sync_control@conformance,Fail
spec@egl_chromium_sync_control@conformance@eglGetSyncValuesCHROMIUM_msc_and_sbc_test,Fail
@ -846,7 +843,6 @@ spec@glsl-1.40@uniform_buffer@two-stages,Fail
# new failures since 2023/02/08 (CTS uprevs, regressions etc.)
shaders@glsl-max-varyings >max_varying_components,Fail
spec@!opengl 1.0@gl-1.0-ortho-pos,Fail
spec@!opengl 1.1@line-smooth-stipple,Fail
spec@!opengl 1.1@teximage-colors gl_alpha16@Exact upload-download of GL_ALPHA16,Fail
spec@!opengl 1.1@texwrap 1d,Fail
@ -932,8 +928,6 @@ spec@arb_internalformat_query2@max dimensions related pname checks@GL_MAX_HEIGHT
spec@arb_internalformat_query2@max dimensions related pname checks@GL_MAX_LAYERS,Fail
spec@arb_internalformat_query2@max dimensions related pname checks@GL_MAX_WIDTH,Fail
spec@arb_map_buffer_range@copybuffersubdata offset=0,Fail
spec@arb_map_buffer_range@map_invalidate_buffer_bit offset=0,Fail
spec@arb_map_buffer_range@map_invalidate_range_bit offset=0,Fail
spec@arb_occlusion_query@occlusion_query,Fail
spec@arb_occlusion_query@occlusion_query_conform,Fail
spec@arb_occlusion_query@occlusion_query_conform@GetObjivAval_multi2,Fail
@ -1048,10 +1042,6 @@ spec@arb_texture_rg@texwrap formats@GL_R16- NPOT,Fail
spec@arb_texture_rg@texwrap formats@GL_R8- NPOT,Fail
spec@arb_texture_rg@texwrap formats@GL_RG16- NPOT,Fail
spec@arb_texture_rg@texwrap formats@GL_RG8- NPOT,Fail
spec@arb_uniform_buffer_object@rendering,Fail
spec@arb_uniform_buffer_object@rendering-dsa,Fail
spec@arb_uniform_buffer_object@rendering-dsa-offset,Fail
spec@arb_uniform_buffer_object@rendering-offset,Fail
spec@ati_texture_compression_3dc@texwrap formats,Fail
spec@ati_texture_compression_3dc@texwrap formats@GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI- NPOT,Fail
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_vyuy,Fail

View File

@ -119,8 +119,6 @@ spec@arb_draw_indirect@gl_vertexid used with gldrawelementsindirect,Fail
spec@arb_enhanced_layouts@linker@component-layout@intrastage-vs,Fail
spec@arb_enhanced_layouts@linker@component-layout@vs-to-fs,Fail
spec@arb_map_buffer_alignment@arb_map_buffer_alignment-map-invalidate-range,Fail
spec@arb_map_buffer_range@map_invalidate_buffer_bit offset=0,Fail
spec@arb_map_buffer_range@map_invalidate_range_bit offset=0,Fail
spec@arb_occlusion_query@occlusion_query_order,Fail
spec@arb_point_sprite@arb_point_sprite-interactions 1.0,Fail
spec@arb_separate_shader_objects@400 combinations by location,Fail
@ -286,18 +284,9 @@ spec@khr_texture_compression_astc@miptree-gles srgb-sd,Fail
spec@khr_texture_compression_astc@miptree-gles srgb-sd@sRGB skip decode,Fail
spec@khr_texture_compression_astc@sliced-3d-miptree-gl hdr,Fail
spec@khr_texture_compression_astc@sliced-3d-miptree-gl hdr@HDR Profile,Fail
spec@arb_vertex_buffer_object@vbo-subdata-many drawarrays,Fail
spec@arb_vertex_buffer_object@vbo-subdata-many drawelements,Fail
spec@arb_vertex_buffer_object@vbo-subdata-many drawrangeelements,Fail
spec@arb_uniform_buffer_object@rendering,Fail
spec@arb_uniform_buffer_object@rendering-dsa,Fail
spec@arb_uniform_buffer_object@rendering-dsa-offset,Fail
spec@arb_uniform_buffer_object@rendering-offset,Fail
spec@!opengl 1.0@gl-1.0-ortho-pos,Fail
# Regressions since ???:
spec@!opengl 1.1@copyteximage 1d,Fail
spec@arb_shader_atomic_counters@respecify-buffer,Fail
spec@arb_timer_query@timestamp-get,Fail
# glcts uprev

View File

@ -417,7 +417,6 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc,
* should empty/destroy rsc->batches hashset)
*/
fd_bc_invalidate_resource(rsc, false);
rebind_resource(rsc);
fd_screen_lock(ctx->screen);
@ -459,6 +458,8 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc,
fd_screen_unlock(ctx->screen);
rebind_resource(rsc);
struct pipe_blit_info blit = {};
blit.dst.resource = prsc;
blit.dst.format = prsc->format;
@ -740,8 +741,8 @@ invalidate_resource(struct fd_resource *rsc, unsigned usage) assert_dt
unsigned op = translate_usage(usage);
if (needs_flush || resource_busy(rsc, op)) {
rebind_resource(rsc);
realloc_bo(rsc, fd_bo_size(rsc->bo));
rebind_resource(rsc);
} else {
util_range_set_empty(&rsc->valid_buffer_range);
}