iris: bother with BTIs
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 30 Aug 2018 22:49:32 +0000 (15:49 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:09 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_program.c
src/gallium/drivers/iris/iris_state.c

index 5ccb987da15812db556703a80fa485d7f101db98..a0dcaa771755a737e3b371a00ded5b72df488289 100644 (file)
@@ -363,10 +363,9 @@ assign_common_binding_table_offsets(const struct gen_device_info *devinfo,
    }
 
    if (info->num_ssbos || info->num_abos) {
-      //assert(info->num_abos <= BRW_MAX_ABO);
-      //assert(info->num_ssbos <= BRW_MAX_SSBO);
       prog_data->binding_table.ssbo_start = next_binding_table_offset;
-      next_binding_table_offset += info->num_abos + info->num_ssbos;
+      // XXX: see iris_state "wasting 16 binding table slots for ABOs" comment
+      next_binding_table_offset += IRIS_MAX_ABOS + info->num_ssbos;
    } else {
       prog_data->binding_table.ssbo_start = 0xd0d0d0d0;
    }
index dd90d2816ed680c896ffd71003b5b904e50a0149..0b7cc0db5126926862fc1f7da1c9b69d2dfb59b1 100644 (file)
@@ -3248,6 +3248,21 @@ use_ssbo(struct iris_batch *batch, struct iris_context *ice,
    return surf_state->offset;
 }
 
+static uint32_t
+use_image(struct iris_batch *batch, struct iris_context *ice,
+          struct iris_shader_state *shs, int i)
+{
+   if (!shs->image[i])
+      return use_null_surface(batch, ice);
+
+   struct iris_state_ref *surf_state = &shs->image_surface_state[i];
+
+   iris_use_pinned_bo(batch, iris_resource_bo(shs->image[i]), true);
+   iris_use_pinned_bo(batch, iris_resource_bo(surf_state->res), false);
+
+   return surf_state->offset;
+}
+
 #define push_bt_entry(addr) \
    assert(addr >= binder_addr); \
    if (!pin_only) bt_map[s++] = (addr) - binder_addr;
@@ -3331,9 +3346,15 @@ iris_populate_binding_table(struct iris_context *ice,
       }
    }
 
+   if (info->num_images > 0) {
+      for (int i = 0; i < info->num_images; i++) {
+         uint32_t addr = use_image(batch, ice, shs, i);
+         push_bt_entry(addr);
+      }
+   }
+
 #if 0
       // XXX: not implemented yet
-      assert(prog_data->binding_table.image_start == 0xd0d0d0d0);
       assert(prog_data->binding_table.plane_start[1] == 0xd0d0d0d0);
       assert(prog_data->binding_table.plane_start[2] == 0xd0d0d0d0);
 #endif