Skip to content
Snippets Groups Projects
Verified Commit 9c0f3c31 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#100] Fixed temporary files stacking up locally

parent 72f71946
No related branches found
No related tags found
1 merge request!82Resolve "Upscaling Module"
Pipeline #26423 passed
...@@ -61,7 +61,15 @@ namespace vkcv::upscaling { ...@@ -61,7 +61,15 @@ namespace vkcv::upscaling {
return compiler.compileSource(vkcv::ShaderStage::COMPUTE, return compiler.compileSource(vkcv::ShaderStage::COMPUTE,
FSR_PASS_GLSL_SHADER.c_str(), FSR_PASS_GLSL_SHADER.c_str(),
compiled, directory); [&directory, &compiled] (vkcv::ShaderStage shaderStage,
const std::filesystem::path& path) {
if (compiled) {
compiled(shaderStage, path);
}
std::filesystem::remove_all(directory);
}, directory
);
} }
FSRUpscaling::FSRUpscaling(Core& core) : FSRUpscaling::FSRUpscaling(Core& core) :
......
...@@ -31,7 +31,7 @@ namespace vkcv { ...@@ -31,7 +31,7 @@ namespace vkcv {
return ""; return "";
} }
#else #else
int fd = mkstemp(name); int fd = mkstemp(name); // creates a file locally
if (fd == -1) { if (fd == -1) {
vkcv_log(LogLevel::ERROR, "Temporary file path could not be generated"); vkcv_log(LogLevel::ERROR, "Temporary file path could not be generated");
...@@ -39,6 +39,7 @@ namespace vkcv { ...@@ -39,6 +39,7 @@ namespace vkcv {
} }
close(fd); close(fd);
remove(name); // removes the local file again
#endif #endif
return tmp / name; return tmp / name;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment