From dc3b927e97888cb465c64b6b28f675ada4012303 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 11 Jul 2018 13:40:33 -0700 Subject: [PATCH] iris: bother setting program_string_id... not sure how useful this really is... ./bin/ext_transform_feedback-tessellation triangles flat_first is hitting a case where we rebind the same VS program, but with different streamout info...which isn't in the key...but is in the cache...so we don't rebuild it... --- src/gallium/drivers/iris/iris_program.c | 19 +++++++++++-------- src/gallium/drivers/iris/iris_state.c | 5 ----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index b1bfce0dd25..f4ad1fceb38 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -296,14 +296,16 @@ iris_compile_vs(struct iris_context *ice, static void iris_update_compiled_vs(struct iris_context *ice) { - struct brw_vs_prog_key key; + struct iris_uncompiled_shader *ish = + ice->shaders.uncompiled[MESA_SHADER_VERTEX]; + + struct brw_vs_prog_key key = { .program_string_id = ish->program_id }; ice->vtbl.populate_vs_key(ice, &key); if (iris_bind_cached_shader(ice, IRIS_CACHE_VS, &key)) return; - UNUSED bool success = - iris_compile_vs(ice, ice->shaders.uncompiled[MESA_SHADER_VERTEX], &key); + UNUSED bool success = iris_compile_vs(ice, ish, &key); } static void @@ -370,7 +372,7 @@ iris_update_compiled_tes(struct iris_context *ice) if (!ish) return; - struct brw_tes_prog_key key; + struct brw_tes_prog_key key = { .program_string_id = ish->program_id }; ice->vtbl.populate_tes_key(ice, &key); if (iris_bind_cached_shader(ice, IRIS_CACHE_TES, &key)) @@ -438,7 +440,7 @@ iris_update_compiled_gs(struct iris_context *ice) if (!ish) return; - struct brw_gs_prog_key key; + struct brw_gs_prog_key key = { .program_string_id = ish->program_id }; ice->vtbl.populate_gs_key(ice, &key); if (iris_bind_cached_shader(ice, IRIS_CACHE_GS, &key)) @@ -495,15 +497,16 @@ iris_compile_fs(struct iris_context *ice, static void iris_update_compiled_fs(struct iris_context *ice) { - struct brw_wm_prog_key key; + struct iris_uncompiled_shader *ish = + ice->shaders.uncompiled[MESA_SHADER_FRAGMENT]; + struct brw_wm_prog_key key = { .program_string_id = ish->program_id }; ice->vtbl.populate_fs_key(ice, &key); if (iris_bind_cached_shader(ice, IRIS_CACHE_FS, &key)) return; UNUSED bool success = - iris_compile_fs(ice, ice->shaders.uncompiled[MESA_SHADER_FRAGMENT], &key, - ice->shaders.last_vue_map); + iris_compile_fs(ice, ish, &key, ice->shaders.last_vue_map); } static struct iris_compiled_shader * diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index a0e643ea49c..b170d027324 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -2075,7 +2075,6 @@ static void iris_populate_vs_key(const struct iris_context *ice, struct brw_vs_prog_key *key) { - memset(key, 0, sizeof(*key)); iris_populate_sampler_key(ice, &key->tex); } @@ -2083,7 +2082,6 @@ static void iris_populate_tcs_key(const struct iris_context *ice, struct brw_tcs_prog_key *key) { - memset(key, 0, sizeof(*key)); iris_populate_sampler_key(ice, &key->tex); } @@ -2091,7 +2089,6 @@ static void iris_populate_tes_key(const struct iris_context *ice, struct brw_tes_prog_key *key) { - memset(key, 0, sizeof(*key)); iris_populate_sampler_key(ice, &key->tex); } @@ -2099,7 +2096,6 @@ static void iris_populate_gs_key(const struct iris_context *ice, struct brw_gs_prog_key *key) { - memset(key, 0, sizeof(*key)); iris_populate_sampler_key(ice, &key->tex); } @@ -2107,7 +2103,6 @@ static void iris_populate_fs_key(const struct iris_context *ice, struct brw_wm_prog_key *key) { - memset(key, 0, sizeof(*key)); iris_populate_sampler_key(ice, &key->tex); /* XXX: dirty flags? */ -- 2.30.2