019f702 | Yong He | 29 August 2023, 23:43:25 UTC | Wave intrinsics. (#3164) * Wave intrinsics. * scalar intrinsics. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 29 August 2023, 23:43:25 UTC |
f3ecf97 | Ellie Hermaszewska | 29 August 2023, 12:58:44 UTC | Correct parsing spirv with no rhs operands (#3161) * Correct parsing spirv with no rhs operands * Guard against eof | 29 August 2023, 12:58:44 UTC |
9d4e044 | Yong He | 29 August 2023, 12:55:49 UTC | Add more wave intrinsics. (#3162) Co-authored-by: Yong He <yhe@nvidia.com> | 29 August 2023, 12:55:49 UTC |
b8fcb58 | Ellie Hermaszewska | 29 August 2023, 07:31:31 UTC | clock intrinsics for spirv (#3159) | 29 August 2023, 07:31:31 UTC |
1b9c3ea | Ellie Hermaszewska | 29 August 2023, 07:31:05 UTC | Avoid empty lines when not finding a render api (#3160) | 29 August 2023, 07:31:05 UTC |
0da1e69 | jsmall-nvidia | 29 August 2023, 04:41:33 UTC | Fix cast, needs to be PtrTypeBase rather than PtrType such that InOut/Out work. (#3158) Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com> Co-authored-by: Yong He <yonghe@outlook.com> | 29 August 2023, 04:41:33 UTC |
c787c4b | Yong He | 29 August 2023, 04:24:49 UTC | Add `target_switch` and `intrinsic_asm` statement. (#3154) * Add `target_switch` and `__intrinsic_asm` statement. * Cleanup. * WaveGetActiveMask, WaveGetActiveMask, WaveCountBits. * WaveIsFirstLane. * More wave intrinsics. * wave intrinsics. * merge fix. * Fix. * Fix. * Update test. * update test. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 29 August 2023, 04:24:49 UTC |
af363c0 | Ellie Hermaszewska | 29 August 2023, 03:26:27 UTC | s/depreciated/deprecated/ (#3153) | 29 August 2023, 03:26:27 UTC |
508dc3a | Ellie Hermaszewska | 28 August 2023, 22:05:26 UTC | Allow bitwise or expressions and numeric literals in spirv_asm blocks (#3157) * Add -spirv-core-grammar option to load alternate spirv defs Also embed a version to use by default * Use perfect hash for spv op lookup * Neaten perfect hash embedding * Refactor spirv grammar lookup in preperation for more kinds of lookups * Load spirv capability list from spec * Add all SPIR-V enums to lookup table * regenerate vs projects * appease msvc * Use string slices for spir-v core grammar lookups * wiggle * comment * Add OpInfo for spv ops * regenerate vs projects * Embed op names * Add min/max operand counts and enum categories to spirv info * neaten * Operand kinds for spirv ops * Store and embed all information relating to spirv enums and qualifiers * Use SPIR-V spec to position instructions in spirv_asm blocks * Neaten spir-v info embedding * Neaten perfect hash embedding * Add assignment syntax to spirv_asm snippets * Better errors for spirv_asm parser * Add warning for too many operands in spirv asm * squash warnings * neaten * test wiggle * Lookup enums for spirv * Put OpCapability and OpExtension in the correct place for spirv_asm blocks * Tests for OpCapability and OpExtension * ci wiggle * Add expected failure * Allow raising immediate values to constant ids where necessary in spirv_asm blocks * Allow bitwise or expressions and numeric literals in spirv_asm blocks * test numeric literals * Fix memory issues. * fix. --------- Co-authored-by: Yong He <yonghe@outlook.com> | 28 August 2023, 22:05:26 UTC |
06f7ef3 | Sai Praveen Bangaru | 25 August 2023, 18:53:12 UTC | Fix various issues with trivial loops (#3149) * Fix issue with trivial loop detection * Fix issue with unreachable blocks in break elimination Add logic to avoid eliminating loops with multi-level breaks. * Incorporate feedback - Use a boolean for multi-level break check - Use dominator trees for region check instead of exhaustive enumeration - Fix potential issue with enumerating parent break blocks. * fix | 25 August 2023, 18:53:12 UTC |
ef4c9f1 | Ellie Hermaszewska | 25 August 2023, 17:42:34 UTC | Initial version of spirv_asm block (#3151) * Initial version of spirv_asm block * Correct indentation of parent instruction dumping * neater dumping for spirv_asm instructions * Add $$ DollarDollar token * Allow passing addresses to spirv_asm blocks * spirv OpUndef * String literals in spirv asm * OpName for spirv_asm ids * Correct failure in lower spirv_asm * correct position for spirv_asm idents * comment correct * several more tests for spirv_asm blocks * Fill out some unimplemented functions for spirv_asm expressions --------- Co-authored-by: Yong He <yonghe@outlook.com> | 25 August 2023, 17:42:34 UTC |
036abc8 | Yong He | 25 August 2023, 15:49:02 UTC | Support SPIRV Capability declaration on intrinsic functions. (#3150) * Spirv Capability lookup. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 25 August 2023, 15:49:02 UTC |
0470ea0 | Yong He | 24 August 2023, 23:32:33 UTC | Misc. SPIRV Fixes, Part 2. (#3147) * Misc. SPIRV Fixes, Part 2. * Fix up. * Fix. * Add system smenatic values. * 16 bit int and floats, matrix/vector reshape, bool ops. * Fix. * Fix. * Allow push constant entry point params. * entrypoint params. * swizzleSet and swizzledStore. * packoffset. * string hash. * Fix. * Matrix arithmetics. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 24 August 2023, 23:32:33 UTC |
c515bf9 | Yong He | 23 August 2023, 13:58:50 UTC | Misc. SPIRV Fixes. (#3146) * Lower all ByteAddressBuffer uses for SPIRV. * Misc. SPIRV Fixes. --------- Co-authored-by: Yong He <yhe@nvidia.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com> | 23 August 2023, 13:58:50 UTC |
6437c38 | Yong He | 23 August 2023, 12:49:33 UTC | Lower all ByteAddressBuffer uses for SPIRV. (#3143) Co-authored-by: Yong He <yhe@nvidia.com> | 23 August 2023, 12:49:33 UTC |
cdd5e66 | Ellie Hermaszewska | 23 August 2023, 09:29:25 UTC | Retain int casts when unifying generic params (#3145) | 23 August 2023, 09:29:25 UTC |
036a2b7 | Yong He | 23 August 2023, 06:21:50 UTC | Make `-fvk-u-shift` work on AppendStructuredBuffer. (#3144) Co-authored-by: Yong He <yhe@nvidia.com> | 23 August 2023, 06:21:50 UTC |
e2e10fb | Yong He | 22 August 2023, 18:07:53 UTC | Add test case for RayQuery parameter. (#3140) * Add test case for RayQuery parameter. * Update expeccted failure. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 22 August 2023, 18:07:53 UTC |
9d7c9b9 | Ellie Hermaszewska | 22 August 2023, 04:10:10 UTC | color spirv-val output (#3132) * s/invalid code/todo * comment debug disassembled spirv * more convenient spirv-val output * color spirv-val output | 22 August 2023, 04:10:10 UTC |
bd6dbaf | Yong He | 22 August 2023, 00:07:34 UTC | Compile append and consume structured buffers to glsl. (#3142) * Compile append and consume structured buffers to glsl. * Fix. * Update CI config. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 22 August 2023, 00:07:34 UTC |
f94b2f7 | Yong He | 18 August 2023, 19:48:46 UTC | Allow loop counters to be used as constexpr arguments. (#3139) * Allow loop counters to be used as constexpr arguments. * Fix. * Fix. * Fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 18 August 2023, 19:48:46 UTC |
4de3d9b | Ellie Hermaszewska | 18 August 2023, 04:39:33 UTC | Bail out of infinite timeouts in our posix synchapi emulation (#3129) This can happen if vkd3d-proton triggered a VK_DEVICE_LOST | 18 August 2023, 04:39:33 UTC |
8a292cf | Yong He | 18 August 2023, 04:39:16 UTC | SPIRV: Fix matrix layout tests. (#3137) * SPIRV: Fix matrix layout tests. * Remove spaces. * Disable debug output. * Fix. * Update expected-failure list. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 18 August 2023, 04:39:16 UTC |
80c8f13 | Ellie Hermaszewska | 17 August 2023, 21:57:57 UTC | Be more careful about merge blocks during loop inversion (#3136) * fix block eater * Be more careful about merge blocks during loop inversion * Restrict loop inversion to loops without continue jumps * Remove multiple back-edges from loops for SPIR-V * Wiggle cross compile test output * Make loop-inversion more conservative * Allow loops on false side in cfg normalization * Do not set loop continue block during inversion * Add loop inversion test to failing test list for spirv * Simplify single use continue blocks in spirv legalization * wobble expected failure list --------- Co-authored-by: Yong He <yonghe@outlook.com> | 17 August 2023, 21:57:57 UTC |
a0a9c04 | jsmall-nvidia | 17 August 2023, 20:12:51 UTC | Update README.md | 17 August 2023, 20:12:51 UTC |
efe20a3 | jsmall-nvidia | 17 August 2023, 20:12:10 UTC | Update README.md | 17 August 2023, 20:12:10 UTC |
945409c | Sai Praveen Bangaru | 17 August 2023, 18:45:13 UTC | Initial support for differentiating existential types (#3111) * Merge * WIP: Complete auto-diff logic for existential types * Revert "Add compiler option for generating representative hash" This reverts commit 13b09ef4621e73844c96d64d9c111a8ed0d45aae. * More fixes for fwd-mode AD on existential types * Add anyValueSize inference pass * Fix checking of `Differential.Differential==Differential` * In-progress: infer any-value-size for existential types * Existentials now work in forward-mode * Overhaul handling of existential AD types. Fwd-mode works, reverse-mode requires front-end changes * Reverse-mode now works on existentials * Cleanup * Remove diff rules for create existential object for now * Revert treat-as-differentiable changes * Fixes * More fixes * Cleanup * more cleanup * signed/unsigned * Revert "Cleanup" This reverts commit e4f7d71f07bb207736f90708961eeecd09a1b652. * Cleanup (again) * Remove public/export/keep-alive on null differential after AD pass * Minor fix * Update dictionary accessors * Keep export decoration * More fixes + Support for `kIROp_PackAnyValue` * Merge upstream * Update expected-failure.txt | 17 August 2023, 18:45:13 UTC |
216fc18 | Yong He | 17 August 2023, 05:47:35 UTC | Create storage types of different layouts for SPIRV emit. (#3116) * Create storage types of different layouts for SPIRV emit. * Fix. * Fix. * Fix. * Update expected failure list. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 17 August 2023, 05:47:35 UTC |
a0ee2bf | Ellie Hermaszewska | 17 August 2023, 05:41:49 UTC | Add loop inversion pass (#2899) * Generalize collectInductionValues * Support affine transformations of loop index as induction variables * Test for generalized induction value collection * Neaten inductive variable finding * Make types more specific * Add loop inversion pass * Test output changes after loop inversion * Store the type of implication success when finding inductive variables * Test that loop induction finding does not alway succeed * Support chains of additions and branches of additions in induction variable finding * Use c++17 for downstream compilers * Wiggle expected output for cross compile test after loop inversion * Add loop inversion test * Simplify IfElse instructions with a single trivial block * Invert loops with a user inserted break * Limit loop inversion to loops with a 4 instruction or less comparison block * regenerate vs projects | 17 August 2023, 05:41:49 UTC |
3e41d69 | Yong He | 17 August 2023, 02:01:39 UTC | Run vk tests on spirv backend with expected failure list. (#3128) | 17 August 2023, 02:01:39 UTC |
eaeb7cf | Ellie Hermaszewska | 16 August 2023, 19:38:49 UTC | Correct check for empty target flags (#3115) Co-authored-by: Yong He <yonghe@outlook.com> | 16 August 2023, 19:38:49 UTC |
6bdd19d | Ellie Hermaszewska | 16 August 2023, 19:38:22 UTC | Simplify IfElse instructions with a single trivial block (#3114) | 16 August 2023, 19:38:22 UTC |
00e2bf1 | Ellie Hermaszewska | 16 August 2023, 05:27:00 UTC | squash warnings (#3113) * Remove unused variables * Silence gcc out of bounds warnings * Squash strict-aliasing warnings It is still a naughty thing to be casting to T like this though * Correct equality check when val is nullptr --------- Co-authored-by: Yong He <yonghe@outlook.com> | 16 August 2023, 05:27:00 UTC |
9ec30a1 | Ellie Hermaszewska | 16 August 2023, 05:26:09 UTC | Remove -use-glsl-matrix-layout-modifier from test (#3104) Co-authored-by: Yong He <yonghe@outlook.com> | 16 August 2023, 05:26:09 UTC |
c16f711 | Yong He | 16 August 2023, 03:55:21 UTC | SPIRV: debug source and debug line. (#3109) | 16 August 2023, 03:55:21 UTC |
0c366bc | Yong He | 16 August 2023, 03:30:01 UTC | Fix a bug that warning 39001 can't be fully disabled. (#3112) Co-authored-by: Yong He <yhe@nvidia.com> | 16 August 2023, 03:30:01 UTC |
45d9961 | Ellie Hermaszewska | 16 August 2023, 00:57:47 UTC | Use ankerl/unordered_dense as a hashmap implementation (#3036) * Correct namespace for getClockFrequency * missing const * Add missing assignment operator * Remove unused variables * Return correct modified variable * Use stable hash code for file system identity * terse static_assert * Structured binding for map iteration * Make (==) and getHashCode const on many structs * Add ConstIterator for LinkedList * Replace uses of ItemProxy::getValue with Dictionary::at * Extract list of loads from gradientsMap before updating it * Const correctness in type layout * Add unordered_dense hashmap submodule * Use wyhash or getHashCode in slang-hash.h * refactor slang-hash.h * Use ankerl/unordered_dense as a hashmap implementation Notable changes: - The subscript operator returns a reference directly to the value, rather than a lazy ItemProxy (pair of dict pointer and key) slang-profile time (95% over 10 runs): - Before: 6.3913906 (±0.0746) - After: 5.9276123 (±0.0964) * 64 bit hash for strings So they have the same hash as char buffers with the same contents * Narrowing warnings for gcc to match msvc * revert back to c++17 * Correct c++ version for msvc * Use path to unordered_dense which keeps tests happy * Do not assign to and read from map in same expression * Remove redundant map operations in primal-hoist * Split out stable hash functions into slang-stable-hash.h * 64 bit hash by default * regenerate vs projects * Correct return type from HashSetBase::getCount() * correct width for call to Dictionary::reserve * Use stable hash for obfuscated module ids * Signed int for reserve * clearer variable naming * Parameterize Dictionary on hash and equality functors * Allow heterogenous lookup for Dictionary * missing const * Use set over operator[] in some places * Remove unused function * s/at/getValue | 16 August 2023, 00:57:47 UTC |
e34b005 | Yong He | 15 August 2023, 20:01:31 UTC | Fix ByteAddressBuffer array legalization. (#3106) Co-authored-by: Yong He <yhe@nvidia.com> | 15 August 2023, 20:01:31 UTC |
134f27d | Ellie Hermaszewska | 15 August 2023, 20:01:11 UTC | Disable strict aliasing for gcc (#3105) Co-authored-by: Yong He <yonghe@outlook.com> | 15 August 2023, 20:01:11 UTC |
3d75525 | Sai Praveen Bangaru | 15 August 2023, 19:24:18 UTC | Fix bug with overload resolution under nested generics (#3107) * Add test for generic param inference bug for nested generics * Change description & simplify test * Add expected file * Check parent decl before unifying type parameters | 15 August 2023, 19:24:18 UTC |
00bd481 | Ellie Hermaszewska | 15 August 2023, 12:28:42 UTC | SPIR-V WIP (#3064) * Add type layout for structured buffer * Default to generating spirv directly * vk test for compute simple * Add spirv-dis as a downstream compiler * Emit Array types in SPIR-V * makevector for spirv * Dump whole spirv module on validation failure * register array types todo, use emitTypeInst * Neater formatting for unhandled inst printing * break out emitCompositeConstruct * Correct array type generation * neaten * Allow getElement for vector * Remove unused * Allow predicating target intrinsics on types * Consider functions with intrinsics to have definitions We need to specialize these if they are predicated on types * Correct array type generation * makeArray for spir-v * replace getElement with getElementPtr for spirv * Correct translation of field access for spirv * Push layouts to types for spirv * Spirv intrinsics * operator now makes a pointer * Add structured buffer of struct test * Preserve type layout in spirv structured buffer legalization * neaten * makeVectorFromScalar for SPIRV * placeholder for layouts on param groups * More type safe spirv op construction * Know that constants and types only go in one section * Remove emitTypeInst * Add todo for spirv sampling * Add links to spirv documentation on emit functions * OpTypeImage support for SPIR-V * Add simpler texture test for spirv * s/spirv_direct/spirv/g * Allow several string literals in target_intrinsic * Handle global params without a var layour for SPIR-V For example groupshared vars * uint spirv asm type * Add todo for isDefinition It is currently too broad * Some atomic op spirv intrinsics * Strip ConstantBuffer wrappers for spirv * Add todo for matrix annotations * Do not associate decorations insts with spirv counterparts * Correct entry point parameter generation * Spelling * Assert that fieldAddress is returning a pointer * Add error for existential type layout getting to spir-v emit * Add IRTupleTypeLayout Unused so far * Allow getElementPtr to work with vectors * Correct target name in test * Hide default spirv direct behind a premake option --default-spirv-direct=true * Do not insert space at start of intrinsic def * Correct asm rendering in tests * remove redundant option * Emit directly from direct test * Add source language options for spirv-dis * Add comments to spirv dis * Add dead debug print for before spirv module * Correct asm rendering in tests * s/spirv_direct/spirv/g * Only specialize intrinsic functions with predicates * regenerate vs projects * squash warnings * squash warnings * remove duplication * Silence warnings from msvc * squash warnings * Overload for zero sized array * More msvc warnings * warnings * Add spirv-tools to path for tests * Do not be specific about dxc version for diag test * Normalize line endings from spirv-dis * Correct filecheck matches * Temporarily disable two spirv tests Failing on CI, undebuggable hang :/ * Do not emit storage class more than once for spirv snippet * Do not pass spir-v to spirv-dis by stdin * Do not get spirv-dis output via stream, use file * normalize file endings in spirv-dis output | 15 August 2023, 12:28:42 UTC |
113a257 | Sai Praveen Bangaru | 15 August 2023, 04:47:43 UTC | Add auto-diff support for `IRSwizzleStore` (#3102) * Add auto-diff support for `IRSwizzleStore` - Lower IRSwizzleStore to multiple stores during AD preprocess. - Fix typo in `transcribeNonDiffInst` * Remove unnecessary file & add more robust check for 'local' addresses * Fix. * Update slang-ir-autodiff-fwd.cpp --------- Co-authored-by: Yong He <yonghe@outlook.com> | 15 August 2023, 04:47:43 UTC |
b05b126 | Yong He | 15 August 2023, 00:58:29 UTC | Update target-deps.json (#3103) * Update target-deps.json Update glslang binaries. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 15 August 2023, 00:58:29 UTC |
661d619 | Yong He | 14 August 2023, 23:23:19 UTC | Support per field matrix layout (#3101) * Support per field matrix layout * Fix warnings. * Fix. * Fix tests. * Fix spiv gen. * Fix. * More test fixes. * Fix. * Run only GPU tests on self-hosted servers. * Remove -use-glsl-matrix-layout-modifier. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 14 August 2023, 23:23:19 UTC |
0403e05 | Sai Praveen Bangaru | 14 August 2023, 07:23:32 UTC | Fix issue with nested loop unrolling (#3100) * Do not eliminate single-iter-loops that have inner loops using their break label. * Add test * Delete out-old.hlsl * Update slang-ir-autodiff-cfg-norm.cpp * Fix whitespace | 14 August 2023, 07:23:32 UTC |
e689d5e | Yong He | 11 August 2023, 20:11:15 UTC | Make sure glsl source in spirv is included when compiling with -g3 (#3099) * Make sure glsl source in spirv is included when compiling with -g3. * Exclude vulkan tests on github linux CI. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 11 August 2023, 20:11:15 UTC |
3722316 | Yong He | 11 August 2023, 00:30:05 UTC | Add scalar version of `distance`. (#3096) | 11 August 2023, 00:30:05 UTC |
7691128 | Yong He | 10 August 2023, 23:44:06 UTC | Upgrade to glslang 12.3.1 (#3095) Co-authored-by: Yong He <yhe@nvidia.com> | 10 August 2023, 23:44:06 UTC |
756fdb4 | Yong He | 10 August 2023, 21:59:05 UTC | Fix `Texture2D.Load()` with offset. (#3094) Co-authored-by: Yong He <yhe@nvidia.com> | 10 August 2023, 21:59:05 UTC |
38b0af3 | Yong He | 10 August 2023, 21:58:41 UTC | Add support for ConstBufferPointer on Vulkan. (#3089) * Add support for `ConstBufferPointer` on Vulkan. * Add spv compilation test. * Fix. * Fix code review issues. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 10 August 2023, 21:58:41 UTC |
60ebada | Yong He | 10 August 2023, 20:19:37 UTC | Allow member lookup through modified type. (#3091) * Allow member lookup through modified type. * Disable `lockFileSync` test. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 10 August 2023, 20:19:37 UTC |
d4e72a9 | Yong He | 10 August 2023, 04:52:13 UTC | Support nested structs in function bodies. (#3078) | 10 August 2023, 04:52:13 UTC |
f875d3f | Yong He | 10 August 2023, 03:11:09 UTC | Support implciit casted swizzled lvalue. (#3077) * Support implciit casted swizzled lvalue. * Fix warnings. * Fix. * fix comment. * Prefer mangled linkage name for global params. * Update tests. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 10 August 2023, 03:11:09 UTC |
03a5bb4 | Yong He | 09 August 2023, 17:54:41 UTC | Various fixes in GLSL emit. (#3074) * Fix name mangling of modified types. * Add `InterlockedAdd(__ref uint, int)` overload. * Fix. * Fix type error in ImageStore legalization. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 09 August 2023, 17:54:41 UTC |
c4615fe | Yong He | 09 August 2023, 16:11:23 UTC | Clean up and improve Val deduplication performance. (#3069) * Clean up and improve Val deuplication performance. * Fix. * Fix. * Fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 09 August 2023, 16:11:23 UTC |
793a29a | Yong He | 08 August 2023, 20:55:39 UTC | Set Full GPU CI timeout to 100 minutes. (#3070) Co-authored-by: Yong He <yhe@nvidia.com> | 08 August 2023, 20:55:39 UTC |
ea1f165 | Yong He | 08 August 2023, 20:54:05 UTC | Support `-fvk-use-gl-layout` for ByteAddressBuffer load/store. (#3068) * Support `-fvk-use-gl-layout` for ByteAddressBuffer load/store. * Fix. * Fix. * Add test for unaligned load. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 08 August 2023, 20:54:05 UTC |
0b2d753 | Theresa Foley | 08 August 2023, 05:23:31 UTC | Add warning on mutation of function parameter (#3067) By default, function parameters in HLSL are mutable, but any changes to a parameter do not affect the values of the arguments after a call: void f(int a) { a++; // allowed, but kind of useless } ... int b = 0; f(b); // b is still zero Because the above behavior is a part of HLSL, we cannot easily diagnose such cases as errors without breaking backward compatibility with existing code. This change makes it an error to invoke a `[mutating]` method on a function parameter, which cannot affect backward compatibility since the notion of `[mutating]` methods is not present in existing HLSL code: struct Counter { int _state; [mutating] void increment() { _state++; } } void f(Counter a) { a.increment(); // ERROR } ... Counter b = { 0 }; f(b); // b is still zero The compiler will also diagnose calls to `[mutating]` methods on a field or array element extracted out of a function parameter. This change does not affect code that directly mutates a function parameter via assignment, or via passing the parameter onward as an argument to an `out` or `inout` call (or, equivalently, as the left-hand operand to a compound assignment operator). This is a breaking change to existing Slang code, since it could diagnose an error on code that used to be allowed. Indeed, two tests in the Slang test suite had to be updated to avoid such errors. It would be possible to turn this diagnostic into a warning, and simply encourage users to enable it as an error. On balance, though, it seems best to not allow this idiom since it has such a high probability to be an error. Note: the specific case that motivated this change is use of `RayQuery` values as function parameters. The root of the problem there is that dxc treats `RayQuery` values as copyable handles to mutable state, while Slang prefers to capture the mutation that occurs through marking the appropriate methods as `[mutating]`. The Slang approach makes portable codegen for D3D/Vulkan simpler, but requires that we *also* treat a type like `RayQuery` as non-copyable. This change does not address the problem that the Slang compiler does not enforce the requirement that values of non-copyable types do not get copied. Instead, the diagnostic here just happens to issue a diagnostic in one important case where a copy would typically occur. Co-authored-by: Yong He <yonghe@outlook.com> | 08 August 2023, 05:23:31 UTC |
97dccb4 | Ellie Hermaszewska | 08 August 2023, 05:23:06 UTC | Add spirv-dis as a downstream compiler (#3059) * Add spirv-dis as a downstream compiler * Add TODO for spirv-dis downstream compiler * Do not use SpirvDis by default * tabs to spaces * regenerate vs projects * correct test * correct calling convention --------- Co-authored-by: Yong He <yonghe@outlook.com> | 08 August 2023, 05:23:06 UTC |
43e0fba | Ellie Hermaszewska | 08 August 2023, 05:22:47 UTC | Default target intrinsic should not apply to SPIR-V (#3054) * Default target intrinsic should not apply to SPIR-V * CapabilitySet is a conjunction * Add TEXTUAL_SOURCE capability class | 08 August 2023, 05:22:47 UTC |
ae1c9d9 | Yong He | 07 August 2023, 22:04:34 UTC | Fix -fvk-use-entrypoint-name. (#3066) * Fix -fvk-use-entrypoint-name. * Remove irrelevant changes. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 07 August 2023, 22:04:34 UTC |
3a96240 | Ellie Hermaszewska | 07 August 2023, 22:02:53 UTC | Validate generated SPIR-V on output (#3061) * Validate generated SPIR-V * regenerate vs projects * Do not fail compiles if spirv-val is not available --------- Co-authored-by: Yong He <yonghe@outlook.com> | 07 August 2023, 22:02:53 UTC |
0e28cd0 | Ellie Hermaszewska | 07 August 2023, 22:02:29 UTC | Unify Type and Constant sections for SPIR-V (#3057) Types can depend on constants (for example fixed sized arrays) Co-authored-by: Yong He <yonghe@outlook.com> | 07 August 2023, 22:02:29 UTC |
03c6cda | Ellie Hermaszewska | 07 August 2023, 22:01:55 UTC | Casting and vector/scalar correct arithmetic ops for SPIR-V (#3056) * types for cast instructions * Information getting functions for int and float types * Implement spirv casting * Broadcast operands for SPIR-V arithmetic SPIR-V doesn't allow vector/sclar arithmetic ops * Simplify spirv int/float type generation --------- Co-authored-by: Yong He <yonghe@outlook.com> | 07 August 2023, 22:01:55 UTC |
0d803a4 | Ellie Hermaszewska | 07 August 2023, 22:01:34 UTC | Add missing header in slang-glslang (#3055) Required for memcpy (not sure why this has started being important, but it is the correct thing to do) Co-authored-by: Yong He <yonghe@outlook.com> | 07 August 2023, 22:01:34 UTC |
10b2038 | Ellie Hermaszewska | 07 August 2023, 22:01:02 UTC | Diagnostic improvements for direct spirv (#3053) * Fail on an unhandled spv operand * Diagnose on emitting a function with no definition or intrinsic * clearer error message * Add assert * Add assert * remove unused assert * Disagnostic on snippet parsing failure * Mention unimplemented instruction in error message * mention unhandled local instruction for spirv in error message * Allow specifying dump options in dumpIRToString --------- Co-authored-by: Yong He <yonghe@outlook.com> | 07 August 2023, 22:01:02 UTC |
9eb6a84 | Yong He | 07 August 2023, 22:00:38 UTC | Fix `Val` deduplication bug. (#3050) * Fix `Val` deduplication bug. * Fix * Concat stdlib files into a single module. * Remove unnecessary logic in `resolve`. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 07 August 2023, 22:00:38 UTC |
9ef9cc0 | Ellie Hermaszewska | 07 August 2023, 16:23:16 UTC | Add missing empty case to Array::makeArray (#3058) | 07 August 2023, 16:23:16 UTC |
dceb1a7 | Ellie Hermaszewska | 07 August 2023, 16:19:36 UTC | Allow parsing some SPIR-V enums in intrinsics (#3062) * Add TokenReader::AdvanceIf overlaod for TokenType * Add some spirv defs to parser * Add comment | 07 August 2023, 16:19:36 UTC |
547ea5c | Ellie Hermaszewska | 07 August 2023, 16:19:07 UTC | Simplify SpvTypeInstKey (#3063) | 07 August 2023, 16:19:07 UTC |
846286b | Ellie Hermaszewska | 07 August 2023, 16:18:44 UTC | sv_groupindex support for spirv (#3060) | 07 August 2023, 16:18:44 UTC |
550396f | Ellie Hermaszewska | 07 August 2023, 16:08:23 UTC | Fail on an unhandled spv operand (#3052) Co-authored-by: Yong He <yonghe@outlook.com> | 07 August 2023, 16:08:23 UTC |
0f57c46 | Ellie Hermaszewska | 07 August 2023, 15:38:52 UTC | Correct return type for emitFieldAddress (#3051) | 07 August 2023, 15:38:52 UTC |
856086c | Yong He | 04 August 2023, 22:55:06 UTC | Add option to use original entrypoint in spirv output. (#3047) * Add option to use original entrypoint in spirv output. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 04 August 2023, 22:55:06 UTC |
a2d90fb | Yong He | 04 August 2023, 22:47:39 UTC | Redesign `DeclRef` and systematic `Val` deduplication (#3049) * Redesign DeclRef + Deduplicate Val. * Update project files * Fix warning. * Fix. * Fix. * Remove `Val::_equalsImplOverride`. * Rmove `Val::_getHashCodeOverride`. * Remove `semanticVisitor` param from `resolve`. * Cleanups. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 04 August 2023, 22:47:39 UTC |
17da4f0 | SirKero | 04 August 2023, 17:30:33 UTC | Added D3D12 RenderTargetView TextureCube case (#3048) * Added D3D12 RenderTargetView TextureCube case * Added D3D12 DepthStencilView TextureCube case --------- Co-authored-by: jsmall-nvidia <jsmall@nvidia.com> | 04 August 2023, 17:30:33 UTC |
7734797 | jsmall-nvidia | 03 August 2023, 20:00:55 UTC | Fix around texture footprint support for NVAPI. (#3046) | 03 August 2023, 20:00:55 UTC |
aadd816 | Sai Praveen Bangaru | 03 August 2023, 18:03:51 UTC | Disable code motion for expensive insts (call & div) (#3042) * Disable code motion for expensive insts (call & div) The current redundancy removal pass does not consider control-flow within loops and as a result can sometimes move dynamic dispatch code outside their switch blocks, if they are nested in a single-iter-loop. * Update liveness.slang.expected | 03 August 2023, 18:03:51 UTC |
0dcae1c | Sai Praveen Bangaru | 03 August 2023, 03:04:21 UTC | Only define atomics for `float2` and `float4` when CUDA arch<900 (#3041) From Ada onwards, these definitions are already available in CUDA's stdlib and will cause a compiler error. | 03 August 2023, 03:04:21 UTC |
e80cd4f | Ellie Hermaszewska | 02 August 2023, 07:49:38 UTC | Add mailmap (#3043) | 02 August 2023, 07:49:38 UTC |
1653731 | jsmall-nvidia | 01 August 2023, 19:39:28 UTC | Fix literals needing cast (#3039) * Cast integer literals. * Fix expected output. * For CUDA, search global instructions to see what types are used. Improve lookup for fp16 header in CUDA. * Fix issue with f16tof32 * Small improvement around finding used base types. | 01 August 2023, 19:39:28 UTC |
edcc50c | jsmall-nvidia | 01 August 2023, 18:19:57 UTC | Update footprint-queries.md | 01 August 2023, 18:19:57 UTC |
c34a7b6 | Ellie Hermaszewska | 01 August 2023, 04:43:51 UTC | Generalize collectInductionValues (#3031) * Generalize collectInductionValues * Support affine transformations of loop index as induction variables * Test for generalized induction value collection * Neaten inductive variable finding * Store the type of implication success when finding inductive variables * Test that loop induction finding does not alway succeed * Support chains of additions and branches of additions in induction variable finding * Use c++17 for downstream compilers | 01 August 2023, 04:43:51 UTC |
5349241 | jsmall-nvidia | 31 July 2023, 19:40:29 UTC | Fix for #elif evaluation issue (#3038) * A more way robust way to handle resource consumption might use multiple `kind`s on GLSL emit. * Improve method naming and some comments. * Small consistency fix. * Fix issue with #elif evaluation. * Add a test. | 31 July 2023, 19:40:29 UTC |
8bfdc39 | Yong He | 27 July 2023, 23:58:32 UTC | Fix push constant on global variables. (#3034) Co-authored-by: Yong He <yhe@nvidia.com> | 27 July 2023, 23:58:32 UTC |
04f7244 | Yong He | 27 July 2023, 21:15:16 UTC | Fix -fvk-u-shift not applying to global constant buffer. (#3033) * Fix -fvk-u-shift not applying to global constant buffer. * Fix test. * Fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 27 July 2023, 21:15:16 UTC |
c1216ca | Yong He | 27 July 2023, 18:40:44 UTC | Include NonSemanticDebugInfo when calling glslang (#3030) Co-authored-by: Yong He <yhe@nvidia.com> | 27 July 2023, 18:40:44 UTC |
ba89fc8 | Sai Praveen Bangaru | 26 July 2023, 21:15:21 UTC | Refactor `dmul(This, Differential)` to `dmul<T:Real>(T, Differential)` (#3029) * Refactor `dmul(This, Differential)` to `dmul<T:Real>(T, Differential)` - Add AST synthesis support for generic containers - Refactor relevant tests * Merge dmul synthesis with dadd and dzero, and disambiguate using an enum * Fix trailing spaces | 26 July 2023, 21:15:21 UTC |
b8ade05 | Yong He | 26 July 2023, 19:23:53 UTC | Fix scalar swizzle causes invalid glsl output. (#3028) * Fix -fvk-u-shift not applying to RWStructuredBuffer on glsl output. * Add `transpose` to `ObjectToWorld4x3`. * Fix scalar swizzle causes invalid glsl output. Fixes #3026. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 26 July 2023, 19:23:53 UTC |
727245a | Yong He | 26 July 2023, 19:23:32 UTC | Fix -fvk-u-shift not applying to RWStructuredBuffer on glsl output. (#3027) * Fix -fvk-u-shift not applying to RWStructuredBuffer on glsl output. * Add `transpose` to `ObjectToWorld4x3`. --------- Co-authored-by: Yong He <yhe@nvidia.com> | 26 July 2023, 19:23:32 UTC |
7b48b24 | Ellie Hermaszewska | 26 July 2023, 16:34:40 UTC | Add glsl intrinsics for CalculateLevelOfDetail (#3023) Translates to textureQueryLod().x (with the Unclameped variant being returned in the .y component) Co-authored-by: Yong He <yonghe@outlook.com> | 26 July 2023, 16:34:40 UTC |
c61775e | Ellie Hermaszewska | 26 July 2023, 16:33:48 UTC | Add GatherCmp* for texture objects (#3024) The translation to GLSL is incomplete as intrinsics only exist for some combination of comparison and channel (just channel 0) Closes https://github.com/shader-slang/slang/issues/3021 | 26 July 2023, 16:33:48 UTC |
d47d549 | Yong He | 25 July 2023, 20:49:36 UTC | Add slang.natjmc. (#3018) This allows Visual Studio debugger to skip over AST visitor dispatch functions and stop directly at the `visit*` functions when stepping into a `dispatch*` call. Co-authored-by: Yong He <yhe@nvidia.com> | 25 July 2023, 20:49:36 UTC |
de3c1b2 | Ellie Hermaszewska | 25 July 2023, 08:47:41 UTC | Allow parsing more than 10 intrinsic arguments (#3014) | 25 July 2023, 08:47:41 UTC |
3f64f63 | Yong He | 24 July 2023, 20:53:50 UTC | Remove [__readNone] on clip. (#3016) Co-authored-by: Yong He <yhe@nvidia.com> | 24 July 2023, 20:53:50 UTC |
2d4cd99 | Yong He | 21 July 2023, 22:35:54 UTC | Don't error on disabled warnings when treatWarnAsErr. (#3013) Co-authored-by: Yong He <yhe@nvidia.com> | 21 July 2023, 22:35:54 UTC |
0e47844 | Yong He | 21 July 2023, 22:03:42 UTC | Add support for `-fvk-invert-y`. (#3012) Co-authored-by: Yong He <yhe@nvidia.com> | 21 July 2023, 22:03:42 UTC |
82508d8 | Yong He | 21 July 2023, 21:37:21 UTC | Add sampleCount parameter for read-only textures. (#3011) Co-authored-by: Yong He <yhe@nvidia.com> | 21 July 2023, 21:37:21 UTC |
b40b711 | Sai Praveen Bangaru | 21 July 2023, 20:28:22 UTC | Fix data-flow analysis not propagating diff property through differentiable calls (#3010) * Add test for nodiff diagnostic for non-diff call propagated through diff call * Add logic to disambiguate calls to differentiable and non-differentiable methods * Add expected results for test * Simplify test * Update slang-ir-check-differentiability.cpp * Added comments for TreatAsDifferentiableExpr flavors --------- Co-authored-by: Yong He <yonghe@outlook.com> | 21 July 2023, 20:28:22 UTC |
32043a4 | jsmall-nvidia | 21 July 2023, 20:28:01 UTC | Better handling of bindings with multiple resource kind "aliases" for GLSL emit (#3009) * A more way robust way to handle resource consumption might use multiple `kind`s on GLSL emit. * Improve method naming and some comments. * Small consistency fix. | 21 July 2023, 20:28:01 UTC |