iris: Use constants for emitting cso_z->packets

This should be a bit faster and easier to follow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11454>
This commit is contained in:
Nanley Chery 2021-06-17 10:12:12 -07:00 committed by Marge Bot
parent 2ae70329f5
commit e86fb61106
1 changed files with 4 additions and 4 deletions

View File

@ -6241,9 +6241,9 @@ iris_upload_dirty_render_state(struct iris_context *ice,
union isl_color_value clear_value =
iris_resource_get_clear_color(zres, NULL, NULL);
uint32_t clear_length = GENX(3DSTATE_CLEAR_PARAMS_length) * 4;
uint32_t cso_z_size = batch->screen->isl_dev.ds.size - clear_length;
uint32_t *clear_params = cso_z->packets + cso_z_size / 4;
uint32_t *clear_params =
cso_z->packets + ARRAY_SIZE(cso_z->packets) -
GENX(3DSTATE_CLEAR_PARAMS_length);
iris_pack_command(GENX(3DSTATE_CLEAR_PARAMS), clear_params, clear) {
clear.DepthClearValueValid = true;
@ -6251,7 +6251,7 @@ iris_upload_dirty_render_state(struct iris_context *ice,
}
}
iris_batch_emit(batch, cso_z->packets, batch->screen->isl_dev.ds.size);
iris_batch_emit(batch, cso_z->packets, sizeof(cso_z->packets));
if (zres)
genX(emit_depth_state_workarounds)(ice, batch, &zres->surf);