iris: Actually pin the scratch BO.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 11 Apr 2019 18:51:26 +0000 (11:51 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 11 Apr 2019 22:03:27 +0000 (15:03 -0700)
We were pinning it for compute shaders, and pinning it when restoring
saved buffers, but we never actually pinned it in the original batch
for VS/TCS/TES/GS/FS.

Fixes rendering in GFXBench5's Tessellation demo and a bunch of Piglit
geometry shader tests.

src/gallium/drivers/iris/iris_state.c

index 381fae8c0ff16069e002f886a1d69021505c318e..bf4fdcae1c98caa9f0f8ec74ddd75c8a51839340 100644 (file)
@@ -4593,8 +4593,16 @@ iris_upload_dirty_render_state(struct iris_context *ice,
       struct iris_compiled_shader *shader = ice->shaders.prog[stage];
 
       if (shader) {
+         struct brw_stage_prog_data *prog_data = shader->prog_data;
          struct iris_resource *cache = (void *) shader->assembly.res;
          iris_use_pinned_bo(batch, cache->bo, false);
+
+         if (prog_data->total_scratch > 0) {
+            struct iris_bo *bo =
+               iris_get_scratch_space(ice, prog_data->total_scratch, stage);
+            iris_use_pinned_bo(batch, bo, true);
+         }
+
          iris_batch_emit(batch, shader->derived_data,
                          iris_derived_program_state_size(stage));
       } else {