radv: fix a memleak for merged shaders on GFX9

modules[i] can be NULL for merged shaders but we have to
free the NIR code. radv_can_dump_shader_stats() already handles
if modules[i] is NULL, no need to check it twice.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Samuel Pitoiset
2018-07-20 18:48:07 +02:00
parent d0ee0a0a5d
commit 6e32d9e7b0

View File

@@ -2160,7 +2160,7 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
for (int i = 0; i < MESA_SHADER_STAGES; ++i) {
free(codes[i]);
if (modules[i]) {
if (nir[i]) {
if (!pipeline->device->keep_shader_info)
ralloc_free(nir[i]);