etnaviv: split destroy_shader
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Mon, 12 Aug 2019 16:40:17 +0000 (18:40 +0200)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Wed, 14 Aug 2019 13:10:07 +0000 (15:10 +0200)
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Jonathan Marek <jonathan@marek.ca>
src/gallium/drivers/etnaviv/etnaviv_compiler_tgsi.c
src/gallium/drivers/etnaviv/etnaviv_shader.c

index 3b8f43c5c2bbcfba9d64deee1962dfa8b4c38ff0..97750c7bd35fcf2c409f47efc14188368224d488 100644 (file)
@@ -2535,9 +2535,6 @@ etna_dump_shader(const struct etna_shader_variant *shader)
 void
 etna_destroy_shader(struct etna_shader_variant *shader)
 {
-   if (DBG_ENABLED(ETNA_DBG_NIR))
-      return etna_destroy_shader_nir(shader);
-
    assert(shader);
 
    FREE(shader->code);
index 1f0d117eac193cdbd0a96fe3edb355cf23abc263..2a3a7569da78b37ab3129ee18ee22f5d7c4df31c 100644 (file)
@@ -417,7 +417,11 @@ etna_delete_shader_state(struct pipe_context *pctx, void *ss)
       v = v->next;
       if (t->bo)
          etna_bo_del(t->bo);
-      etna_destroy_shader(t);
+
+      if (DBG_ENABLED(ETNA_DBG_NIR))
+         etna_destroy_shader_nir(t);
+      else
+         etna_destroy_shader(t);
    }
 
    ralloc_free(shader->nir);