freedreno: handle case of shadowing current render target
If you have a sequence where there is a single buffer associated with the current render target, and then you end up shadowing it on the 3d pipe (u_blitter), because of how we swap the new shadow and rsc before the back-blit, you could end up confusing things into thinking that the blitters framebuffer state is the same as the current framebuffer state. Re-organizing the sequence to swap after the blit is complicated when also having to deal with CPU memcpy blit path, and the batch/rsc accounting. So instead just detect this case and flush if we need to. Fixes: dEQP-GLES31.functional.stencil_texturing.render.depth24_stencil8_clear dEQP-GLES31.functional.stencil_texturing.render.depth24_stencil8_draw Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6434>
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
# Possibly https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/2035 related
|
||||
dEQP-GLES2.functional.clipping.triangle_vertex.clip_three.clip_neg_x_neg_z_and_pos_x_pos_z_and_neg_x_neg_y_pos_z
|
||||
|
||||
dEQP-GLES31.functional.stencil_texturing.render.depth24_stencil8_clear
|
||||
dEQP-GLES31.functional.stencil_texturing.render.depth24_stencil8_draw
|
||||
dEQP-VK.binding_model.descriptorset_random.sets4.constant.ubolimitlow.sbolimithigh.imglimithigh.noiub.uab.frag.ialimitlow.0
|
||||
dEQP-VK.draw.output_location.array.b8g8r8a8-unorm-mediump-output-vec3
|
||||
dEQP-VK.glsl.linkage.varying.struct.mat3x2
|
||||
|
@@ -218,6 +218,9 @@ do_blit(struct fd_context *ctx, const struct pipe_blit_info *blit, bool fallback
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
flush_resource(struct fd_context *ctx, struct fd_resource *rsc, unsigned usage);
|
||||
|
||||
/**
|
||||
* @rsc: the resource to shadow
|
||||
* @level: the level to discard (if box != NULL, otherwise ignored)
|
||||
@@ -235,6 +238,21 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc,
|
||||
if (prsc->next)
|
||||
return false;
|
||||
|
||||
/* If you have a sequence where there is a single rsc associated
|
||||
* with the current render target, and then you end up shadowing
|
||||
* that same rsc on the 3d pipe (u_blitter), because of how we
|
||||
* swap the new shadow and rsc before the back-blit, you could end
|
||||
* up confusing things into thinking that u_blitter's framebuffer
|
||||
* state is the same as the current framebuffer state, which has
|
||||
* the result of blitting to rsc rather than shadow.
|
||||
*
|
||||
* Normally we wouldn't want to unconditionally trigger a flush,
|
||||
* since that defeats the purpose of shadowing, but this is a
|
||||
* case where we'd have to flush anyways.
|
||||
*/
|
||||
if (rsc->write_batch == ctx->batch)
|
||||
flush_resource(ctx, rsc, 0);
|
||||
|
||||
/* TODO: somehow munge dimensions and format to copy unsupported
|
||||
* render target format to something that is supported?
|
||||
*/
|
||||
|
Reference in New Issue
Block a user