From c0422d623ce07daea34b61a6a76be0abd9572f92 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 15 Sep 2018 14:50:26 -0700 Subject: [PATCH] iris: re-pin binding table contents if we didn't re-emit them fixes glsl-vs-loop and other regressions from multibinder. --- src/gallium/drivers/iris/iris_state.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 9aea7a8f0b3..b6741a7ad84 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -3097,7 +3097,8 @@ use_ssbo(struct iris_batch *batch, struct iris_context *ice, } #define push_bt_entry(addr) \ - assert(addr >= binder_addr); bt_map[s++] = (addr) - binder_addr; + assert(addr >= binder_addr); \ + if (!pin_only) bt_map[s++] = (addr) - binder_addr; /** * Populate the binding table for a given shader stage. @@ -3109,7 +3110,8 @@ use_ssbo(struct iris_batch *batch, struct iris_context *ice, static void iris_populate_binding_table(struct iris_context *ice, struct iris_batch *batch, - gl_shader_stage stage) + gl_shader_stage stage, + bool pin_only) { const struct iris_binder *binder = &ice->state.binder; struct iris_compiled_shader *shader = ice->shaders.prog[stage]; @@ -3262,6 +3264,13 @@ iris_restore_context_saved_bos(struct iris_context *ice, } } + for (int stage = 0; stage <= MESA_SHADER_FRAGMENT; stage++) { + if (clean & (IRIS_DIRTY_BINDINGS_VS << stage)) { + /* Re-pin any buffers referred to by the binding table. */ + iris_populate_binding_table(ice, batch, stage, true); + } + } + for (int stage = 0; stage <= MESA_SHADER_FRAGMENT; stage++) { struct iris_shader_state *shs = &ice->state.shaders[stage]; struct pipe_resource *res = shs->sampler_table.res; @@ -3500,7 +3509,7 @@ iris_upload_dirty_render_state(struct iris_context *ice, for (int stage = 0; stage <= MESA_SHADER_FRAGMENT; stage++) { if (dirty & (IRIS_DIRTY_BINDINGS_VS << stage)) { - iris_populate_binding_table(ice, batch, stage); + iris_populate_binding_table(ice, batch, stage, false); } } -- 2.30.2