https://github.com/shader-slang/slang

sort by:
Revision Author Date Message Commit Date
b8ade05 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 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 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 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 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 Allow parsing more than 10 intrinsic arguments (#3014) 25 July 2023, 08:47:41 UTC
3f64f63 Remove [__readNone] on clip. (#3016) Co-authored-by: Yong He <yhe@nvidia.com> 24 July 2023, 20:53:50 UTC
2d4cd99 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 Add support for `-fvk-invert-y`. (#3012) Co-authored-by: Yong He <yhe@nvidia.com> 21 July 2023, 22:03:42 UTC
82508d8 Add sampleCount parameter for read-only textures. (#3011) Co-authored-by: Yong He <yhe@nvidia.com> 21 July 2023, 21:37:21 UTC
b40b711 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 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
e0a856b Fix issue with loop elimination not working on certain side-effect-free loops (#3005) Co-authored-by: Yong He <yonghe@outlook.com> 20 July 2023, 22:59:51 UTC
c7c4934 Fix for vk-shift-* GLSL emit issue (#3004) * Handle different resource kinds that can appear via the vk-shift-* allowing some HLSL kinds in GLSL emit. * Determine the used kind for emit. * Added vk-shift-uniform-issue.slang * Use a better function name. Improve comments. 20 July 2023, 22:59:29 UTC
76fe0a1 Add linux arm64 self-hosted CI. (#3003) * Add linux arm64 self-hosted CI. * Update CI build script. * fix * Ignore test if FileCheck not found. --------- Co-authored-by: Yong He <yhe@nvidia.com> 20 July 2023, 19:50:21 UTC
b959836 Limit CPU cores when running MSBuild CI (#3002) Co-authored-by: Yong He <yhe@nvidia.com> 19 July 2023, 23:21:09 UTC
3509059 Add `sampleCount` parameter for MS textures. (#3001) * Add `sampleCount` parameter for MS textures. * Fix test. --------- Co-authored-by: Yong He <yhe@nvidia.com> 19 July 2023, 23:20:52 UTC
a5987aa Support for vk-shift-* without explicit bindings (#3000) * Improvements to HLSLToVulkanLayoutOptions. * WIP vk-shift-* with HLSL like binding. Detecting clashes. * Shift example seems to be working correctly. One oddness is that "used" data is now reflected, as we only enable for D3D shader resource types. Now we use those with inferred VK mode they appear. * Implicit seems to work. * Disable inference with Sampler/CombinedTextureSampler. I guess? we could just use the HLSL texture register binding to infer. * Report overlapping ranges in diagnostic. The hlsl-to-vulkan-shift-diagnostic result might be surprising but it is correct, because u is automatically laid out so consumes DescriptorSlot 0, but that's already consumed by c. * First attempt at array layout with infer on Vulkan. * Fix the vulkan shift output. * Array example. 19 July 2023, 22:35:37 UTC
1cfb1c8 Optimize specialization, and remove unnecessary calls to `simplifyIR`. (#2999) * Remove unneccessary calls to `simplifyIR`. * fix. * Delete obsolete hoistConst pass. * Fix. * Small improvements. * Fix. * Fix enum lowering. * fix * tweaks. * tweaks. --------- Co-authored-by: Yong He <yhe@nvidia.com> 19 July 2023, 20:50:49 UTC
1fe5e83 nsight Aftermath crash example (#2984) * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * Aftermath crash demo WIP. * Enable aftermath in test project. * Setting failCount. * Dumping out of source maps. * Improve comments. Simplify handling of compile products. * Other small fixes to aftermath example. * Added Emit SourceLocType. Track sourcemap association meaning. Improved documentation. * Small improvements. * Capture debug information for D3D11/D3D12/Vulkan. * Enable debug info. * Small improvements. * Improve aftermath example README.md. 18 July 2023, 22:45:38 UTC
4cb3eeb Simplify Lookup and improve compiler performance. (#2996) * Simplify lookup. * Various bug fixes. * Report type dictionary size in perf benchmark. * Remove type duplication. * increase initial dict size. * Bug fix. * Fix bugs. * Fixup. * Revert type legalization looping. * Fix specialization pass. --------- Co-authored-by: Yong He <yhe@nvidia.com> 18 July 2023, 15:08:11 UTC
138a44e Fix vk-shift-* mapping issue (#2993) * Fix vk-shift-* mappings. * Add some doc info about vk-shift. * Fix diagnostic test. 15 July 2023, 05:40:11 UTC
3e4fe2f Add section on slangpy specialization (#2991) Co-authored-by: Yong He <yonghe@outlook.com> 14 July 2023, 22:13:10 UTC
1b77881 Avoid implicit casts or device transfers. (#2992) 14 July 2023, 22:12:38 UTC
2de296c Allow setting of HLSLToVulkan options without having a target specified on the command line options. (#2989) 14 July 2023, 20:31:12 UTC
68f80f0 Robustness fixes around reverse-mode differentiation of variables & inout parameters (#2985) * Add a new test case for checking loop in the reverse mode * Create duplicate var for primal value to avoid inconsistent inputs to backward call Fixes an issue with inout parameters where the backprop call may use the post-call value of the var instead of the pre-call value. * `IRStore`s transpose to `IRLoad` and an `IRStore(0)` to clear differential. Fixes some subtle issues around transposing * Simplify test * Delete out-edited.hlsl --------- Co-authored-by: Lifan Wu <lifanw@nvidia.com> Co-authored-by: Yong He <yonghe@outlook.com> 14 July 2023, 19:47:06 UTC
2fa2c97 Run spell-check on autodiff and slangpy docs (#2990) 14 July 2023, 19:44:25 UTC
f3aba25 Pool inst worklists and hashsets to avoid rehashing. (#2982) Co-authored-by: Yong He <yhe@nvidia.com> 13 July 2023, 02:55:41 UTC
98ba936 Create and cache flattened inheritance lists (#2740) * Create and cache flattened inheritance lists The basic change here is to have a cached lookup that can map a `Type`, or a `DeclRef` that might refer to a type or `extension`, to a list of the *facets* that comprise it. The notion of a *facet* here is similar to what the C++ standard calls "sub-objects". A declared type like a `struct` has: * a facet for its own direct members * one facet for each of its (transitive) base `struct` types * one facet for each `interface` it conforms to * one facet for each `extension` that applies to that type The set of facets for a type is de-duplicated (so that "diamond" inheritance patterns don't cause issues) and deterministically ordered, using a variation of the C3 linearization algorithm. The creation of a linearized list of facets should help the compiler implementation in two key places: * Testing if a type implements an interface (or inherits from a base type) should now only take time linear in the number of (transitive) bases of that type. We can simply scan the linearized facet list to see if it contains a facet corresponding to the given base. * Looking up the members of a type (or a value of a given type) should be greatly simplified, since all of the members can be found in a single linear scan of the facet list. In addition, those facets will be ordered so that facets for "more derived" types will precede those for "less derived" types, so that shadowing in the case of overrides should be easier to implement. This change only implements the first of these two improvements, since there is already a *lot* of churn involved. Notes and caveats: * The handling of conjunction types (e.g., `IFoo & IBar`) complicates the implementation, both because the simple approach to subtype testing alluded to above is no longer complete, and also because we need to be more careful about what forms of subtype witnesses we construct, so that we can maintain the currently-required invariant that two witnesses are only equal if they have matching structure. * We don't implement the full/"proper" C3 algorithm here because it has some failure cases that we'd still like to support. In particular if we have both `IX : IA, IB` and `IY : IB, IA`, the C3 algorithm says it is illegal to have `IZ : IX, IY` because the two bases it inherits from disagree on the relative ordering of `IA` and `IB` in their own linearizations. Handling such cases may make our implementation less efficient, and it will also require testing of those corner caes. * When it comes time to revamp the implementation of lookup, we will need to deal with the fact that a single linear list (seemingly) cannot give us sufficient information to decide which of two members of the same name should shadow the other, or if there is an ambiguity. Or rather, it *can* give us that information if we are willing to accept some very user-unfriendly behavior and simply say that declarations earlier in the linearization always shadow later declarations, even if the facets involved are not related by an inheritance relationship of any kind. * In order to remove one kind of vicious circularity from the approach, the linearization that we are computing for `extension` declarations will not be sufficient for lookups in the body of such an `extension`. A future change may need to have support for creating and caching two distinct linearizations for each `extension`: one that is to be used when that `extension` is pulled into the linearization for a type that it applies to, and another for when lookup will be performed in the context of the `extension` itself. * This change does *not* include the simple expedient of adding a direct cache for subtype tests to the `SharedSemanticsContext`, although adding such a cache would be a simple matter. * This change introduces more deduplication for subtype witnesses, which should enable more deduplication for other `Val`s (including `Type`s), but it does not introduce any assumptions that equal `Val`s or `Type`s must have identical pointer representations. * Eventually we may find that, similar to the situation with `Type`s, we will want to have a split between surface-level and canonicalized versions of other `Val`s, including subtype witnesses. * Fix clang error. * remove debugging code. --------- Co-authored-by: Yong He <yonghe@outlook.com> 13 July 2023, 00:17:43 UTC
261b2f1 Use scratchData on `IRInst` to replace HashSets. (#2978) * Use scratchData on `IRInst` to replace HashSets. * Update test results. * Initialize scratchData. * Update autodiff documentation. * Use enum instead of bool. --------- Co-authored-by: Yong He <yhe@nvidia.com> 12 July 2023, 23:00:05 UTC
bbd9c2e Extend `no_diff` to support subscript operations on resources and array variables… (#2981) * Extend `no_diff` to support subscript operations on resources and array variables * Update autodiff.slang.expected 12 July 2023, 22:02:36 UTC
4ed3aaf Fix native string emit for CUDA/Cpp backend. (#2980) Co-authored-by: Yong He <yhe@nvidia.com> 12 July 2023, 21:07:10 UTC
39b7df9 Update autodiff documentation. (#2979) Co-authored-by: Yong He <yhe@nvidia.com> 12 July 2023, 20:02:57 UTC
d0901aa Add perf benchmark utility. (#2977) * Add perf benchmark utility. * Update documentation. * Fix. * Fix doc. --------- Co-authored-by: Yong He <yhe@nvidia.com> 11 July 2023, 16:29:27 UTC
d9c57e6 Add support for texture footprint queries (#2970) 11 July 2023, 00:48:51 UTC
e4d7def Fix hit object emit for HLSL + FuncType specialization bug fix. (#2976) * Fix hit object emit for HLSL. * Fix a bug involving specialization of functon type. * Add a test case. --------- Co-authored-by: Yong He <yhe@nvidia.com> 10 July 2023, 19:23:07 UTC
5569b48 Add glsl intrinsic for SampleCmpLevelZero with offset and correct existing intrinsic (#2975) * Correct glsl intrinsic for SampleCmpLevelZero without offset * Add glsl intrinsic for SampleCmpLevelZero with offset * Add test for samplecmplevelzero glsl translation --------- Co-authored-by: Yong He <yonghe@outlook.com> 10 July 2023, 19:06:40 UTC
0363a4d Do not fail when emitting GLSL using unorm/snorm textures (#2973) * Do not fail when emitting GLSL using unorm/snorm textures Ignored in glslang https://github.com/KhronosGroup/glslang/blob/main/glslang/HLSL/hlslGrammar.cpp\#L1476 * Add test for unorm modifier on glsl 10 July 2023, 19:05:15 UTC
cb9eb58 Rename Self-Hosted CI config. (#2972) * Rename Self-Hosted CI config. * change --------- Co-authored-by: Yong He <yhe@nvidia.com> 09 July 2023, 01:32:13 UTC
5e02f61 Test self-hosted runner (#2971) * Test self-hosted runner * Update config * update config * update config --------- Co-authored-by: Yong He <yhe@nvidia.com> 08 July 2023, 05:34:58 UTC
643aaa1 Make DeclRefBase a Val, and DeclRef<T> a helper class. (#2967) * Make DeclRefBase a Val, and DeclRef<T> a helper class. * Fixes. * Workaround gcc parser issue. * Revert NodeOperand change. * Fix. * Fix clang incomplete class complains. * Fix code review. * Small cleanups and improvements. --------- Co-authored-by: Yong He <yhe@nvidia.com> 07 July 2023, 21:26:37 UTC
fb6605c Do not use member function of incomplete SemanticsVisitor (#2968) Co-authored-by: jsmall-nvidia <jsmall@nvidia.com> 07 July 2023, 18:32:26 UTC
cdfea42 Fix erroneous error claiming variable is being used before its declaration (#2958) * Simplify type of diagnoseImpl * Show source line for Note diagnostics, opting out of this where appropriate * Make declared after use diagnostic clearer * Fix erroneous error claiming variable is being used before its declaration Closes https://github.com/shader-slang/slang/issues/2936 * Fix build on msvc --------- Co-authored-by: jsmall-nvidia <jsmall@nvidia.com> 06 July 2023, 19:52:00 UTC
4a88139 Add support for length for scalar floating point types. (#2965) 06 July 2023, 14:50:39 UTC
946a1b2 Work around for NonUniformResourceIndex with non integral types. (#2963) * Work around for NonUniformResourceIndex with non integral types. * Make the non integral NonUniformResourceIndex, inline early. * Add a depreciated warning. 06 July 2023, 14:21:50 UTC
b9ac4ac Assert on some resource creation in render-test-main (#2957) 06 July 2023, 07:38:12 UTC
6c7120d Bottleneck DeclRef creation through ASTBuilder. (#2689) * Bottleneck DeclRef creation through ASTBuilder. * Fix clang error. * Fix. * Fix. * More fix. * Rebase on top of tree. --------- Co-authored-by: Yong He <yhe@nvidia.com> 05 July 2023, 21:37:48 UTC
6063304 Squash some warnings (#2956) * restrict -Wno-assume to clang (gcc does not have this warning) * Add move where possible Annoyingly this warns for c++17, but will not be necessary with c++20 * Do not partially initialize struct * Remove unused variable * Silence unused var warning It is actually still referenced from an uninstantiated (for now) template * Use unused var --------- Co-authored-by: jsmall-nvidia <jsmall@nvidia.com> 05 July 2023, 19:18:14 UTC
93948b5 Disable l-value coercion for ref types (#2960) * Make lvalue coercion not work for ref, to stop problem with atomics (for GLSL output). * Improve some comments. 05 July 2023, 18:24:05 UTC
69450a2 Initial sizeof/alignof implementation. (#2954) * Initial sizeof implementation. * Small macro improvement. * Fix some typos. * Refactor NaturalSize. Add more sizeof tests. * Use _makeParseExpr to add sizeof support. * Add size-of.slang diagnostic result. * Fix typo in folding with macro change. * Add a sizeof test of This. * Some more NaturalSize coverage. * Simple alignof support. * Testing for alignof. * Added 8 bit enum to check enums values are correctly sized. * Add alignof to completion. * Lower sizeof/alignof to IR. sizeof/alignof IR pass. Tests for simple generic scenarios. * Make append handle invalid properly. Improve comments. --------- Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com> 05 July 2023, 17:23:14 UTC
f9b73ea Refactor "meta" decls for stdlib texture types (#2932) We use some ad-hoc "template engine" code generation / metaprogramming to generate many of the declarations in the Slang standard library. In many cases the level of meta-ness is (relatively) manageable, but one of the biggest tangles in the whole thing is the generation of the texture-related types. We basically have a single set of nested `for` loops that generate all types of the form: (RW|RasterizerOrdered|/**/)(Texture|Sampler)(1D|2D|...)Array?MS? Inside that loop we then have tons of conditional logic to determine: * Which points in the cross-product space should be skipped, rather than emitted as a type. * Which methods to emit, or not. * The type signature(s) of those methods. * The translation of those methods for each target (via `__target_intrinsic`) The code ends up being long, complicated, and very hard to maintain or extend. This change takes a first small step to try to help us get the complexity more under control. The basic approach is that the data that defines each point in the cross-product space is aggregated into a `TextureTypeInfo` structure in the meta-level code, and then the logic for emitting the declarations related to a given texture type is expressed as a member function of that type. The intention is that this design will more easily allow the meta-level code to be factored into distinct subroutines, and enable us to clean up and re-use recurring bits of text that need to appear in the output. It is possible (though I am not yet predicting it) that we will end up wanting to utilize a bit of an inheritance hierarchy on `TextureTypeInfo` to allow us to more cleanly factor out code that is specific to certain cases (e.g., there is only a small amount of sharing between `RW`/`RasterizerOrdered` and read-only texture types). It is intentional that this step introduces no significant changes to the logic that used to be inside the loop (and is now inside of a method). Instead, the goal is to minimize the scale of the diffs that reviewers might be expectecd to deal with in follow-on changes. Co-authored-by: Yong He <yonghe@outlook.com> 03 July 2023, 21:40:20 UTC
ae42738 Non-Recursive CFG DFS. (#2953) Co-authored-by: Yong He <yhe@nvidia.com> 30 June 2023, 21:47:17 UTC
c5b0708 Fix for operator assignment issue (#2951) * WIP handling LValue coercion via LValueImplicitCast * Need to have the ptr type for the cast. * Casting conversion working on C++. * Make the LValue casts record if in or in/out as we can produce better code if we know the difference. * WIP LValueCast pass * Fix tests so we don't fail because downstream compilers detect use of uninitialized variable. * Do conversions through through tmp for l-value scenarios that can't work other ways. * Fix a typo. * Change diagnostic implicit-cast-lvalue for a type that still exhibits the issue. * Add matrix test. * Added a bit more clarity around LValue casting choices. * Small comment improvements. Improvements based on comments on PR. * Use findOuterGeneric. 30 June 2023, 19:25:59 UTC
a3ad4dd Issue diagnostic for incorrect parameter types & directionality when defining custom derivatives (#2947) * Issue diagnostic for incorrect directionality when defining custom derivative * Better diagnostics on invalid custom derivatives * Avoid duplicating `getParameterDirection()` --------- Co-authored-by: Yong He <yonghe@outlook.com> 30 June 2023, 00:39:40 UTC
8f269e5 Apply SCCP on global scope before unrolling loops. (#2952) * Apply SCCP on global scope before unrolling loops. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> 30 June 2023, 00:38:46 UTC
47d0e8a Small fixes to GLSL-legalize and func-property prop. (#2950) Co-authored-by: Yong He <yhe@nvidia.com> 29 June 2023, 21:23:35 UTC
7f0c27a Fix handling result codes in D3D12 resource creation calls (#2949) Co-authored-by: Yong He <yonghe@outlook.com> 29 June 2023, 20:12:27 UTC
dccc909 Warn on semicolon after `if`. (#2948) * Warn on semicolon after `if`. * add test result --------- Co-authored-by: Yong He <yhe@nvidia.com> 29 June 2023, 20:11:49 UTC
b45e5aa Fix parameter block loads in GLSL emit. (#2946) * Fix parameter block loads in GLSL emit. * Revert `[NoSideEffect]` declarations in DXR1.1 API. * fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> 28 June 2023, 23:09:06 UTC
97963c5 Add support for vk::image_format attribute (#2945) 28 June 2023, 11:39:31 UTC
9ddbea3 Support for infinite literal of from 34.2432#INF (#2944) 27 June 2023, 18:28:01 UTC
1b01ff9 Pointer layout support (#2930) * 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. 27 June 2023, 15:28:14 UTC
4c9e4de Fix DCE on mutable calls in a loop. (#2943) * Fix DCE on mutable calls in a loop. * More accurate in-loop test. * code review fixes. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> 26 June 2023, 22:18:06 UTC
4eef042 Handling SV_ClipDistance system semantic on GLSL/VK (#2942) * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * WIP support for gl_ClipDistance * Working but doesn't have layout. * Check out param works with gl_ClipDistance. * Test clip distance works with out parameters. * Enable file check. * Add a test that splits clip distance writing. --------- Co-authored-by: Yong He <yonghe@outlook.com> 26 June 2023, 22:15:36 UTC
7175f64 Multiple cast issue fix (#2940) * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * WIP parens casting issue. * Fix issue with multiple casts. * Match previous location point for casting, with 'fast' path. * Removed logic to output the found decl, as not needed to construct ExplicitCastExpr. 26 June 2023, 22:11:02 UTC
49389f3 Fix typo of `i` in default initialization in docs. 23 June 2023, 18:32:20 UTC
36c02f7 Update 03-convenience-features.md 23 June 2023, 18:02:02 UTC
b3a883d Allow multiple attributes to not require separating comma (#2939) * #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. * Allow attributes without comma separation. 22 June 2023, 20:23:58 UTC
769c7fd [branch] and [flatten] support (#2928) * #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. * Add HLSL output support for [flatten] and [branch] * Handle [branch] on switch. 22 June 2023, 19:07:31 UTC
ac541d4 Avoid materializing multiple swizzle gradients (#2923) 21 June 2023, 23:18:30 UTC
79b0a2a Fix for generic with scope issue (#2925) * Small fixes and improvements around reflection tool. * Make PrettyWriter printing a class. * Sundary improvements around StringBlob. * Fix for generic scope issue. * Fix expected output. * Add scope-generic test. --------- Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com> 20 June 2023, 15:55:08 UTC
f161686 Fixes for Shader Execution Reordering on VK (#2929) * Fixes for Shader Execution Reordering on VK There are some mismatches between the way that hit objects are handled between the current NVAPI/HLSL and proposed GLSL extensions for shader execution reordering. These mismatches create complications for generating valid GLSL/SPIR-V code from input Slang. Many of the problems that apply to `HitObject` also apply to the existing `RayQuery<>` type used for "inline" ray tracing. In the case of `RayQuery<>` we have that for *both* HLSL and GLSL/SPIR-V: * A `RayQuery` (or `rayQueryEXT`) is an opaque handle to underlying mutable storage * The storage that backs a `RayQuery` is allocated as part of the "defualt constructor" for a local variable declared with type `RayQuery`. * The `RayQuery` API provides numerous operations that mutate the storage referred to by the opaque handle. The key difference between HLSL and GLSL/SPIR-V for the case of a `RayQuery` amounts to: * In HLSL, local variables of type `RayQuery` can be assigned to, and assignment has by-reference semantics. It is possible to create multiple aliased handles to the same underlying storage. * In GLSL/SPIR-V, local variables of type `rayQueryEXT` cannot be assigned to, returned from functions, etc. It is impossible to create multiple aliased handles to the same underlying storage. The case for `HitObject`s is signicantly *more* messy, because: * In NVAPI/HLSL a `HitObject` is effectively a "value type" in that it only exposes constructors, and there is no way to mutate the state of a `HitObject` other than by assignment to a variable of that type. It makes no semantic difference whether a `HitObject` directly stores the value(s), or if it is a handle, since there is no way to introduce aliasing of mutable state. Assignment of `HitObject`s semantically creates a copy. * In GLSL/SPIR-V, a `hitObjectNV` is, like a `rayQueryEXT`, a handle to underlying mutable state. These handles cannot be assigned, returned from functions, etc. There is no way to make a copy of a hit object. This change includes several changes to how *both* `RayQuery<>` and `HitObject` are implemented, with the intention of getting more cases to work correctly when compiling for GLSL/SPIR-V, and to set up a more clear mental model for the semantics we want to give to these types in Slang, and how those semantics can/should map to our targets. An overview of important changes: * Marked a few operations on `RayQuery` as `[mutating]` that realistically should have already been that way. * Marked the `HitObject` type as being non-copyable (an attribute we do not currently enforce), and marked the various GLSL operations that construct a hit object as having an `out` parameter of the `HitObject` type (even if they are nominally specified in GLSL as not writing to the correspondign parameter). * Added a distinct IR opcode (`allocateOpaqueHandle`) to represent the implicit allocation that happens when declaring a variable of type `HitObject` or `RayQuery`, and made the "implicit constructor" for those types map to the new op. This operation took a lot of tweaking to get emitting in a reasonable way, and I'm still not 100% sure that all of the emission-related logic for it is strictly required (or correct). * Added new IR instructions for `HitObject` and `RayQuery` types, and made the stdlib types map to those IR instructions. * Treat `HitObject` and `RayQuery` as resource types for the purpose of our existing pass that specializes calls to functions that have outputs of resource type * Added a new test case that includes a function that returns a `HitObject` as its result. * Many test cases saw slight changes in their output (especially around the relative ordering of declarations of `HitObject`s and `RayQuery`s with other instructions) * Remove debugging logic 13 June 2023, 21:40:02 UTC
b255ef0 Update shader-execution-reordering.md Fix comment which no longer applies. 12 June 2023, 18:55:44 UTC
d9118d2 Small improvements around StringBlob (#2924) * #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. * Sundary improvements around StringBlob. 09 June 2023, 16:38:24 UTC
3913091 Improvements around StringBlob (#2921) * #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. * Improvements around handling StringBlob and storing stdlib source in ISlangBlob. * Fix some issues with comments around StringBlob. * Default initialize StringBlob fields. 08 June 2023, 21:26:33 UTC
c492288 Attempt to fix doc generation issue (#2922) * #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. * Change the std intrinsics example, so that building docs works. 08 June 2023, 18:42:36 UTC
7726fa3 Update to DXC binaries 2023_03_01 (#2920) * #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. * Update to DXC binaries 2023_03_01 08 June 2023, 01:36:34 UTC
7561ffb AD: Fix out-of-scope indexing rules for insts in loop header blocks during the primal-inst availability pass (#2918) * add test case * Fix out-of-scope indexing rules for loop header blocks --------- Co-authored-by: Yong He <yhe@nvidia.com> Co-authored-by: Yong He <yonghe@outlook.com> 07 June 2023, 04:16:19 UTC
52f27e4 Fix some issues with stdlib intrinsics docs (#2919) * #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. * WIP documentation around stdlib intrinsics. * Preliminary docs around stdlib mechanisms. * Small fixes. * Fix some issues with stdlib intrinsics not generating. 06 June 2023, 23:20:57 UTC
07c2b21 Preliminary doc around stdlib mechanisms (#2917) * #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. * WIP documentation around stdlib intrinsics. * Preliminary docs around stdlib mechanisms. * Small fixes. 06 June 2023, 22:45:24 UTC
c3c1b56 Fix generic param inference through TypeCastIntVal. (#2916) 02 June 2023, 22:31:03 UTC
16cd361 Be lenient on same-size unsigend->signed conversion. (#2913) * Be lenient on same-size unsigend->signed conversion. * Fix tests. * Use 250. * wip * Fix. * Fix tests. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> 01 June 2023, 20:53:31 UTC
a7ed48b Fix def-use legalization in CFG normalization. (#2909) Co-authored-by: Yong He <yhe@nvidia.com> 31 May 2023, 21:34:40 UTC
02bb741 Preserve type cast during AST constant folding. (#2912) * Preserve type cast during AST constant folding. Fixes #2891. * Fix. * Fix truncating. * fix test. --------- Co-authored-by: Yong He <yhe@nvidia.com> 31 May 2023, 21:28:45 UTC
5dd401e Fix div-by-zero error during sccp. (#2911) * Diagnose on div-by-zero during sccp. * fix --------- Co-authored-by: Yong He <yhe@nvidia.com> 31 May 2023, 19:36:48 UTC
57f0ab4 Confirm reflection output is valid JSON (#2910) * #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. 31 May 2023, 19:15:36 UTC
c3e3644 Small improvements in reflection tool (#2908) * #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. 31 May 2023, 16:13:16 UTC
5c28677 Fix type checking & loop value hoisting (#2907) * Fix type checking crash in language server. * Fix loop var hoisting logic. Fixes #2903. * fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> 31 May 2023, 04:15:55 UTC
5e1974e Fix derivative signature bug in checkDerivativeAttribute. (#2905) 30 May 2023, 17:41:34 UTC
4c1396c Disallow duplicate enumerator names in the same enum (#2904) Fixes https://github.com/shader-slang/slang/issues/2895 30 May 2023, 15:29:16 UTC
ab284ca Fix bug in legalizeFuncType that leads to invalid IR. (#2902) * Fix bug in legalizeFuncType that leads to invalid IR. * Diagnose on functions that never returns when differentiate it. --------- Co-authored-by: Yong He <yhe@nvidia.com> 26 May 2023, 06:39:30 UTC
f88e129 Add API for querying total compile time. (#2898) * Add API for querying total compile time. * Optimize. * Remove redundant simplifyIR calls. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com> 23 May 2023, 22:19:27 UTC
a291dbf fixed incorrect handling of D3D12_RENDER_TARGET_VIEW_DESC.ViewDimensi… (#2897) * 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> 23 May 2023, 18:59:21 UTC
192c318 Update README.md 22 May 2023, 22:25:45 UTC
972a931 Source embedding for output (#2889) * #include an absolute path didn't work - because paths were taken to always be relative. * Fix typo. * Add options for source embedding. * Small improvements. * Working with tests. * Add check for supported language types for embedding. * Try and remove assume warning. * Fix warning on MacOSX. * Some extra checking around Style::Text. * Some small improvements to docs/handling for headers extensions. * Fix md issue. * Small fixes around zeroing partial last element. * Another small fix.... * Small improvement in hex conversion. * Add an assert for unsignedness. 22 May 2023, 21:22:22 UTC
33e1523 added D32_S8 format (#2885) * 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> 19 May 2023, 16:38:49 UTC
81451fb Add transpose logic for scalar swizzle (#2888) 19 May 2023, 02:56:44 UTC
d8ab2e8 Make `GetSequentialID` a hoistable inst. (#2887) Co-authored-by: Yong He <yhe@nvidia.com> 17 May 2023, 06:27:26 UTC
6ac0c6a Add [Differentiable(n)] syntax to specify max order. (#2883) 14 May 2023, 22:09:22 UTC
cd60642 Add finalized keywords for autodiff. (#2882) Co-authored-by: Yong He <yhe@nvidia.com> 12 May 2023, 23:15:36 UTC
back to top