From d85c7b809d02e6dc0844aab07e66a6bac2462017 Mon Sep 17 00:00:00 2001 From: lucy96chen <47800040+lucy96chen@users.noreply.github.com> Date: Tue, 29 Nov 2022 12:35:54 -0800 Subject: FileStream-based implementation for updating cache index file (#2485) * Draft FileStream-based implementation for updating cache file * File streams fully integrated into shader cache code paths; Tests will not run unless file system is on disk as file streams do not play nicely with in-memory * Brought old code back as fallback path, but tests need to ensure previous is freed first * Testing structure updated, beginning cleanup work * All tests working * Cleanup changes * Removed an extra tab at the end of a line * Cleanup change * Undo externals change * Removed redundant logic for OS vs memory file system handling of the shader cache; Removed extra helper function left over from old cache implementation * Reverted performance change to generate contents hashes when modules are being loaded as this code path is not always followed; Contents hashing now uses a combination of hashing and checking the last modified time for all file dependencies, only reading in and hashing the contents of all files if the last modified hash does not match * Added handling to Module::updateContentsBasedHash for file dependencies which are not from a physical source file on disk; Added test for above Co-authored-by: Lucy Chen Co-authored-by: Yong He --- source/slang/slang-preprocessor.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-preprocessor.cpp') diff --git a/source/slang/slang-preprocessor.cpp b/source/slang/slang-preprocessor.cpp index c977e44ab..fca8f5029 100644 --- a/source/slang/slang-preprocessor.cpp +++ b/source/slang/slang-preprocessor.cpp @@ -32,10 +32,9 @@ void PreprocessorHandler::handleEndOfTranslationUnit(Preprocessor* preprocessor) SLANG_UNUSED(preprocessor); } -void PreprocessorHandler::handleFileDependency(String const& path, ISlangBlob* contents) +void PreprocessorHandler::handleFileDependency(String const& path) { SLANG_UNUSED(path); - SLANG_UNUSED(contents); } // In order to simplify the naming scheme, we will nest the implementaiton of the @@ -2973,7 +2972,7 @@ static SlangResult readFile( // if( auto handler = context->m_preprocessor->handler ) { - handler->handleFileDependency(path, *outBlob); + handler->handleFileDependency(path); } return SLANG_OK; -- cgit v1.2.3