diff options
author | Axel Davy <[email protected]> | 2018-09-09 12:47:16 +0200 |
---|---|---|
committer | Axel Davy <[email protected]> | 2018-09-25 22:05:24 +0200 |
commit | fcbb00a50216a7b106f8957b1048bbe19b97d986 (patch) | |
tree | c048a7abfe65a9eea398929c9bb5f54adba0b77c /src/gallium/state_trackers/nine | |
parent | e83b15cba0ef2712c51ee7b5049e364853ff3707 (diff) |
st/nine: Avoid RefToBind calls in ff
When using csmt, ff shader creation happens on the csmt
thread. Creating the shaders, then calling RefToBind causes
the device ref to be increased then decreased.
However the device dtor assumes than no work pending on the
csmt thread could increase the device ref, leading to hang.
The issue is avoided by creating the shaders with a bind
count directly.
Fixes: https://github.com/iXit/Mesa-3D/issues/295
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine')
-rw-r--r-- | src/gallium/state_trackers/nine/nine_ff.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/pixelshader9.c | 6 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/vertexshader9.c | 6 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nine_ff.c index fabc1d3b882..58cc29b5e30 100644 --- a/src/gallium/state_trackers/nine/nine_ff.c +++ b/src/gallium/state_trackers/nine/nine_ff.c @@ -1698,7 +1698,6 @@ nine_ff_get_vs(struct NineDevice9 *device) (void)err; assert(err == PIPE_OK); device->ff.num_vs++; - NineUnknown_ConvertRefToBind(NineUnknown(vs)); vs->num_inputs = bld.num_inputs; for (n = 0; n < bld.num_inputs; ++n) @@ -1850,7 +1849,6 @@ nine_ff_get_ps(struct NineDevice9 *device) (void)err; assert(err == PIPE_OK); device->ff.num_ps++; - NineUnknown_ConvertRefToBind(NineUnknown(ps)); ps->rt_mask = 0x1; ps->sampler_mask = sampler_mask; diff --git a/src/gallium/state_trackers/nine/pixelshader9.c b/src/gallium/state_trackers/nine/pixelshader9.c index bfc395cdf55..6f053f709bf 100644 --- a/src/gallium/state_trackers/nine/pixelshader9.c +++ b/src/gallium/state_trackers/nine/pixelshader9.c @@ -203,5 +203,9 @@ NinePixelShader9_new( struct NineDevice9 *pDevice, struct NinePixelShader9 **ppOut, const DWORD *pFunction, void *cso ) { - NINE_DEVICE_CHILD_NEW(PixelShader9, ppOut, pDevice, pFunction, cso); + if (cso) { /* ff shader. Needs to start with bind count */ + NINE_DEVICE_CHILD_BIND_NEW(PixelShader9, ppOut, pDevice, pFunction, cso); + } else { + NINE_DEVICE_CHILD_NEW(PixelShader9, ppOut, pDevice, pFunction, cso); + } } diff --git a/src/gallium/state_trackers/nine/vertexshader9.c b/src/gallium/state_trackers/nine/vertexshader9.c index a4228af157e..f104a9ad134 100644 --- a/src/gallium/state_trackers/nine/vertexshader9.c +++ b/src/gallium/state_trackers/nine/vertexshader9.c @@ -262,5 +262,9 @@ NineVertexShader9_new( struct NineDevice9 *pDevice, struct NineVertexShader9 **ppOut, const DWORD *pFunction, void *cso ) { - NINE_DEVICE_CHILD_NEW(VertexShader9, ppOut, pDevice, pFunction, cso); + if (cso) { + NINE_DEVICE_CHILD_BIND_NEW(VertexShader9, ppOut, pDevice, pFunction, cso); + } else { + NINE_DEVICE_CHILD_NEW(VertexShader9, ppOut, pDevice, pFunction, cso); + } } |