iris: re-pin binding table contents if we didn't re-emit them

fixes glsl-vs-loop and other regressions from multibinder.
This commit is contained in:
Kenneth Graunke
2018-09-15 14:50:26 -07:00
parent 2963276a58
commit c0422d623c
+12 -3
View File
@@ -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);
}
}