iris: Update the surface state clear color address when available.
authorRafael Antognolli <rafael.antognolli@intel.com>
Wed, 3 Apr 2019 00:10:26 +0000 (17:10 -0700)
committerRafael Antognolli <rafael.antognolli@intel.com>
Tue, 30 Apr 2019 15:31:44 +0000 (08:31 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/iris/iris_state.c

index 91659f4f67b0d840241bc74febe192850f0cf4a7..60d409b5301f5fbd56bb02285252c85116711aac 100644 (file)
@@ -1728,7 +1728,15 @@ fill_surface_state(struct isl_device *isl_dev,
       f.aux_surf = &res->aux.surf;
       f.aux_usage = aux_usage;
       f.aux_address = res->aux.bo->gtt_offset + res->aux.offset;
-      f.clear_color = res->aux.clear_color;
+
+      struct iris_bo *clear_bo = NULL;
+      uint64_t clear_offset = 0;
+      f.clear_color =
+         iris_resource_get_clear_color(res, &clear_bo, &clear_offset);
+      if (clear_bo) {
+         f.clear_address = clear_bo->gtt_offset + clear_offset;
+         f.use_clear_address = isl_dev->info->gen > 9;
+      }
    }
 
    isl_surf_fill_state_s(isl_dev, map, &f);