nv50/ir/nir: implement nir_intrinsic_load_uniform
authorKarol Herbst <kherbst@redhat.com>
Tue, 12 Dec 2017 20:02:37 +0000 (21:02 +0100)
committerKarol Herbst <kherbst@redhat.com>
Sun, 17 Mar 2019 09:33:28 +0000 (10:33 +0100)
v2: use new getIndirect helper
    fixes symbols for 64 bit types
v4: use smarter getIndirect helper
    simplify address calculation
    use loadFrom helper
v8: don't require C++11 features

Signed-off-by: Karol Herbst <kherbst@redhat.com>
src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp

index a553e42e08a861f1b4cc36fafb382b0a9bd667a0..dc8dbcfb48baab82a5cb38a85f9fb0cc171b891a 100644 (file)
@@ -1532,6 +1532,16 @@ Converter::visit(nir_intrinsic_instr *insn)
    nir_intrinsic_op op = insn->intrinsic;
 
    switch (op) {
+   case nir_intrinsic_load_uniform: {
+      LValues &newDefs = convert(&insn->dest);
+      const DataType dType = getDType(insn);
+      Value *indirect;
+      uint32_t coffset = getIndirect(insn, 0, 0, indirect);
+      for (uint8_t i = 0; i < insn->num_components; ++i) {
+         loadFrom(FILE_MEMORY_CONST, 0, dType, newDefs[i], 16 * coffset, i, indirect);
+      }
+      break;
+   }
    default:
       ERROR("unknown nir_intrinsic_op %s\n", nir_intrinsic_infos[op].name);
       return false;