iris: bother setting program_string_id...
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 11 Jul 2018 20:40:33 +0000 (13:40 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:07 +0000 (10:26 -0800)
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
src/gallium/drivers/iris/iris_state.c

index b1bfce0dd25aca4f284c46d9138c25292cb70c19..f4ad1fceb381dab28df75dc5564a1f23f89e032d 100644 (file)
@@ -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 *
index a0e643ea49cbaecb3cddd7166ef31e765b53e4f5..b170d0273244d61e99eaa803276b94e3d2360d6b 100644 (file)
@@ -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? */