diff options
| author | lucy96chen <47800040+lucy96chen@users.noreply.github.com> | 2022-11-29 12:35:54 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-29 12:35:54 -0800 |
| commit | d85c7b809d02e6dc0844aab07e66a6bac2462017 (patch) | |
| tree | 5b0c094e705df8b1c0a98de26e3d28514b014d80 /tools/gfx-unit-test/gfx-test-util.cpp | |
| parent | d60c925229cf911b0363bf9d5e25a6f73c6d5737 (diff) | |
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 <lucchen@nvidia.com>
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tools/gfx-unit-test/gfx-test-util.cpp')
| -rw-r--r-- | tools/gfx-unit-test/gfx-test-util.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/gfx-unit-test/gfx-test-util.cpp b/tools/gfx-unit-test/gfx-test-util.cpp index fa0745872..116b4222a 100644 --- a/tools/gfx-unit-test/gfx-test-util.cpp +++ b/tools/gfx-unit-test/gfx-test-util.cpp @@ -72,6 +72,21 @@ namespace gfx_test return SLANG_OK; } + Slang::Result loadComputeProgramFromSource( + gfx::IDevice* device, + Slang::ComPtr<gfx::IShaderProgram>& outShaderProgram, + Slang::String source) + { + Slang::ComPtr<slang::IBlob> diagnosticsBlob; + + gfx::IShaderProgram::CreateDesc2 programDesc = {}; + programDesc.sourceType = gfx::ShaderModuleSourceType::SlangSource; + programDesc.sourceData = (void*)source.getBuffer(); + programDesc.sourceDataSize = source.getLength(); + + return device->createProgram2(programDesc, outShaderProgram.writeRef(), diagnosticsBlob.writeRef()); + } + Slang::Result loadGraphicsProgram( gfx::IDevice* device, Slang::ComPtr<gfx::IShaderProgram>& outShaderProgram, |
