Module: Mesa Branch: master Commit: a67d3e7c9e2c1ae9b05153a281cf73926b9f6af7 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a67d3e7c9e2c1ae9b05153a281cf73926b9f6af7
Author: Pierre-Eric Pelloux-Prayer <[email protected]> Date: Tue Feb 9 21:50:07 2021 +0100 radeonsi: fix si_check_render_feedback si_check_render_feedback only relied on si_images::enabled_mask and si_samplers::enabled_mask to determine if a texture was being used both as input and output. Given that some samplers/images can be considered active (so accounted for by enabled_mask) but not used by the current shader this could lead to false-positive. This commit fixes this by and-ing the above mask with the information from shader_info for each active shader. Reviewed-by: Zoltán Böszörményi <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4227 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8869> --- ci-expects/radeonsi/traces-radeonsi.yml | 4 ++-- src/gallium/drivers/radeonsi/si_blit.c | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ci-expects/radeonsi/traces-radeonsi.yml b/ci-expects/radeonsi/traces-radeonsi.yml index 66c30c5e792..96dc165d08a 100644 --- a/ci-expects/radeonsi/traces-radeonsi.yml +++ b/ci-expects/radeonsi/traces-radeonsi.yml @@ -225,7 +225,7 @@ traces: - path: supertuxkart/supertuxkart-antediluvian-abyss.rdc expectations: - device: gl-radeonsi-stoney - checksum: 499e93c37e33cc6430c7a9f94266f2f7 + checksum: f1774fc459aa0734838888dd44db052e - path: supertuxkart/supertuxkart-menu.rdc expectations: - device: gl-radeonsi-stoney @@ -233,4 +233,4 @@ traces: - path: supertuxkart/supertuxkart-ravenbridge-mansion.rdc expectations: - device: gl-radeonsi-stoney - checksum: 38a9f26c60a0bc4245b97d32da84ef75 + checksum: 66b6dee290642bd25dfd817d190f6906 diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c index 1051ff465ad..2cb7092eb73 100644 --- a/src/gallium/drivers/radeonsi/si_blit.c +++ b/src/gallium/drivers/radeonsi/si_blit.c @@ -593,9 +593,10 @@ static void si_check_render_feedback_texture(struct si_context *sctx, struct si_ si_texture_disable_dcc(sctx, tex); } -static void si_check_render_feedback_textures(struct si_context *sctx, struct si_samplers *textures) +static void si_check_render_feedback_textures(struct si_context *sctx, struct si_samplers *textures, + uint32_t in_use_mask) { - uint32_t mask = textures->enabled_mask; + uint32_t mask = textures->enabled_mask & in_use_mask; while (mask) { const struct pipe_sampler_view *view; @@ -614,9 +615,10 @@ static void si_check_render_feedback_textures(struct si_context *sctx, struct si } } -static void si_check_render_feedback_images(struct si_context *sctx, struct si_images *images) +static void si_check_render_feedback_images(struct si_context *sctx, struct si_images *images, + uint32_t in_use_mask) { - uint32_t mask = images->enabled_mask; + uint32_t mask = images->enabled_mask & in_use_mask; while (mask) { const struct pipe_image_view *view; @@ -680,9 +682,15 @@ static void si_check_render_feedback(struct si_context *sctx) if (!si_get_total_colormask(sctx)) return; - for (int i = 0; i < SI_NUM_SHADERS; ++i) { - si_check_render_feedback_images(sctx, &sctx->images[i]); - si_check_render_feedback_textures(sctx, &sctx->samplers[i]); + for (int i = 0; i < SI_NUM_GRAPHICS_SHADERS; ++i) { + if (!sctx->shaders[i].cso) + continue; + + struct si_shader_info *info = &sctx->shaders[i].cso->info; + si_check_render_feedback_images(sctx, &sctx->images[i], + u_bit_consecutive(0, info->base.num_images)); + si_check_render_feedback_textures(sctx, &sctx->samplers[i], + info->base.textures_used); } si_check_render_feedback_resident_images(sctx); _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
