summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_image.c
diff options
context:
space:
mode:
authorRafael Antognolli <[email protected]>2018-01-18 09:50:48 -0800
committerRafael Antognolli <[email protected]>2018-04-05 07:42:45 -0700
commit021e1885d0d09adf3b9bc40c74172f983a2263dd (patch)
tree22cb9e705ceabe25f91e6348480e260be353486d /src/intel/vulkan/anv_image.c
parent3f96b459f425d05dfb1c809b2b9c2f66f8763743 (diff)
anv: Emit the fast clear color address, instead of value.
On Gen10+, instead of copying the clear color from the state buffer to the surface state, just use the address of the state buffer in the surface state directly. This way we can avoid the copy from state buffer to surface state. v4: - Remove use_clear_address from anv code. (Jason) - Use the helper to extract clear color from attachment (Jason) Signed-off-by: Rafael Antognolli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r--src/intel/vulkan/anv_image.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index d9b5d266020..da4601ce20e 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -1059,6 +1059,13 @@ anv_image_fill_surface_state(struct anv_device *device,
const uint64_t aux_address = aux_usage == ISL_AUX_USAGE_NONE ?
0 : (image->planes[plane].bo_offset + aux_surface->offset);
+ struct anv_address clear_address = { .bo = NULL };
+ state_inout->clear_address = 0;
+ if (device->info.gen >= 10 && aux_usage != ISL_AUX_USAGE_NONE &&
+ aux_usage != ISL_AUX_USAGE_HIZ) {
+ clear_address = anv_image_get_clear_color_addr(device, image, aspect);
+ }
+
if (view_usage == ISL_SURF_USAGE_STORAGE_BIT &&
!(flags & ANV_IMAGE_VIEW_STATE_STORAGE_WRITE_ONLY) &&
!isl_has_matching_typed_storage_image_format(&device->info,
@@ -1076,6 +1083,7 @@ anv_image_fill_surface_state(struct anv_device *device,
.mocs = device->default_mocs);
state_inout->address = address,
state_inout->aux_address = 0;
+ state_inout->clear_address = 0;
} else {
if (view_usage == ISL_SURF_USAGE_STORAGE_BIT &&
!(flags & ANV_IMAGE_VIEW_STATE_STORAGE_WRITE_ONLY)) {
@@ -1149,6 +1157,8 @@ anv_image_fill_surface_state(struct anv_device *device,
.aux_surf = &aux_surface->isl,
.aux_usage = aux_usage,
.aux_address = aux_address,
+ .clear_address = clear_address.offset,
+ .use_clear_address = clear_address.bo != NULL,
.mocs = device->default_mocs,
.x_offset_sa = tile_x_sa,
.y_offset_sa = tile_y_sa);
@@ -1163,6 +1173,13 @@ anv_image_fill_surface_state(struct anv_device *device,
assert((aux_address & 0xfff) == 0);
assert(aux_address == (*aux_addr_dw & 0xfffff000));
state_inout->aux_address = *aux_addr_dw;
+
+ if (device->info.gen >= 10 && clear_address.bo) {
+ uint32_t *clear_addr_dw = state_inout->state.map +
+ device->isl_dev.ss.clear_color_state_offset;
+ assert((clear_address.offset & 0x3f) == 0);
+ state_inout->clear_address = *clear_addr_dw;
+ }
}
anv_state_flush(device, state_inout->state);