summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_shader.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-09-27 23:36:59 +0200
committerMarek Olšák <[email protected]>2015-10-20 12:51:51 +0200
commitf4e938e9aee14d42e2175c84ebe7ee32b0bcf8c5 (patch)
treeec7c46f2678848312c90bc8e12608cc633f5f493 /src/mesa/state_tracker/st_atom_shader.c
parentd74e7b6fb9dca5622c17413821d4cfcc67472e76 (diff)
st/mesa: decouple shaders from contexts if they are shareable
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_atom_shader.c')
-rw-r--r--src/mesa/state_tracker/st_atom_shader.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c
index 1e880a107c0..394145409b3 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -64,7 +64,7 @@ update_fp( struct st_context *st )
assert(stfp->Base.Base.Target == GL_FRAGMENT_PROGRAM_ARB);
memset(&key, 0, sizeof(key));
- key.st = st;
+ key.st = st->has_shareable_shaders ? NULL : st;
/* _NEW_FRAG_CLAMP */
key.clamp_color = st->clamp_frag_color_in_shader &&
@@ -119,7 +119,7 @@ update_vp( struct st_context *st )
assert(stvp->Base.Base.Target == GL_VERTEX_PROGRAM_ARB);
memset(&key, 0, sizeof key);
- key.st = st; /* variants are per-context */
+ key.st = st->has_shareable_shaders ? NULL : st;
/* When this is true, we will add an extra input to the vertex
* shader translation (for edgeflags), an extra output with
@@ -174,7 +174,7 @@ update_gp( struct st_context *st )
assert(stgp->Base.Base.Target == GL_GEOMETRY_PROGRAM_NV);
memset(&key, 0, sizeof(key));
- key.st = st;
+ key.st = st->has_shareable_shaders ? NULL : st;
st->gp_variant = st_get_gp_variant(st, stgp, &key);
@@ -210,7 +210,7 @@ update_tcp( struct st_context *st )
assert(sttcp->Base.Base.Target == GL_TESS_CONTROL_PROGRAM_NV);
memset(&key, 0, sizeof(key));
- key.st = st;
+ key.st = st->has_shareable_shaders ? NULL : st;
st->tcp_variant = st_get_tcp_variant(st, sttcp, &key);
@@ -246,7 +246,7 @@ update_tep( struct st_context *st )
assert(sttep->Base.Base.Target == GL_TESS_EVALUATION_PROGRAM_NV);
memset(&key, 0, sizeof(key));
- key.st = st;
+ key.st = st->has_shareable_shaders ? NULL : st;
st->tep_variant = st_get_tep_variant(st, sttep, &key);