Module: Mesa
Branch: master
Commit: 1f73e2bb942783bf143185a58d2290fda2b08c81
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1f73e2bb942783bf143185a58d2290fda2b08c81

Author: Marek Olšák <[email protected]>
Date:   Sun Jul 17 20:32:46 2016 +0200

st/mesa: unreference optional shaders when unbinding

Reviewed-by: Nicolai Hähnle <[email protected]>

---

 src/mesa/state_tracker/st_atom_shader.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/state_tracker/st_atom_shader.c 
b/src/mesa/state_tracker/st_atom_shader.c
index b3401c4..7a23469 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -217,6 +217,7 @@ update_gp( struct st_context *st )
 
    if (!st->ctx->GeometryProgram._Current) {
       cso_set_geometry_shader_handle(st->cso_context, NULL);
+      st_reference_geomprog(st, &st->gp, NULL);
       return;
    }
 
@@ -245,6 +246,7 @@ update_tcp( struct st_context *st )
 
    if (!st->ctx->TessCtrlProgram._Current) {
       cso_set_tessctrl_shader_handle(st->cso_context, NULL);
+      st_reference_tesscprog(st, &st->tcp, NULL);
       return;
    }
 
@@ -273,6 +275,7 @@ update_tep( struct st_context *st )
 
    if (!st->ctx->TessEvalProgram._Current) {
       cso_set_tesseval_shader_handle(st->cso_context, NULL);
+      st_reference_tesseprog(st, &st->tep, NULL);
       return;
    }
 
@@ -301,6 +304,7 @@ update_cp( struct st_context *st )
 
    if (!st->ctx->ComputeProgram._Current) {
       cso_set_compute_shader_handle(st->cso_context, NULL);
+      st_reference_compprog(st, &st->cp, NULL);
       return;
    }
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to