Fix memory leak with volume shaders with the workbench engine
../lib/tests/render/volume/smoke_fire.blend was leaking memory, reloading leaked more memory each time.
This commit is contained in:
parent
5126677c6f
commit
a9f0d19197
|
@ -12,6 +12,18 @@
|
|||
|
||||
namespace blender::workbench {
|
||||
|
||||
VolumePass::~VolumePass()
|
||||
{
|
||||
GPUShader **sh_p = &shaders_[0][0][0][0];
|
||||
const int n = sizeof(shaders_) / sizeof(*shaders_);
|
||||
for (int i = 0; i < n; i++, sh_p++) {
|
||||
GPUShader *sh = *sh_p;
|
||||
if (sh) {
|
||||
GPU_shader_free(sh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VolumePass::sync(SceneResources &resources)
|
||||
{
|
||||
active_ = false;
|
||||
|
|
Loading…
Reference in New Issue