anv: fix invalid binding table index computation
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 17 Jan 2019 18:19:59 +0000 (18:19 +0000)
committerMark Janes <mark.a.janes@intel.com>
Thu, 17 Jan 2019 19:49:10 +0000 (11:49 -0800)
The ++ operator strikes again.

Fixes: f92c5bc8f3f517 ("anv/device: fix maximum number of images supported")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/genX_cmd_buffer.c

index 0bf46db0a5e479a3538632ede61b0ede655166cc..abba55cf84ffd40cbaf934b4dce3cf5b0483c744 100644 (file)
@@ -2178,8 +2178,6 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
          surface_state = sstate.state;
          assert(surface_state.alloc_size);
          add_surface_state_relocs(cmd_buffer, sstate);
-         image++;
-
          if (devinfo->gen < 9) {
             assert(image < MAX_GEN8_IMAGES);
             struct brw_image_param *image_param =
@@ -2188,6 +2186,7 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
             *image_param =
                desc->image_view->planes[binding->plane].storage_image_param;
          }
+         image++;
          break;
       }
 
@@ -2232,8 +2231,6 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
          assert(surface_state.alloc_size);
          add_surface_reloc(cmd_buffer, surface_state,
                            desc->buffer_view->address);
-         image++;
-
          if (devinfo->gen < 9) {
             assert(image < MAX_GEN8_IMAGES);
             struct brw_image_param *image_param =
@@ -2241,6 +2238,7 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
 
             *image_param = desc->buffer_view->storage_image_param;
          }
+         image++;
          break;
 
       default: