diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2019-08-19 13:52:37 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2019-08-22 18:31:14 -0700 |
commit | f6c44549ee2dd0f218deea1feba3965523609406 (patch) | |
tree | 03257a28bcf345bbf5d870e08f6561aae6f6be54 | |
parent | 272ce6f5a7cd646be495f1d71918476e94b29c4b (diff) |
iris: Replace devinfo->gen with GEN_GEN
This is genxml, we can compile out this code.
Fixes: 26606672847 ("iris/gen8: Re-emit the SURFACE_STATE if the clear color changed.")
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
-rw-r--r-- | src/gallium/drivers/iris/iris_state.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 529165bafa93..f22d5df144f1 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -4032,36 +4032,32 @@ update_clear_value(struct iris_context *ice, unsigned aux_modes, struct isl_view *view) { - struct iris_screen *screen = batch->screen; - const struct gen_device_info *devinfo = &screen->devinfo; + UNUSED struct isl_device *isl_dev = &batch->screen->isl_dev; /* We only need to update the clear color in the surface state for gen8 and * gen9. Newer gens can read it directly from the clear color state buffer. */ - if (devinfo->gen > 9) - return; +#if GEN_GEN == 9 + /* Skip updating the ISL_AUX_USAGE_NONE surface state */ + aux_modes &= ~(1 << ISL_AUX_USAGE_NONE); - if (devinfo->gen == 9) { - /* Skip updating the ISL_AUX_USAGE_NONE surface state */ - aux_modes &= ~(1 << ISL_AUX_USAGE_NONE); + while (aux_modes) { + enum isl_aux_usage aux_usage = u_bit_scan(&aux_modes); - while (aux_modes) { - enum isl_aux_usage aux_usage = u_bit_scan(&aux_modes); + surf_state_update_clear_value(batch, res, state, aux_modes, aux_usage); + } +#elif GEN_GEN == 8 + pipe_resource_reference(&state->res, NULL); - surf_state_update_clear_value(batch, res, state, aux_modes, - aux_usage); - } - } else if (devinfo->gen == 8) { - pipe_resource_reference(&state->res, NULL); - void *map = alloc_surface_states(ice->state.surface_uploader, - state, res->aux.possible_usages); - while (aux_modes) { - enum isl_aux_usage aux_usage = u_bit_scan(&aux_modes); - fill_surface_state(&screen->isl_dev, map, res, &res->surf, view, - aux_usage, 0, 0); - map += SURFACE_STATE_ALIGNMENT; - } + void *map = alloc_surface_states(ice->state.surface_uploader, + state, res->aux.possible_usages); + + while (aux_modes) { + enum isl_aux_usage aux_usage = u_bit_scan(&aux_modes); + fill_surface_state(isl_dev, map, res, &res->surf, view, aux_usage, 0, 0); + map += SURFACE_STATE_ALIGNMENT; } +#endif } /** |