lavapipe: Fix lvp_pipeline_compile's nir_xfb_info leak.
v2: Cleanup, as suggested by Mike Blumenkrantz. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10688>
This commit is contained in:
@@ -701,11 +701,10 @@ lvp_pipeline_compile(struct lvp_pipeline *pipeline,
|
||||
struct pipe_shader_state shstate = {0};
|
||||
fill_shader_prog(&shstate, stage, pipeline);
|
||||
|
||||
nir_xfb_info *xfb_info = NULL;
|
||||
if (stage == MESA_SHADER_VERTEX ||
|
||||
stage == MESA_SHADER_GEOMETRY ||
|
||||
stage == MESA_SHADER_TESS_EVAL) {
|
||||
xfb_info = nir_gather_xfb_info(pipeline->pipeline_nir[stage], NULL);
|
||||
nir_xfb_info *xfb_info = nir_gather_xfb_info(pipeline->pipeline_nir[stage], NULL);
|
||||
if (xfb_info) {
|
||||
uint8_t output_mapping[VARYING_SLOT_TESS_MAX];
|
||||
memset(output_mapping, 0, sizeof(output_mapping));
|
||||
@@ -731,6 +730,8 @@ lvp_pipeline_compile(struct lvp_pipeline *pipeline,
|
||||
shstate.stream_output.output[i].start_component = ffs(xfb_info->outputs[i].component_mask) - 1;
|
||||
shstate.stream_output.output[i].stream = xfb_info->buffer_to_stream[xfb_info->outputs[i].buffer];
|
||||
}
|
||||
|
||||
ralloc_free(xfb_info);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user