st/program: fix compute shader nir references
authorRob Clark <robdclark@gmail.com>
Mon, 30 Oct 2017 13:56:43 +0000 (09:56 -0400)
committerRob Clark <robdclark@gmail.com>
Sun, 12 Nov 2017 17:28:59 +0000 (12:28 -0500)
commitecbe1e976f279a3519aaf9ab365ebe28b60f1ace
treed777d9a745f64d1116f0f982d39c91abe7793c54
parent5009dc55f206567df1f1527cac06bcbf7cb95814
st/program: fix compute shader nir references

In case the IR is NIR, the driver takes reference to the nir_shader.
Also, because there are no variants, we need to clone the shader,
instead of sharing the reference with gl_program, which would result
in a double free in _mesa_delete_program().

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/state_tracker/st_glsl_to_nir.cpp
src/mesa/state_tracker/st_program.c