nir: Don't replace the nir_shader when NIR_TEST_CLONE=1
authorJason Ekstrand <jason@jlekstrand.net>
Tue, 4 Jun 2019 22:48:33 +0000 (17:48 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 5 Jun 2019 20:07:28 +0000 (20:07 +0000)
commit9eba6d9a880558c89a72cbafd873d4fe1247928d
tree7dec3247f47d4bf296e04b1705f5fa18e0172180
parent747926ddfbc743b4b26ec63041c5aa49f89dfe2b
nir: Don't replace the nir_shader when NIR_TEST_CLONE=1

Instead, we add a new helper which stomps one nir_shader and replaces it
with another.  The new helper effectively just changes which pointer
gets used for the base nir_shader.  It should be 99% as good at testing
cloning but without requiring that everything handle having the shader
swapped out from under it constantly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108957
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
src/compiler/nir/nir.h
src/compiler/nir/nir_clone.c