iris: re-pin inherited streamout buffers
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 3 Dec 2018 00:06:01 +0000 (16:06 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:10 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_state.c

index 389f4b6f4d0d80c7cb431d4e8c26938d1cb0e59b..dd0d16cf68436bf2f658d562a9dc58887cde7105 100644 (file)
@@ -3758,6 +3758,19 @@ iris_restore_render_saved_bos(struct iris_context *ice,
       iris_use_optional_res(batch, ice->state.last_res.scissor, false);
    }
 
+   if (ice->state.streamout_active && (clean & IRIS_DIRTY_SO_BUFFERS)) {
+      for (int i = 0; i < 4; i++) {
+         struct iris_stream_output_target *tgt =
+            (void *) ice->state.so_target[i];
+         if (tgt) {
+            iris_use_pinned_bo(batch, iris_resource_bo(tgt->base.buffer),
+                               true);
+            iris_use_pinned_bo(batch, iris_resource_bo(tgt->offset.res),
+                               true);
+         }
+      }
+   }
+
    for (int stage = 0; stage <= MESA_SHADER_FRAGMENT; stage++) {
       if (!(clean & (IRIS_DIRTY_CONSTANTS_VS << stage)))
          continue;