clover: Stop leaking NIR shaders
Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7068>
This commit is contained in:
parent
cc00d57a3c
commit
54eae33558
|
@ -342,12 +342,16 @@ module clover::nir::spirv_to_nir(const module &mod, const device &dev,
|
||||||
blob_init(&blob);
|
blob_init(&blob);
|
||||||
nir_serialize(&blob, nir, false);
|
nir_serialize(&blob, nir, false);
|
||||||
|
|
||||||
|
ralloc_free(nir);
|
||||||
|
|
||||||
const pipe_binary_program_header header { uint32_t(blob.size) };
|
const pipe_binary_program_header header { uint32_t(blob.size) };
|
||||||
module::section text { section_id, module::section::text_executable, header.num_bytes, {} };
|
module::section text { section_id, module::section::text_executable, header.num_bytes, {} };
|
||||||
text.data.insert(text.data.end(), reinterpret_cast<const char *>(&header),
|
text.data.insert(text.data.end(), reinterpret_cast<const char *>(&header),
|
||||||
reinterpret_cast<const char *>(&header) + sizeof(header));
|
reinterpret_cast<const char *>(&header) + sizeof(header));
|
||||||
text.data.insert(text.data.end(), blob.data, blob.data + blob.size);
|
text.data.insert(text.data.end(), blob.data, blob.data + blob.size);
|
||||||
|
|
||||||
|
free(blob.data);
|
||||||
|
|
||||||
m.syms.emplace_back(sym.name, std::string(),
|
m.syms.emplace_back(sym.name, std::string(),
|
||||||
sym.reqd_work_group_size, section_id, 0, args);
|
sym.reqd_work_group_size, section_id, 0, args);
|
||||||
m.secs.push_back(text);
|
m.secs.push_back(text);
|
||||||
|
|
Loading…
Reference in New Issue