diff options
author | Kenneth Graunke <[email protected]> | 2018-08-31 18:03:19 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:08 -0800 |
commit | 5a2257bb2fe910d674a691b44c03c836406f08a0 (patch) | |
tree | f0088e4033cb88759231a107fb5087fcef817764 /src/gallium/drivers/iris/iris_draw.c | |
parent | 4c27cb031ca766af259a6f95f6e5fb1f77e4041b (diff) |
iris: don't unconditionally emit 3DSTATE_VF / 3DSTATE_VF_TOPOLOGY
this was just laziness on my part
Diffstat (limited to 'src/gallium/drivers/iris/iris_draw.c')
-rw-r--r-- | src/gallium/drivers/iris/iris_draw.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_draw.c b/src/gallium/drivers/iris/iris_draw.c index d938c3d0f4f..f6911350a7b 100644 --- a/src/gallium/drivers/iris/iris_draw.c +++ b/src/gallium/drivers/iris/iris_draw.c @@ -38,6 +38,29 @@ #include "iris_context.h" /** + * Record the current primitive mode and restart information, flagging + * related packets as dirty if necessary. + */ +static void +iris_update_draw_info(struct iris_context *ice, + const struct pipe_draw_info *info) +{ + if (ice->state.prim_mode != info->mode || + ice->state.vertices_per_patch != info->vertices_per_patch) { + ice->state.prim_mode = info->mode; + ice->state.vertices_per_patch = info->vertices_per_patch; + ice->state.dirty |= IRIS_DIRTY_VF_TOPOLOGY; + } + + if (ice->state.primitive_restart != info->primitive_restart || + ice->state.cut_index != info->restart_index) { + ice->state.dirty |= IRIS_DIRTY_VF; + ice->state.primitive_restart = info->primitive_restart; + ice->state.cut_index = info->restart_index; + } +} + +/** * The pipe->draw_vbo() driver hook. Performs a draw on the GPU. */ void @@ -51,6 +74,7 @@ iris_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info) iris_batch_maybe_flush(batch, 1500); + iris_update_draw_info(ice, info); iris_update_compiled_shaders(ice); iris_predraw_resolve_inputs(ice, batch); |