mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-12 00:20:43 +01:00
vc4: flush write jobs before BO replacement in DISCARD_WHOLE path
The DISCARD_WHOLE_RESOURCE path in vc4_map_usage_prep() replaces the
resource's BO with vc4_resource_bo_alloc(). As the RCL resolves
rsc->bo at job submit in vc4_submit_setup_rcl_surface(), any pending
write job would store to the new BO instead of the old one, corrupting
the new written data.
This is the same bug that was fixed in v3d in the previous commit.
Fixes: 18ccda7b86 ("vc4: When asked to discard-map a whole resource, discard it.")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40180>
This commit is contained in:
parent
1eaa46da09
commit
ecb6c5d555
2 changed files with 7 additions and 2 deletions
|
|
@ -860,7 +860,6 @@ spec@!opengl 1.1@polygon-mode-offset@config 6: Expected blue pixel in center,Fai
|
|||
spec@!opengl 1.1@polygon-mode-offset@config 6: Expected white pixel on right edge,Fail
|
||||
spec@!opengl 1.1@polygon-mode-offset@config 6: Expected white pixel on top edge,Fail
|
||||
|
||||
spec@!opengl 1.1@texsubimage-unpack,Fail
|
||||
spec@!opengl 1.1@texwrap 2d proj,Fail
|
||||
spec@!opengl 1.1@texwrap 2d proj@GL_RGBA8- NPOT- projected,Fail
|
||||
spec@!opengl 1.1@texwrap 2d proj@GL_RGBA8- projected,Fail
|
||||
|
|
@ -959,7 +958,6 @@ spec@arb_occlusion_query@occlusion_query_conform,Fail
|
|||
spec@arb_occlusion_query@occlusion_query_conform@GetObjivAval_multi2,Fail
|
||||
spec@arb_pixel_buffer_object@fbo-pbo-readpixels-small,Fail
|
||||
spec@arb_pixel_buffer_object@pbo-getteximage,Fail
|
||||
spec@arb_pixel_buffer_object@texsubimage-unpack pbo,Fail
|
||||
spec@arb_point_sprite@arb_point_sprite-mipmap,Fail
|
||||
spec@arb_provoking_vertex@arb-provoking-vertex-render,Fail
|
||||
spec@arb_sampler_objects@sampler-objects,Fail
|
||||
|
|
|
|||
|
|
@ -108,6 +108,13 @@ vc4_map_usage_prep(struct pipe_context *pctx,
|
|||
MESA_TRACE_FUNC();
|
||||
|
||||
if (usage & PIPE_MAP_DISCARD_WHOLE_RESOURCE) {
|
||||
/* Flush any pending write jobs before replacing the BO.
|
||||
* The RCL reads rsc->bo at job submit time, so if we
|
||||
* replace the BO first, a later flush of the pending
|
||||
* job would resolve the new BO instead of the old one,
|
||||
* corrupting the new data with a stale store.
|
||||
*/
|
||||
vc4_flush_jobs_writing_resource(vc4, prsc);
|
||||
if (vc4_resource_bo_alloc(rsc)) {
|
||||
/* If it might be bound as one of our vertex buffers,
|
||||
* make sure we re-emit vertex buffer state.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue