Mesa (main): virgl: Always make some extra temps available for transformations

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 12 10:54:12 UTC 2022


Module: Mesa
Branch: main
Commit: a083ae818af0c3a27f5615b2efb26345d9aa6e0f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a083ae818af0c3a27f5615b2efb26345d9aa6e0f

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Sat Apr  9 11:54:29 2022 +0200

virgl: Always make some extra temps available for transformations

The host driver will optimize unused variables away, and checking thoroughly whether we
may need an extra temp is just uselessly costly.

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15836>

---

 src/gallium/drivers/virgl/virgl_tgsi.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/virgl/virgl_tgsi.c b/src/gallium/drivers/virgl/virgl_tgsi.c
index f14583a3464..2a4f8bd3abe 100644
--- a/src/gallium/drivers/virgl/virgl_tgsi.c
+++ b/src/gallium/drivers/virgl/virgl_tgsi.c
@@ -189,11 +189,9 @@ virgl_tgsi_transform_prolog(struct tgsi_transform_context * ctx)
 {
    struct virgl_transform_context *vtctx = (struct virgl_transform_context *)ctx;
 
-   if (vtctx->info.uses_doubles || vtctx->info.file_count[TGSI_FILE_SAMPLER_VIEW]) {
-      vtctx->src_temp = vtctx->next_temp;
-      vtctx->next_temp += 4;
-      tgsi_transform_temps_decl(ctx, vtctx->src_temp, vtctx->src_temp + 3);
-   }
+   vtctx->src_temp = vtctx->next_temp;
+   vtctx->next_temp += 4;
+   tgsi_transform_temps_decl(ctx, vtctx->src_temp, vtctx->src_temp + 3);
 
    if (vtctx->num_writemask_fixups) {
       vtctx->writemask_fixup_temps = vtctx->next_temp;



More information about the mesa-commit mailing list