From 1facdc0ab6441898a7ca20aafe8b3fbacafab8ca Mon Sep 17 00:00:00 2001 From: iaomw Date: Mon, 17 Jun 2024 20:33:09 +0800 Subject: [PATCH] cleanup textures --- zenovis/xinxinoptix/optixPathTracer.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/zenovis/xinxinoptix/optixPathTracer.cpp b/zenovis/xinxinoptix/optixPathTracer.cpp index aa7467b97f..04354801e4 100644 --- a/zenovis/xinxinoptix/optixPathTracer.cpp +++ b/zenovis/xinxinoptix/optixPathTracer.cpp @@ -3977,11 +3977,12 @@ void optixCleanup() { state.params.sky_strength = 1.0f; state.params.sky_texture; - auto sky_path = OptixUtil::default_sky_tex; - auto sky_tex = OptixUtil::g_tex[sky_path]; - - OptixUtil::g_tex = { {sky_path, sky_tex} }; - //OptixUtil::g_tex.at(sky_path) = sky_tex; + for (auto& [k, v] : OptixUtil::g_tex) { + if (k != OptixUtil::default_sky_tex) { + OptixUtil::removeTexture(k); + } + } + OptixUtil::sky_tex = OptixUtil::default_sky_tex; }