r600/sfn: re-use an allocated register in lookup
authorGert Wollny <gert.wollny@collabora.com>
Wed, 6 May 2020 21:38:01 +0000 (23:38 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 19 May 2020 07:52:13 +0000 (07:52 +0000)
For texture coordinates we always allocate all four components so that
we can use these for LOD and, compare etc.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5085>

src/gallium/drivers/r600/sfn/sfn_valuepool.cpp

index 8ce378b43b3ad6dda5bb9fe8e3802e66fcaa73a3..579e39f0acd0827f912b3ffd78f12d22c3987af7 100644 (file)
@@ -172,7 +172,7 @@ PValue ValuePool::create_register_from_nir_src(const nir_src& src, int comp)
                           get_local_register_index(*src.reg.reg);
 
    auto retval = lookup_register(idx, comp, false);
-   if (!retval)
+   if (!retval || retval->type() != Value::gpr || retval->type() != Value::gpr_array_value)
       retval = create_register(idx, comp);
    return retval;
 }