summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAge
...
* Fix handling result codes in D3D12 resource creation calls (#2949)skallweitNV2023-06-29
| | | Co-authored-by: Yong He <yonghe@outlook.com>
* Pointer layout support (#2930)jsmall-nvidia2023-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WIP looking at reflection with pointers. * Added GetPointerLayout. * Initial test via reflection with layout of ptr type. * WIP handles ptrs to types that have layout that hasn't been completed. * Move tests to ptr. * WIP try to take into account lowering correctly between AggTypeDecl and Type, but doesn't quite work. * WIP a different path to handling recursive lowering problem with Ptr. * Fix issues with reflection output. * Small tidy. * Fix for infinite recursion issue. * Lower IRPointerTypeLayout * Working with generics. Has a hack to work around Layout around Ptr in IR. The reflection around the generic - the name isn't much use, it should probably have the generic parameters, but that would require getName to do something more sophisticated. * Fix issue around calling finishOuterGenerics to early. * Remove feature/ptr test. * Fix type legalization being an infinite loop with Ptr self referencing. * Disable the pointer self reference test because produces an infintie loop on emit. * Fixed comment based on review. * Fix for issue with emit and pointers causing infinite recursion.
* Confirm reflection output is valid JSON (#2910)jsmall-nvidia2023-05-31
| | | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * Confirm reflection output is valid JSON. * Fix issue with diagnostic tests.
* Small improvements in reflection tool (#2908)jsmall-nvidia2023-05-31
| | | | | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * Small improvements due to using StringBuilder. * Make << available. * Use streaming style.
* fixed incorrect handling of D3D12_RENDER_TARGET_VIEW_DESC.ViewDimensi… (#2897)kopaka18222023-05-23
| | | | | | | | | | * fixed incorrect handling of D3D12_RENDER_TARGET_VIEW_DESC.ViewDimension for arrays (needs to be set based on the underlying resource and not the requested view. Otherwise members like FirstArraySlice can not be set properly). Also fixes problems with D3D12_RENDER_TARGET_VIEW_DESC.PlaneSlice since Texture2DArray.PlaneSlice and Texture2D.PlaneSlice do not share the same memory location (unlike the MipSlice). * fixed isArray definition for d3d12 texture views --------- Co-authored-by: Yong He <yonghe@outlook.com>
* added D32_S8 format (#2885)kopaka18222023-05-19
| | | | | | | | | | | | | * added D32_S8 format * fixed isTypelessDepthFormat format for DXGI_FORMAT_R32G8X24_TYPELESS * added R32_FLOAT_X32_TYPELESS format to allow (depth component only) shader resource views for the D32_FLOAT_S8_UINT format. - unsure about the changed in the vk-util.cpp: No matching VK_Format? --------- Co-authored-by: Yong He <yonghe@outlook.com> Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
* MVP for higher order functions (#2849)Ellie Hermaszewska2023-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MVP for higher order functions * Add shader subgroup partitioned glsl intrinsics * Implement parsing and checking for tuple types Currently there is no way to do anything useful with them from the source language however * neaten * Correct precedence of function type parsing * neaten * higher order function tests * function types of any arity * Inference for higher order functions * Add second test for unsynchronized params * regenerate vs projects * dx11 -> dx12 for saturated cooperations tests * Disable saturated cooperation tests on vulkan They fail on release builds in CI, not essential for the higher order function work however * remove saturated-cooperation tests * Remove unnecessary assert and clarify control flow in AddDeclRefOverloadCandidates * Add Tuple type name mangling * Use functype keyword to introduce function types * Add more inference tests for hof --------- Co-authored-by: Yong He <yonghe@outlook.com>
* fixed shader resource views for multisample textures (#2880)kopaka18222023-05-11
|
* gfx: fix vulkan validation errors. (#2861)Yong He2023-05-02
| | | | | | | | | | | * Fix VK validation errors when using vk1.2 features. * Fix vulkan validation errors. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* vkd3d and dxvk integration (#2823)Ellie Hermaszewska2023-04-29
| | | | | | | | | | | | | | | | | | | | | | | | | * Add d3d sources for linux builds * Return NOT_IMPLEMENTED for shared handle support on Linux * Enable DirectX api on Linux * Do not report DX11 support without FXC * Initial version of SynchAPI emulation * Neaten dx library name handling * Neaten and use posix-synchapi * Add premake option for DirectX on Vulkan * s/SLANG_ENABLE_VKD3D_PROTON/SLANG_ENABLE_VKD3D * Skip failing tests on vkd3d * Regenerate vs projects * Silence unused var warning
* Minor tidyings around d3d usage (#2854)Ellie Hermaszewska2023-04-29
| | | | | | | | | | | | | | | | | | | | | | | * Remove unused COM annotation * Move SLANG_ENABLE_DXBC_SUPPORT to slang.h * Add DX11 simple compute test * Remove unnecessary COM parameter annotation * Run compute smoke test for DX12 * Ignore d3d11 tests when we do not have fxc * Do not try to find NVAPI on Linux * Add some logs to .gitignore * Minor cleanups in d3d12 headers * Fix tautological comparison (due to integer overflow) * Limit OutputDebugStringA to Windows
* Fix most of the disabled warnings on gcc/clang (#2839)Ellie Hermaszewska2023-04-26
|
* StringBuilder to lowerCamel (#2840)jsmall-nvidia2023-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * WIP lowerCamel Dictionary. * WIP more lowerCamel fixes for Dictionary. * Add/Remove/Clear * GetValue/Contains * Fix tabs in dictionary. Count -> getCount * Fix fields with caps. * Key -> key Value -> value Use m_ for members where appropriate. Use lowerCamel in linked list. * Some small fixes/improvements to Dictionary. * Kick CI. * Small tidy on String. * Append -> append * ToString -> toString ProduceString -> produceString * Small fixes. * StringToXXX -> stringToXXX * Fix typo introduced by Append -> append. * Made intToAscii do reversal at the end. --------- Co-authored-by: Yong He <yonghe@outlook.com>
* Dictionary using lowerCamel (#2835)jsmall-nvidia2023-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * WIP lowerCamel Dictionary. * WIP more lowerCamel fixes for Dictionary. * Add/Remove/Clear * GetValue/Contains * Fix tabs in dictionary. Count -> getCount * Fix fields with caps. * Key -> key Value -> value Use m_ for members where appropriate. Use lowerCamel in linked list. * Some small fixes/improvements to Dictionary. * Kick CI.
* Correct vulkan extension name for inline uniforms (#2822)Ellie Hermaszewska2023-04-21
| | | Fixes https://github.com/shader-slang/slang/issues/2821
* Improve SourceMap coverage/testing (#2818)jsmall-nvidia2023-04-20
| | | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * WIP around more value like behavior for SourceMap/StringPool. * Use default impls on SourceMap ctor/assignment. * Handle comparison of SourceMaps. Some small fixes. Expand unit tests.
* Changes for vkd3d proton (#2813)Ellie Hermaszewska2023-04-20
| | | | | | | | | | | | | | | | | | | | | | | | * Add some caches to .gitignore * Remove appendWideChars Use String::toWString instead * s/Sleep/sleepCurrentThread * formatting * Expand set of shared libraries which have buggy dlclose Work around https://github.com/microsoft/DirectXShaderCompiler/issues/5119 and https://github.com/doitsujin/dxvk/issues/3330 libdxcompiler.so invokes UB on dlclose, the dxvk libs break GDB when closed * Add assert for specialization failure on DX11 As a band aid for https://github.com/shader-slang/slang/issues/2805 * More fine grained selection of directx features
* Make SourceMap a value type (#2812)jsmall-nvidia2023-04-19
| | | | | | | | | | | | | | | | | | | | | | | | | * #include an absolute path didn't work - because paths were taken to always be relative. * Moved JSON source map writing logic to JSONSourceMapUtil. * Use ArtifactHandler to read/write SourceMaps. Use ObjectCastableAdapter to hold SourceMap Only serialize SourceMap <-> JSON on demand. * Make some types swappable. * BoxValue impl. * Added asBoxValue. * Remove const get funcs. * Fix typo in asBoxValue. * Fix another typo in asBoxValue. * Slightly simplify conversion to blob of SourceMap. * Small fix for asBoxValue
* Add render api category to synthesized tests (#2808)Ellie Hermaszewska2023-04-15
|
* Bugfix: compiler will run forever to eliminate dead code (#2809)winmad2023-04-14
| | | | | | | | | | | | * Add a test case that the compile will run forever * Fix. * fix. --------- Co-authored-by: Lifan Wu <lifanw@nvidia.com> Co-authored-by: Yong He <yhe@nvidia.com>
* Some small fixes with Windows/DX usage (#2797)Ellie Hermaszewska2023-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Correct case of windows.h includes * Use Slang::SharedLibrary to load directx dlls * s/max/std::max/ * Factor common OS code in calcHasApi * Add DXIL test for compute/simple * s/false/FALSE for calls to WinAPI functions * Factor common OS code in gfxGetAdapters * 2 missing headers d3d12sdklayers for ID3DDebug climits for UINT_MAX * Define out unused function on Linux * Only try to load Vulkan and CUDA on Windows or Linux * simplify D3DUtil::getDxgiModule * Remove WIN32_LEAN_AND_MEAN &co from source files Add a global define * Set WIN32_LEAN_AND_MEAN &friends in headers Restore previous state also * regenerate vs projects
* Set sharedMem argument to 0 when launching cuda kernel. (#2799)Yong He2023-04-13
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Set the executable bit on Executable artifact files (#2796)Ellie Hermaszewska2023-04-14
| | | | | * Set the executable bit on Executable artifact files * Don't zero out other permission bits in makeExecutable
* Downgrade github runner to 20.04 (#2792)Ellie Hermaszewska2023-04-12
| | | | | | | | | | | | | * 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>
* Fix for crashes around FileCheck (#2793)jsmall-nvidia2023-04-12
| | | | | | | * #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.
* WIP Hack to work around IFileCheck release (#2789)jsmall-nvidia2023-04-11
| | | | | | | | | | | | | * #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.
* Implement FileCheck tests for several test commands (#2747)Ellie Hermaszewska2023-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Artifact simplification (#2781)jsmall-nvidia2023-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * #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.
* Preliminary support for realtime clock (#2772)jsmall-nvidia2023-04-04
| | | | | | | | | | * #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.
* Squash some warnings (#2765)Ellie Hermaszewska2023-04-02
| | | Co-authored-by: Yong He <yonghe@outlook.com>
* Fix several silently failing tests (#2767)Ellie Hermaszewska2023-04-02
| | | | | | | | | | | | | | | | | | | | | | | * 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>
* Enable CUDA render api on unix (#2757)Ellie Hermaszewska2023-03-30
| | | | | | | | | | | * 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>
* Don't touch output file if content did not change. (#2738)Yong He2023-03-28
| | | Co-authored-by: Yong He <yhe@nvidia.com>
* Using SourceMap for location output (#2736)jsmall-nvidia2023-03-27
| | | | | | | | | | | * #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>
* Add PyTorch C++ binding generation. (#2734)Yong He2023-03-26
| | | | | | | | | * Add PyTorch C++ binding generation. * fix --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Add texture tri-linear autodiff example. (#2715)Yong He2023-03-21
| | | | | | | | | | | | | | | | | | | | | * 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>
* SourceMap encoding (#2706)jsmall-nvidia2023-03-16
| | | | | | | | | | | | | | | | | | | | | | * #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.
* Preliminary SourceMap support (#2701)jsmall-nvidia2023-03-16
| | | | | | | | | | | | | | | | | | | * #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.
* Take into account the optimization level requested in TargetDesc (#2649)Ellie Hermaszewska2023-02-21
| | | | | | | | | | | * 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
* Overhaul global inst deduplication and cpp/cuda backend. (#2654)Yong He2023-02-16
| | | | | | | | | * Overhaul global inst deduplication and cpp/cuda backend. * Update IR documentation. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Comment call to vkCreateInstance with a potential pitfall (#2642)Ellie Hermaszewska2023-02-11
| | | | | 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.
* Use stable sort in generation of lookup tables (#2638)Ellie Hermaszewska2023-02-09
| | | | | | | * Add Slang::List::stableSort * Use stable sort in generation of lookup tables * Disable newline translation when writing lookup tables
* GFX: make dispatch commands return error code. (#2625)Yong He2023-02-06
| | | | | | | | | * GFX: make dispatch commands return error code. * Fix cuda. --------- Co-authored-by: Yong He <yhe@nvidia.com>
* Use SPIR-V opcode names rather than numbers (#2571)Ellie Hermaszewska2023-02-03
| | | | | | | | | | | | | | | * 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
* Add ASAN support + fixes (#2614)skallweitNV2023-01-27
| | | | | | | | | | | | | | | | | * 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
* GFX report live objects (#2609)skallweitNV2023-01-25
| | | | | | | * Add utility to call D3D ReportLiveObjects * Add gfxReportLiveObjects API call * Only warn on swapchain image references
* Add vulkan extensions to support DLSS (#2603)skallweitNV2023-01-20
|
* Fix validation errors (and hang) in swapchain resize test (#2578)Ellie Hermaszewska2023-01-06
| | | | | | | * 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
* Shader cache improvements (#2564)skallweitNV2022-12-14
| | | | | | | | | | | | | | | * 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
* Refactor shader cache (#2558)skallweitNV2022-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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