nir/lower_tex: ignore width of cube textures
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 5 Aug 2022 15:34:30 +0000 (16:34 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 30 Aug 2022 07:37:08 +0000 (07:37 +0000)
On AMD hardware, height is faster to access and we're already doing so.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17991>

src/compiler/nir/nir_lower_tex.c

index 9add854..634384f 100644 (file)
@@ -1254,7 +1254,7 @@ nir_lower_txs_cube_array(nir_builder *b, nir_tex_instr *tex)
    assert(tex->dest.is_ssa);
    assert(tex->dest.ssa.num_components == 3);
    nir_ssa_def *size = &tex->dest.ssa;
-   size = nir_vec3(b, nir_channel(b, size, 0),
+   size = nir_vec3(b, nir_channel(b, size, 1),
                       nir_channel(b, size, 1),
                       nir_idiv(b, nir_channel(b, size, 2),
                                   nir_imm_int(b, 6)));