pan/bi: Pipe multiple textures through
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 30 Apr 2020 20:10:55 +0000 (16:10 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 1 May 2020 00:27:23 +0000 (00:27 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4844>

src/panfrost/bifrost/bi_pack.c
src/panfrost/bifrost/bifrost_compile.c

index e884417476f555bdc0b974a075237da029961b08..5cd902da2506efc97474997acbb920762bb65c92 100644 (file)
@@ -1441,8 +1441,8 @@ bi_pack_add_tex_compact(bi_clause *clause, bi_instruction *ins, struct bi_regist
                 .op = f16 ? BIFROST_ADD_OP_TEX_COMPACT_F16 :
                         BIFROST_ADD_OP_TEX_COMPACT_F32,
                 .unknown = 1,
-                .tex_index = 0,
-                .sampler_index = 0
+                .tex_index = ins->texture.texture_index,
+                .sampler_index = ins->texture.sampler_index
         };
 
         bi_write_data_register(clause, ins);
index ca4aa427b49c010ed6697a7002a20ffbd8db3195..cd659809a62da128ab82a94fefa6e073d3e4a1ba 100644 (file)
@@ -692,13 +692,13 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr)
 static void
 emit_tex_compact(bi_context *ctx, nir_tex_instr *instr)
 {
-        /* TODO: Pipe through indices */
-        assert(instr->texture_index == 0);
-        assert(instr->sampler_index == 0);
-
         bi_instruction tex = {
                 .type = BI_TEX,
                 .op = { .texture = BI_TEX_COMPACT },
+                .texture = {
+                        .texture_index = instr->texture_index,
+                        .sampler_index = instr->sampler_index,
+                },
                 .dest = pan_dest_index(&instr->dest),
                 .dest_type = instr->dest_type,
                 .src_types = { nir_type_float32, nir_type_float32 },