iris: move images next to textures in binding table
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 11 Oct 2018 04:44:43 +0000 (21:44 -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 b3eea223cc4429ce25d3081a2e0c08c783f4e232..56709dae5b46a8f08fe2c801499b52255c7ca3b1 100644 (file)
@@ -352,6 +352,13 @@ assign_common_binding_table_offsets(const struct gen_device_info *devinfo,
       prog_data->binding_table.gather_texture_start = 0xd0d0d0d0;
    }
 
+   if (info->num_images) {
+      prog_data->binding_table.image_start = next_binding_table_offset;
+      next_binding_table_offset += info->num_images;
+   } else {
+      prog_data->binding_table.image_start = 0xd0d0d0d0;
+   }
+
    int num_ubos = info->num_ubos + (nir->num_uniforms > 0 ? 1 : 0);
 
    if (num_ubos) {
@@ -372,13 +379,6 @@ assign_common_binding_table_offsets(const struct gen_device_info *devinfo,
 
    prog_data->binding_table.shader_time_start = 0xd0d0d0d0;
 
-   if (info->num_images) {
-      prog_data->binding_table.image_start = next_binding_table_offset;
-      next_binding_table_offset += info->num_images;
-   } else {
-      prog_data->binding_table.image_start = 0xd0d0d0d0;
-   }
-
    /* This may or may not be used depending on how the compile goes. */
    prog_data->binding_table.pull_constants_start = next_binding_table_offset;
    next_binding_table_offset++;
index d3ed36bac9a51d875b9e61d4a64619353f0c9bba..cf5536c390e90e659c9225465ab989d153a5570e 100644 (file)
@@ -3335,6 +3335,11 @@ iris_populate_binding_table(struct iris_context *ice,
       push_bt_entry(addr);
    }
 
+   for (int i = 0; i < info->num_images; i++) {
+      uint32_t addr = use_image(batch, ice, shs, i);
+      push_bt_entry(addr);
+   }
+
    const int num_ubos = iris_get_shader_num_ubos(ice, stage);
 
    for (int i = 0; i < num_ubos; i++) {
@@ -3354,13 +3359,6 @@ 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.plane_start[1] == 0xd0d0d0d0);