diff --git a/modules/upscaling/src/vkcv/upscaling/FSRUpscaling.cpp b/modules/upscaling/src/vkcv/upscaling/FSRUpscaling.cpp
index bf386538367edff4499f0c79ed031a72d6a8e29d..eab6fd078fc1bdc654229917a9a6c63d1f656c4d 100644
--- a/modules/upscaling/src/vkcv/upscaling/FSRUpscaling.cpp
+++ b/modules/upscaling/src/vkcv/upscaling/FSRUpscaling.cpp
@@ -61,7 +61,15 @@ namespace vkcv::upscaling {
 		
 		return compiler.compileSource(vkcv::ShaderStage::COMPUTE,
 									  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) :
diff --git a/src/vkcv/File.cpp b/src/vkcv/File.cpp
index df303afc6771600d9e277bc16057a8a1b68743b8..f4f07bd4427f211aae5954f9da98bef227c14768 100644
--- a/src/vkcv/File.cpp
+++ b/src/vkcv/File.cpp
@@ -31,7 +31,7 @@ namespace vkcv {
 			return "";
 		}
 #else
-		int fd = mkstemp(name);
+		int fd = mkstemp(name); // creates a file locally
 		
 		if (fd == -1) {
 			vkcv_log(LogLevel::ERROR, "Temporary file path could not be generated");
@@ -39,6 +39,7 @@ namespace vkcv {
 		}
 		
 		close(fd);
+		remove(name); // removes the local file again
 #endif
 		
 		return tmp / name;