mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02: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> (cherry picked from commitecb6c5d555) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40359>
This commit is contained in:
parent
fb8f81a1d8
commit
7d25d214f5
3 changed files with 8 additions and 3 deletions
|
|
@ -3914,7 +3914,7 @@
|
|||
"description": "vc4: flush write jobs before BO replacement in DISCARD_WHOLE path",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "18ccda7b86b8f7ab7466265aefb3f3e773f4a757",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -853,7 +853,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
|
||||
|
|
@ -953,7 +952,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