aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-03-05 15:09:28 -0500
committerMarek Olšák <[email protected]>2020-03-10 22:19:47 -0400
commit2dc300421d3079d653f106a876263904ba0faacc (patch)
tree5ba3065cc8ee26f18ef60234e8da96aa71d7e802 /src/gallium/state_trackers
parent1fa259b035c000b590a91a5b51412a2ff1972ab0 (diff)
gallium/cso_context: remove cso_delete_xxx_shader helpers to fix the live cache
With the live shader cache, equivalent shaders can be backed by the same CSO. This breaks the logic that identifies whether the shader being deleted is bound. For example, having shaders A and B, you can bind shader A and delete shader B. Deleting shader B will unbind shader A if they are equivalent. Pierre-Eric figured out the root cause for this issue. Fixes: 0db74f479b9 - radeonsi: use the live shader cache Closes: #2596 Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4078> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4078>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/nine/vertexshader9.c2
-rw-r--r--src/gallium/state_trackers/xa/xa_tgsi.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/nine/vertexshader9.c b/src/gallium/state_trackers/nine/vertexshader9.c
index 04c50ae619f..600e298a393 100644
--- a/src/gallium/state_trackers/nine/vertexshader9.c
+++ b/src/gallium/state_trackers/nine/vertexshader9.c
@@ -143,7 +143,7 @@ NineVertexShader9_dtor( struct NineVertexShader9 *This )
while (var_so && var_so->vdecl) {
if (var_so->cso) {
- cso_delete_vertex_shader(This->base.device->cso_sw, var_so->cso );
+ This->base.device->pipe_sw->delete_vs_state(This->base.device->pipe_sw, var_so->cso);
}
var_so = var_so->next;
}
diff --git a/src/gallium/state_trackers/xa/xa_tgsi.c b/src/gallium/state_trackers/xa/xa_tgsi.c
index caa300461cd..83f6db128c3 100644
--- a/src/gallium/state_trackers/xa/xa_tgsi.c
+++ b/src/gallium/state_trackers/xa/xa_tgsi.c
@@ -431,7 +431,7 @@ xa_shaders_create(struct xa_context *r)
}
static void
-cache_destroy(struct cso_context *cso,
+cache_destroy(struct pipe_context *pipe,
struct cso_hash *hash, unsigned processor)
{
struct cso_hash_iter iter = cso_hash_first_node(hash);
@@ -440,9 +440,9 @@ cache_destroy(struct cso_context *cso,
void *shader = (void *)cso_hash_iter_data(iter);
if (processor == PIPE_SHADER_FRAGMENT) {
- cso_delete_fragment_shader(cso, shader);
+ pipe->delete_fs_state(pipe, shader);
} else if (processor == PIPE_SHADER_VERTEX) {
- cso_delete_vertex_shader(cso, shader);
+ pipe->delete_vs_state(pipe, shader);
}
iter = cso_hash_erase(hash, iter);
}
@@ -452,8 +452,8 @@ cache_destroy(struct cso_context *cso,
void
xa_shaders_destroy(struct xa_shaders *sc)
{
- cache_destroy(sc->r->cso, &sc->vs_hash, PIPE_SHADER_VERTEX);
- cache_destroy(sc->r->cso, &sc->fs_hash, PIPE_SHADER_FRAGMENT);
+ cache_destroy(sc->r->pipe, &sc->vs_hash, PIPE_SHADER_VERTEX);
+ cache_destroy(sc->r->pipe, &sc->fs_hash, PIPE_SHADER_FRAGMENT);
FREE(sc);
}