mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
nir/passthrough_gs: plug leak
freeing the nir shader should free the xfb info too. found with valgrind leakcheck. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Antonino Maniscalco <antonino.maniscalco@collabora.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27093>
This commit is contained in:
parent
15e7c63272
commit
3a72fc1cb7
1 changed files with 4 additions and 1 deletions
|
|
@ -21,6 +21,7 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "util/ralloc.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "nir.h"
|
||||
#include "nir_builder.h"
|
||||
|
|
@ -145,7 +146,9 @@ nir_create_passthrough_gs(const nir_shader_compiler_options *options,
|
|||
nir->info.has_transform_feedback_varyings = prev_stage->info.has_transform_feedback_varyings;
|
||||
memcpy(nir->info.xfb_stride, prev_stage->info.xfb_stride, sizeof(prev_stage->info.xfb_stride));
|
||||
if (prev_stage->xfb_info) {
|
||||
nir->xfb_info = mem_dup(prev_stage->xfb_info, nir_xfb_info_size(prev_stage->xfb_info->output_count));
|
||||
size_t size = nir_xfb_info_size(prev_stage->xfb_info->output_count);
|
||||
nir->xfb_info = ralloc_size(nir, size);
|
||||
memcpy(nir->xfb_info, prev_stage->xfb_info, size);
|
||||
}
|
||||
|
||||
bool handle_flat = output_lines && nir->info.gs.output_primitive != gs_out_prim_for_topology(primitive_type);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue