summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2023-04-14Set the executable bit on Executable artifact files (#2796)Ellie Hermaszewska
* Set the executable bit on Executable artifact files * Don't zero out other permission bits in makeExecutable
2023-04-12Downgrade github runner to 20.04 (#2792)Ellie Hermaszewska
* Downgrade github runner to 20.04 Specify gcc10 also * Select gcc with update-alternatives * Ignore persistent cache test on linux. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-04-12Fix for crashes around FileCheck (#2793)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Fix scoping issue for filecheck lib. * Small fix for file check issue.
2023-04-11WIP Hack to work around IFileCheck release (#2789)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Upgrade to slang-llvm v13.x-38 * Hack to not release IFileCheck on windows debug. * Update to slang-llvm build with cast. * Disable IFileCheck * Disable IFileCheck.
2023-04-11Implement FileCheck tests for several test commands (#2747)Ellie Hermaszewska
* Add missing expected.txt for test * Diagnostics -> StdWriters in render test * Allow specifying several test prefixes to run `slang-test -- tests/foo tests/bar` * Squash warnings in some tests * Enable gfx debug layer in gfx test util Makes this issue present consistently: https://github.com/shader-slang/slang/issues/2766 * Allow DebugDevice to return interfaces instantiated by the debugged object * Check that we actaully have a shader cache for shader cache tests * Implement FileCheck tests for several test commands - SIMPLE, SIMPLE_EX - SIMPLE_LINE - REFLECTION, CPU_REFLECTION - CROSS_COMPILE It does not currently support the render tests or the COMPARE_COMPUTE commands It is invoked by adding `(filecheck=MY_FILECHECK_PREFIX)` to the test command, for example TEST:CROSS_COMPILE(filecheck=SPIRV): -target spirv-assembly * Move LLVM FileCheck interface to slang-llvm * Neaten slang-test tests * Refine handling of expected output in slang-test * Add example FileCheck buffer test * Add cuda-kernel-export tests Which were waiting on FileCheck * Bump vs project files * Make createLLVMFileCheck_V1 return a void* rather than specifically an IFileCheck * Remove use of CharSlice from filecheck interface * Bump slang-llvm version --------- Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
2023-04-11Artifact simplification (#2781)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP simplifying artifact interface. * Use ContainedKind. * Remove LazyCastableList. Use ContainedKind for find. * Remove ICastableList. * Remove need for ICastableList. * Remove IArtifactContainer. * Small fixes. * Small improvements around Artifact. * Make explicit find is for *representations* that can cast. Fix bug in handling casting in lookup. * Made associated items artifacts too. * Small fixes. * Small improvements around writing a container.
2023-04-04Preliminary support for realtime clock (#2772)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Initial support for realtime clock. * Add realtime-clock render feature where seems appropriate. * Fixes to make NVAPI compile properly. Change realtime-clock.slang check to use maths that can't overflow.
2023-04-02Squash some warnings (#2765)Ellie Hermaszewska
Co-authored-by: Yong He <yonghe@outlook.com>
2023-04-02Fix several silently failing tests (#2767)Ellie Hermaszewska
* Add missing expected.txt for test * Diagnostics -> StdWriters in render test * Allow specifying several test prefixes to run `slang-test -- tests/foo tests/bar` * Squash warnings in some tests * Enable gfx debug layer in gfx test util Makes this issue present consistently: https://github.com/shader-slang/slang/issues/2766 * Allow DebugDevice to return interfaces instantiated by the debugged object * Check that we actaully have a shader cache for shader cache tests --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-03-30Enable CUDA render api on unix (#2757)Ellie Hermaszewska
* Remove extra qualification in cuda device impl Only MSVC accepts this illegal code * Enable CUDA render api on unix --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-03-28Don't touch output file if content did not change. (#2738)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-27Using SourceMap for location output (#2736)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP using SourceMap with SourceManager. * Add a test to check obfuscation map is working. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-03-26Add PyTorch C++ binding generation. (#2734)Yong He
* Add PyTorch C++ binding generation. * fix --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-21Add texture tri-linear autodiff example. (#2715)Yong He
* Add quad texture example. * delete output image * remove irrelavent files * update project files * fix * Update example. * Fix. * remove out-texture --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-03-16SourceMap encoding (#2706)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP source map. * Split out handling of RttiTypeFuncs to a map type. * Make RttiTypeFuncsMap hold default impls. * Slightly more sophisticated RttiTypeFuncsMap * Source map decoding. * Fix tabs. * Fix asserts due to negative values. * Use less obscure mechanisms in SourceMap. * Source map decoding. Simplifying SourceMap usage.
2023-03-16Preliminary SourceMap support (#2701)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP source map. * Split out handling of RttiTypeFuncs to a map type. * Make RttiTypeFuncsMap hold default impls. * Slightly more sophisticated RttiTypeFuncsMap * Source map decoding. * Fix tabs. * Fix asserts due to negative values. * Use less obscure mechanisms in SourceMap.
2023-02-21Take into account the optimization level requested in TargetDesc (#2649)Ellie Hermaszewska
* Take into account the optimization level requested in TargetDesc Combines conflicting optimization levels by taking the maximum between them; as such they now each represent the lower bound on the eventual optimization level. Most of the changes are making this clear by s/optimizationLevel/minimumOptimizationLevel Closes https://github.com/shader-slang/slang/issues/2324 * Remove optimization level from TargetDesc
2023-02-16Overhaul global inst deduplication and cpp/cuda backend. (#2654)Yong He
* Overhaul global inst deduplication and cpp/cuda backend. * Update IR documentation. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-11Comment call to vkCreateInstance with a potential pitfall (#2642)Ellie Hermaszewska
Although we could in principle write this explanatory message to stderr, that would entangle this call with the layer search above for what is probably a very unlikely possibility on any normal system.
2023-02-09Use stable sort in generation of lookup tables (#2638)Ellie Hermaszewska
* Add Slang::List::stableSort * Use stable sort in generation of lookup tables * Disable newline translation when writing lookup tables
2023-02-06GFX: make dispatch commands return error code. (#2625)Yong He
* GFX: make dispatch commands return error code. * Fix cuda. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-02-03Use SPIR-V opcode names rather than numbers (#2571)Ellie Hermaszewska
* s/emititng blobal/emitting global * Use SPIR-V opcode names rather than numbers * regenerate Visual Studio project files * Use names for extended SPIR-V GLSL instructions * Add missing operand for SPIR-V extended instruction * Add warning aginst modifying generated hashing files * Squash warnings on MSVC
2023-01-27Add ASAN support + fixes (#2614)skallweitNV
* Add ASAN support to premake * Fix StringRepresentation when ASAN is enabled * Fix deep recursion in slang-generate * Fix hello-world example * Fix gpu-printing example * Linux fix * Try fixing linux * Add missing include
2023-01-25GFX report live objects (#2609)skallweitNV
* Add utility to call D3D ReportLiveObjects * Add gfxReportLiveObjects API call * Only warn on swapchain image references
2023-01-20Add vulkan extensions to support DLSS (#2603)skallweitNV
2023-01-06Fix validation errors (and hang) in swapchain resize test (#2578)Ellie Hermaszewska
* Use same format as swapchain for framebuffer in swapchain resize test * Use correct resource state for vertex buffer in swapchain resize test * Call acquireNextImage before drawing to fix validation error in swapchain resize test
2022-12-14Shader cache improvements (#2564)skallweitNV
* Make shader cache tests check the output buffer * Add shader cache eviction test * Cleanup comments * Improve TestReporter thread safety * Split lockFile test into two tests * Cleanup PersistentCache tests * Disable multi-threaded tests on aarch64
2022-12-12Refactor shader cache (#2558)skallweitNV
* Fix a bug in Path::find * Fix code formatting * Fix LockFile and add LockFileGuard * Add PersistentCache and unit test * Replace file path dependency list with source file dependency list * Add note on ordering in Module/FileDependencyList * Remove old shader cache code * Refactor shader cache implementation * Temporarily skip unit tests reading/writing files * Fix warning * Reenable lock file test * Rename shader cache tests and disable crashing test * Testing * Stop using Path::getCanonical * Fix persistent cache lock and test * Fix threading issues * Move adding file dependency hashes to getEntryPointHash() * Fix handling of #include files * Allow specifying additional search paths for gfx testing device * Work on shader cache tests * Update project files * Revive shader cache graphics tests * Split graphics pipeline test * Fix compilation
2022-12-02Cleanup crypto utilities (#2549)skallweitNV
* Consolidate crypto functions into single module * Migrate rest of code to new crypto module * Fix name conflict
2022-11-30Cleanup DigestBuilder and MD5HashGen (#2539)skallweitNV
* Cleanup DigestBuilder and MD5HashGen * Fix templates Co-authored-by: Yong He <yonghe@outlook.com>
2022-11-29FileStream-based implementation for updating cache index file (#2485)lucy96chen
* 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>
2022-11-28Add LockFile helper class (#2535)skallweitNV
* Add LockFile helper class
2022-11-16Squash warnings (#2515)Ellie Hermaszewska
* Don't use uname -p It's not portable (doesn't work on my machine) * Disable maybe-uninitialized warning on gcc Only false positives at the moment * Squash warning in miniz Allow it to use 64 bit file handing functions with gcc * Use noreturn c++11 attribute in SLANG_RETURN_NEVER * Squash uninitialized variable warnings * Squash const char/char conversion warnings Co-authored-by: Yong He <yonghe@outlook.com>
2022-11-15Specify downstream compiler include paths (#2517)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP around testing with NVAPI. * Make -I work for downstream compilers. Update docs. * Small improvement around ignoring tests.
2022-11-10Improvements to NVRTC diagnostic parsing (#2504)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Float16 support for C++/CPU based targets with f16tof32 and f32tof16. * Small correction around INF/NAN handling for f32tof16 * Small improvement to f16tof32 * Disable CUDA test for now. * Improvements to NVRTC diagnostic parsing. Handle compilerSpecificArgs. Fix issue with terminating nul ending up in diagnostic string. * Improved NVRTC error parsing. f32tof16 and f16tof32 work in principal on CUDA. * Small update to test, although they remain disabled. * Work around SLANG_E_NOT_AVAILABLE being turned into ignored, when a legitimate error is found * A more tightly constrained fallback NVRTC diagnostic parsing. * Remove CharUtil, as not neeed. Co-authored-by: Yong He <yonghe@outlook.com>
2022-11-09Fix supported shader model check in D3D12 device (#2503)skallweitNV
* Fix supported shader model check in D3D12 device * Add comment on shader model list order. Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
2022-11-07Initial version of DeviceLimits implemented in d3d12, d3d11, vulkan and cuda ↵skallweitNV
(#2496)
2022-11-04Add AdapterLUID to identify GPU adapters (#2492)skallweitNV
* Add AdapterLUID to identify GPU adapters * Remove adapter option in render-test
2022-11-03Add gfxGetAdapters function (currently implemented for D3D12/Vulkan) (#2486)skallweitNV
* Add gfxGetAdapters function (currently implemented for D3D12/Vulkan) * Extend to handle DirectX11 and CUDA * Use blob to return adapter list and add AdapterList helper * Replace strncpy with memcpy Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
2022-11-02Shader Execution Reordering (via NVAPI) (#2484)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Preliminary SER NVAPI support. * Set the DXC compiler version. Fix typo in premake5.lua * Improve DXC version detection. Enable HLSL2021 on late enough version of DXC. * Fix typo. * Fix launch. * Test via DXIL output. * Update dxc-error output.
2022-11-01Make `DifferentialPair` able to nest. (#2477)Yong He
2022-10-29Shader cache bugfixes and test additions (#2467)lucy96chen
* Preliminary graphics shader test * Added test checking that a graphics shader is correctly split into two different entries * Removed testing only addition * Changed RequirementDictionary to an OrderedDictionary and added SerialTypeInfo for OrderedDictionary; Added entry point mangled name to the dependency hash * Added test covering failure case discovered as part of Falcor integration * Changed DifferentiableTypeSemanticContext::m_mapTypeToIDifferentiableWitness to an OrderedDictionary * Added serializedAST field to Module in order to save serialized ASTs to avoid reserialization as much as possible; Added classes field to Session in order to save the output of SerialClassesUtil::create to avoid recreating as much as possible * Changed AST hashing to hash the contents of a Module's file dependencies; Renamed all references to AST hashing to contents hashing * Further cleanup * Moved contents hash computation up to Linkage::loadModule and added field to Module to save the computed contents digest * Changed PreprocessorHandler::handleFileDependency to optionally take an ISlangBlob* containing file contents and changed FrontEndPreprocessorHandler::handleFileDependency to add the source code for an included file to the module's contents digest * Removed extraneous addToDigest call * Fixed accidental removal of source code hash for module being loaded
2022-10-26Fix d3d debug layer error on setting clear value. (#2458)Yong He
2022-10-26Fix D3D12 dispatchRays() when using an empty miss and/or hitgroup table (#2468)skallweitNV
2022-10-20Cache eviction policy test refinement (#2456)lucy96chen
* Refined cache eviction test; Added check to cache file load to ensure only the maximum number of allowed entries is loaded * Fixed logic error in entry count check * Changed getCacheFile to not append the newline at the end of cache files * Refined if check
2022-10-19PersistentShaderCache integration (#2453)lucy96chen
* Shader cache index integrated into RendererBase; Added test for cache eviction policy (which currently does not pass) * Restructured main if block in getEntryPointCodeFromShaderCache; Post-rebase cleanup * undo local testing only change * Fixed issues causing shader cache tests to fail * Edited gfx.slang to reflect structural changes to IDevice::Desc and to include ShaderCacheDesc; Modified how the cache is reading in the file from disk; Added a check to the cache eviction policy test that checks for correct order of entries in the cache as well as eight total expected output files for D3D12 and Vulkan * Removed line in gfx-unit-test.cpp for local testing * Edited .gitignore to ignore all shaders automatically generated by the shader cache tests and removed the test shaders that were previously added; Review changes, most notably with an overhaul of how the cache eviction policy test handles checking order of entries * Ran premake; Removed local testing specific line (again) * Removed expected comparison files from earlier commit; Ran premake * Edited premake5.lua to also ignore the auto-generated shader files from specific shader cache tests * Fixed weird indent in premake5.lua
2022-10-17Shader cache index implementation (#2452)lucy96chen
2022-10-13Add getVersionString() to IDownstreamCompiler (#2446)lucy96chen
* checkpoint * Added shaderCachePath field to IDevice desc in gfx.slang, gfx-smoke.slang should be functional * ran premake * Added getVersionString() to IDownstreamCompiler and implemented it in DownstreamCompilerBase, GlslangDownstreamCompiler, and DXCDownstreamCompiler * Added hashInto to Val and implemented for all subtypes which contain _getHashCodeOverride implementations; nothing hooked up to caching yet * Revert erroneous commits from rebasing * Re-ran premake.bat; changed hashInto implementations to _hashIntoOverride * downstream compiler getVersionString hooked up into shader cache * Rebuild CI, Win32 Release builds successfully locally * Rebuild CI, Win32 and x64 Release build successfully locally * Reverted Val::hashInto changes, deferred for later; modified init() for downstream compilers to fetch, hash, and save the hashes of their corresponding dlls (currently implemented for glslang and dxc), changed getVersionString() to directly return the saved hash for key computation * call site changes post-merge; fixing CI build failures * Removed remaining hashInto; Updated hashToString to produce string one byte at a time * Fixed expected output to match new hashToString output order * Missed string edit in hashing related unit tests * Updated dxcapi.h; Replaced getVersionString implementation in glslang with the shared library timestamp, dxc implementation queries for IDxcVersionInfo and IDxcVersionInfo2 then fetches and returns the relevant values * Fixing CI build failures * Changed RawBlob to StringBlob for strings * Modified getVersionString for dxc to always return either the version plus commit hash or shared library timestamp
2022-10-13Make `optimalClearValue` optional in `ITextureResource::Desc` (#2450)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2022-10-12Add gfx debug layer trampoline for D3D12 interfaces. (#2445)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>