iris: Skip input resolve handling if bindings haven't changed

This brings the drawoverhead 16 Tex w/ no state change score from
22% of baseline to 97% of baseline.
This commit is contained in:
Kenneth Graunke 2019-03-09 01:31:06 -08:00
parent a342f2deb1
commit 1d05d24b1d
3 changed files with 19 additions and 10 deletions

View File

@ -792,8 +792,8 @@ void iris_resolve_conditional_render(struct iris_context *ice);
void iris_predraw_resolve_inputs(struct iris_context *ice,
struct iris_batch *batch,
struct iris_shader_state *shs,
bool *draw_aux_buffer_disabled,
gl_shader_stage stage,
bool consider_framebuffer);
void iris_predraw_resolve_framebuffer(struct iris_context *ice,
struct iris_batch *batch,

View File

@ -135,9 +135,10 @@ iris_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
bool draw_aux_buffer_disabled[BRW_MAX_DRAW_BUFFERS] = { };
for (gl_shader_stage stage = 0; stage < MESA_SHADER_COMPUTE; stage++) {
if (ice->shaders.prog[stage])
iris_predraw_resolve_inputs(ice,batch, &ice->state.shaders[stage],
draw_aux_buffer_disabled, true);
if (ice->shaders.prog[stage]) {
iris_predraw_resolve_inputs(ice, batch, draw_aux_buffer_disabled,
stage, true);
}
}
iris_predraw_resolve_framebuffer(ice, batch, draw_aux_buffer_disabled);
@ -214,9 +215,8 @@ iris_launch_grid(struct pipe_context *ctx, const struct pipe_grid_info *grid)
/* We can't do resolves on the compute engine, so awkwardly, we have to
* do them on the render batch...
*/
iris_predraw_resolve_inputs(ice, &ice->batches[IRIS_BATCH_RENDER],
&ice->state.shaders[MESA_SHADER_COMPUTE],
NULL, false);
iris_predraw_resolve_inputs(ice, &ice->batches[IRIS_BATCH_RENDER], NULL,
MESA_SHADER_COMPUTE, false);
iris_batch_maybe_flush(batch, 1500);

View File

@ -149,12 +149,21 @@ resolve_image_views(struct iris_context *ice,
void
iris_predraw_resolve_inputs(struct iris_context *ice,
struct iris_batch *batch,
struct iris_shader_state *shs,
bool *draw_aux_buffer_disabled,
gl_shader_stage stage,
bool consider_framebuffer)
{
resolve_sampler_views(ice, batch, shs, draw_aux_buffer_disabled, consider_framebuffer);
resolve_image_views(ice, batch, shs, draw_aux_buffer_disabled, consider_framebuffer);
struct iris_shader_state *shs = &ice->state.shaders[stage];
uint64_t dirty = (IRIS_DIRTY_BINDINGS_VS << stage) |
(consider_framebuffer ? IRIS_DIRTY_BINDINGS_FS : 0);
if (ice->state.dirty & dirty) {
resolve_sampler_views(ice, batch, shs, draw_aux_buffer_disabled,
consider_framebuffer);
resolve_image_views(ice, batch, shs, draw_aux_buffer_disabled,
consider_framebuffer);
}
// XXX: ASTC hacks
}