summaryrefslogtreecommitdiff
path: root/source
AgeCommit message (Collapse)Author
2023-05-10Add slangc options for reporting downstream compile time. (#2878)Yong He
* Add slangc options for reporting downstream compile time. * Update doc. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-05-10Generate faster derivative for div by const operations. (#2877)Yong He
* Generate faster derivative for div by const operations. * Increase `kMaxIterationsToAttempt` to 256. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-05-09Various fixes for autodiff and slangpy. (#2876)Yong He
* Various fixes for autodiff and slangpy. * Fix cuda code gen for `select`. * Fix getBuildTagString(). * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-05-09Fix function side-effectness prop logic. (#2875)Yong He
2023-05-07Optimize logic around indexed temporary variables (#2873)Sai Praveen Bangaru
2023-05-06Don't store loop induction values + fix minor issue (#2872)Sai Praveen Bangaru
2023-05-05Fix checkpoint hints for higher-order autodiff (#2869)Sai Praveen Bangaru
2023-05-05Squash a couple of warnings on clang (#2870)Ellie Hermaszewska
* Squash a couple of warnings on clang Redisable -Wunused-local-typedefs * unused variable
2023-05-04Fix issue with out-of-order insts during type promotion when transposing ↵Sai Praveen Bangaru
code. (#2866) * Bugfixes for warped-area reparameterization * Update slang-ir-autodiff-transpose.h * Update slang-ir-autodiff-transpose.h * Mark all stdlib methods backward differentiable * Update diff.meta.slang --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-05-04Add SLANG_ASSUME and use it in release asserts (#2859)Ellie Hermaszewska
* Remove UNREACHABLE * formatting * Remove unused SLANG_EXPECT macros * Add SLANG_ASSUME and use it in release asserts * Reassure GCC that we are using memcpy responsibly --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-05-04Improvements around HLSLToVulkanLayout (#2867)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Improve the HLSLToVulkanLayoutOptions interface. Add more diagnostics. Add diagnostics test. * Add check for global binding using file check. * Fix issues with some tests around making some diagnostics ids unique. * Small improvements with doc/handling of vk-<>-shift option setup. --------- Co-authored-by: Yong He <yonghe@outlook.com>
2023-05-03HLSL->Vulkan binding support (#2865)jsmall-nvidia
* WIP around VK shift binding. * Refactor around options parsing. * Remove needless passing around of sink. * Some more tidying around OptionsParser. * Handle vulkan shift parsing. * Fix small issue around vk binding and "all". * Fixing some small issues. Missing break. * Split out VulkanLayoutOptions * WIP binding taking into account HLSL->Vulkan options. * First attempt at making binding work with HLSLVulkanOptions. * VulkanLayoutOptions -> HLSLToVulkanLayoutOptions * WIP with HLSL-Vulkan binding. * Some more testing around vk-shift. * Improvements around global binding. More tests. * Improve test coverage. Improve checking for requirements around default space. * Update command line options. * Small fixes. * Small fix in options reporting. * Fix warning issue. * Some fixes for isDefault for HLSLToVulkanLayoutOptions. * Update hlsl-to-vulkan-shift output. The difference was due to default handling if shift isn't specified, and not being specified was not correctly tracked.
2023-05-03Improve intellisense for attribute arguments. (#2864)Yong He
2023-05-02gfx: fix vulkan validation errors. (#2861)Yong He
* Fix VK validation errors when using vk1.2 features. * Fix vulkan validation errors. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-05-02Various dxc/fxc compatibility fixes. (#2863)Yong He
* Various dxc/fxc compatibility fixes. * Cleanup. * Fix test cases. * Fix comments. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-05-02Update slang-options.cppjsmall-nvidia
2023-05-02Markdown CommandOptions (#2860)jsmall-nvidia
* WIP CommandOptions * Fix some output issues. * Simplify word wrapping. * Add file extensions. * Change how lookup takes place. Add appendSplit functions to StringUtil. Make Categories hold the index range of their options. * Small improvement. * Lookup with partial option names. * Associate user values. * Encoding flags in the name. * Refactor setting up of command options. * Use CommandOptions in slang-options. * Remove old help text. * Cache the CommandOptions on the Session. * Range checking. Fix bug in the Options handling. * Extra checks for validity. * Get categories directly. * Slight improvements over output. * Added NameValue types. * Fix typo. Remove some now unused diagnostics. Fix diagnostic in testing, as output has changed. * Add minimal usage message. * Remove platform executable extension from diagnostics output. * Some improvements around getting names from NameValue types. * Improve some option descriptions. * Small fixes. * WIP improvements around CommandOptions. * Split out CommandOptionsWriter. * Add links to options. * Add command line options reference. * Link to the reference command line information. * Add quick links. * Improvements around lookup. Add categories to linking. * Small additional fixes. * Add LinkFlags control. * Small text fixes. * Fix typo. * Fix typo. * Fix typo. * Add support for -g and -O using CommandOptions. * Improve generated doc output/descriptions. Remove options listed directly in documentation.
2023-04-29CommandOptions (#2856)jsmall-nvidia
* WIP CommandOptions * Fix some output issues. * Simplify word wrapping. * Add file extensions. * Change how lookup takes place. Add appendSplit functions to StringUtil. Make Categories hold the index range of their options. * Small improvement. * Lookup with partial option names. * Associate user values. * Encoding flags in the name. * Refactor setting up of command options. * Use CommandOptions in slang-options. * Remove old help text. * Cache the CommandOptions on the Session. * Range checking. Fix bug in the Options handling. * Extra checks for validity. * Get categories directly. * Slight improvements over output. * Added NameValue types. * Fix typo. Remove some now unused diagnostics. Fix diagnostic in testing, as output has changed. * Add minimal usage message. * Remove platform executable extension from diagnostics output. * Some improvements around getting names from NameValue types. * Improve some option descriptions. * Small fixes.
2023-04-28SSA Register Allocation improvements. (#2857)Yong He
* SSA Register Allocation improvements. * Fix. * Rename `Use`->`UseOrPseudoUse`. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-29vkd3d and dxvk integration (#2823)Ellie Hermaszewska
* 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
2023-04-29Minor tidyings around d3d usage (#2854)Ellie Hermaszewska
* 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
2023-04-28Fix handling of `[PreferRecompute]`. (#2855)Sai Praveen Bangaru
Co-authored-by: Yong He <yhe@nvidia.com> Co-authored-by: Yong He <yonghe@outlook.com>
2023-04-28Use Index for FuncType param count (#2853)Ellie Hermaszewska
2023-04-27Embed stdlib documentation to AST. (#2851)Yong He
* Embed stdlib documentation to AST. * Extract documentation for attributes. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-27Small fixes to autodiff pass. (#2852)Yong He
* Remove obsolete assert in `extractPriamlFunc`. * Fix `findUniqueStoredVal` to ignore diff uses. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-27Prevent storing loads of global parameters. (#2850)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-26Intellisense: show info on decl kind and differentiability. (#2847)Yong He
2023-04-26Fix most of the disabled warnings on gcc/clang (#2839)Ellie Hermaszewska
2023-04-26Fix specialization dictionaries cleanup pass (#2844)Sai Praveen Bangaru
2023-04-26Autodiff support for dynamically dispatched generic method. (#2846)Yong He
* Autodiff support for dynamically dispatched generic method. * Fix. * Support dynamically dispatched generic type. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-26Add support for `kIROp_DefaultConstruct` (#2845)Sai Praveen Bangaru
2023-04-26For C-like targets, emit resource declarations before other globals (#2843)Sai Praveen Bangaru
* For C-like targets, emit resource declarations before other globals * Remove unused tests
2023-04-26Fix type legalization missing child upon recreate. (#2842)Yong He
* Fix type legliazation missing child upon recreate. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-25Support recomputing phi params in bwd prop func. (#2841)Yong He
2023-04-25StringBuilder to lowerCamel (#2840)jsmall-nvidia
* #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>
2023-04-25Cleanup checkpointing policy impl. (#2837)Yong He
* Cleanup checkpointing policy impl. * More cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-25Bump glm and stb + small neatenings (#2831)Ellie Hermaszewska
* bump glm to fix c++20 warnings * bump stb_image to fix c++20 warnings * Use static_assert for SLANG_COMPILE_TIME_ASSERT * Remove uses of deprecated is_pod * Remove bit operations between different enums
2023-04-25Dictionary using lowerCamel (#2835)jsmall-nvidia
* #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.
2023-04-24Change AD checkpointing policy to recompute more. (#2836)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-24Fix issue with Obfuscated hash (#2834)jsmall-nvidia
* #include an absolute path didn't work - because paths were taken to always be relative. * Remove legacy container writing. Test using module without source map. * Change hashing for obfuscated source map such that takes into account different line endings.
2023-04-23Add support for `kIROp_MakeExistential` (#2832)Sai Praveen Bangaru
2023-04-22Fix corner case with multi-level break elimination (#2828)Sai Praveen Bangaru
2023-04-21Add support for `kIROp_FloatCast` (#2824)Sai Praveen Bangaru
* Add support for `kIROp_FloatCast` * Update float-cast.slang * Added flag to d3d options
2023-04-21Refactor checkpointing policy and availability pass. (#2826)Yong He
Co-authored-by: Yong He <yhe@nvidia.com>
2023-04-21AD: Various fixes around dynamic dispatch (#2820)Sai Praveen Bangaru
* Add a test for the new diff material system * Various fixes for AD - inout primal context params converted to out params, - added attributed types to list of stored types - used differentiated primal func type instead of type of differentiated func to avoid tangling with user-code differential types. --------- Co-authored-by: Lifan Wu <lifanw@nvidia.com>
2023-04-21Add warning for returning without initializing out parameter (#2807)Ellie Hermaszewska
* Add warning for returning without initializing out parameter * Add unused prelude function to squash uninitialized out variable warnings
2023-04-20Improve SourceMap coverage/testing (#2818)jsmall-nvidia
* #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.
2023-04-20Improvements outputting containers (#2815)jsmall-nvidia
* #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. * WIP Api improvements around sourcemap/artifact/line-directive. * Small fix for asBoxValue * WIP outputting container with multiple artifacts. * Added ArtifactContailerUtil::filter to produce an artifact hierarchy that only contains "signficant" and "blobable" artifacts. * Make emitting IR disjoint to using a container. Added -emit-ir option. Simplfiy output. * Fix typo in options parsing. * Add a test that ouputs with an emit source map. * Enable emitting our SlangIR module if no targets are specified. * Fix issues constructing container. * Extra checks getting obfuscated source map from a translation unit. * Fix typo.
2023-04-20Changes for vkd3d proton (#2813)Ellie Hermaszewska
* 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
2023-04-19Make SourceMap a value type (#2812)jsmall-nvidia
* #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