https://github.com/shader-slang/slang
- HEAD
- refs/heads/csyonghe-patch-1
- refs/heads/glsl-intrinsic-functional-test
- refs/heads/master
- refs/heads/release-debug
- refs/heads/swoods-nv-patch-1
- refs/tags/''
- refs/tags/v''
- refs/tags/v0.12.19
- refs/tags/v0.12.26
- refs/tags/v0.12.27
- refs/tags/v0.12.28
- refs/tags/v0.12.29
- refs/tags/v0.13.4
- refs/tags/v0.13.5
- refs/tags/v0.13.6
- refs/tags/v0.13.6.1
- refs/tags/v0.24.39
- refs/tags/v0.24.40
- refs/tags/v0.24.41
- refs/tags/v0.24.42
- refs/tags/v0.24.48
- refs/tags/v0.24.49
- refs/tags/v0.24.50
- refs/tags/v0.24.52
- refs/tags/v0.8.3
- refs/tags/v0.8.4
- refs/tags/v0.8.5
- refs/tags/v0.8.5-rc
- refs/tags/v0.8.6
- refs/tags/v0.8.6-rc
- refs/tags/v0.8.7
- refs/tags/v0.8.8
- refs/tags/v2023.5.5
- refs/tags/v2024.1.10
- refs/tags/v2024.1.11
- refs/tags/v2024.1.13
- refs/tags/v2024.1.15
- refs/tags/v2024.1.16
- refs/tags/v2024.1.19
- refs/tags/v2024.1.27
- refs/tags/v2024.1.28
- refs/tags/v2024.1.29
- refs/tags/v2024.1.30
- refs/tags/v2024.1.7
- refs/tags/v2024.1.9
- refs/tags/v2024.10.1-draft
- refs/tags/v2024.9
- refs/tags/v2024.9.1
- v0.18.22
- v2024.9.2
- v2024.10
- v2024.1.8
- v2024.1.6
- v2024.1.5
- v2024.1.4
- v2024.1.34
- v2024.1.33
- v2024.1.32
- v2024.1.31
- v2024.1.3
- v2024.1.26
- v2024.1.25
- v2024.1.24
- v2024.1.23
- v2024.1.22
- v2024.1.21.1
- v2024.1.21
- v2024.1.20
- v2024.1.2
- v2024.1.18
- v2024.1.17
- v2024.1.14
- v2024.1.12
- v2024.1.1
- v2024.1.0
- v2024.0.9
- v2024.0.8
- v2024.0.7
- v2024.0.6
- v2024.0.5
- v2024.0.4
- v2024.0.3
- v2024.0.2
- v2024.0.15
- v2024.0.14
- v2024.0.13
- v2024.0.12
- v2024.0.11
- v2024.0.10
- v2024.0.1
- v2024.0.0
- v2023.5.8
- v2023.5.7
- v2023.5.6
- v2023.5.4
- v2023.5.3
- v2023.5.2
- v2023.5.1
- v2023.5.0
- v2023.4.9
- v2023.4.8
- v2023.4.7
- v2023.4.6
- v2023.4.5
- v2023.4.4
- v2023.4.3
- v2023.4.2
- v2023.4.10
- v2023.4.1
- v2023.4.0
- v2023.3.9
- v2023.3.8
- v2023.3.7
- v2023.3.6
- v2023.3.5
- v2023.3.4
- v2023.3.3
- v2023.3.20
- v2023.3.2
- v2023.3.19
- v2023.3.18
- v2023.3.17
- v2023.3.16
- v2023.3.15
- v2023.3.14
- v2023.3.13
- v2023.3.12
- v2023.3.11
- v2023.3.10
- v2023.3.1
- v2023.3.0
- v2023.2.1
- v2023.2.0
- v2023.1.1
- v2023.1.0
- v2023.0.6
- v2023.0.5
- v2023.0.4
- v2023.0.3
- v2023.0.2
- v2023.0.1
- v2023.0.0
- v0.9.9
- v0.9.8
- v0.9.7
- v0.9.6
- v0.9.5
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.15
- v0.9.14
- v0.9.13
- v0.9.12
- v0.9.11
- v0.9.10
- v0.9.1
- v0.9.0
- v0.8.9
- v0.8.2
- v0.8.13
- v0.8.12
- v0.8.11
- v0.8.10
- v0.8.1
- v0.8.0
- v0.7.9
- v0.7.8
- v0.7.7
- v0.7.6
- v0.7.5
- v0.7.4
- v0.7.3
- v0.7.2
- v0.7.10
- v0.7.1
- v0.7.0
- v0.6.9
- v0.6.8
- v0.6.7
- v0.6.6
- v0.6.5
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.6
- v0.5.5
- v0.5.4
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.2
- v0.3.1
- v0.3.0
- v0.28.3
- v0.28.2
- v0.28.1
- v0.28.0
- v0.27.9
- v0.27.8
- v0.27.7
- v0.27.6
- v0.27.5
- v0.27.4
- v0.27.3
- v0.27.21
- v0.27.20
- v0.27.2
- v0.27.19
- v0.27.18
- v0.27.17
- v0.27.16
- v0.27.15
- v0.27.14
- v0.27.13
- v0.27.12
- v0.27.11
- v0.27.10
- v0.27.1
- v0.27.0
- v0.26.0
- v0.25.5
- v0.25.4
- v0.25.3
- v0.25.2
- v0.25.1
- v0.25.0
- v0.24.9
- v0.24.8
- v0.24.7
- v0.24.6
- v0.24.54
- v0.24.53
- v0.24.51
- v0.24.5
- v0.24.47
- v0.24.46
- v0.24.45
- v0.24.44
- v0.24.43
- v0.24.4-fix
- v0.24.4
- v0.24.38
- v0.24.37
- v0.24.36
- v0.24.35
- v0.24.34
- v0.24.33
- v0.24.32
- v0.24.31
- v0.24.30
- v0.24.3
- v0.24.29
- v0.24.28
- v0.24.27.1
- v0.24.27
- v0.24.26.2
- v0.24.26
- v0.24.25
- v0.24.24
- v0.24.23
- v0.24.22
- v0.24.21
- v0.24.20
- v0.24.2
- v0.24.19
- v0.24.18
- v0.24.17
- v0.24.16
- v0.24.15
- v0.24.14
- v0.24.13
- v0.24.12
- v0.24.11
- v0.24.10
- v0.24.1
- v0.24.0
- v0.23.9
- v0.23.8
- v0.23.7
- v0.23.6
- v0.23.5
- v0.23.4
- v0.23.3
- v0.23.2
- v0.23.14
- v0.23.13
- v0.23.12
- v0.23.11
- v0.23.10
- v0.23.1
- v0.23.0
- v0.22.0
- v0.21.2
- v0.21.1
- v0.21.0
- v0.20.1
- v0.20.0
- v0.2.0
- v0.19.9
- v0.19.8
- v0.19.7
- v0.19.6
- v0.19.5
- v0.19.4
- v0.19.3
- v0.19.26
- v0.19.25
- v0.19.24
- v0.19.23
- v0.19.22
- v0.19.21
- v0.19.20
- v0.19.2.1
- v0.19.2
- v0.19.19
- v0.19.18
- v0.19.17
- v0.19.16
- v0.19.15
- v0.19.14
- v0.19.13
- v0.19.12
- v0.19.11
- v0.19.10
- v0.19.1
- v0.19.0
- v0.18.9
- v0.18.8
- v0.18.7
- v0.18.6
- v0.18.5
- v0.18.4-pre
- v0.18.4
- v0.18.3
- v0.18.25
- v0.18.24
- v0.18.23
- v0.18.21
- v0.18.20
- v0.18.2
- v0.18.19
- v0.18.18
- v0.18.17
- v0.18.16
- v0.18.15
- v0.18.14
- v0.18.13
- v0.18.12
- v0.18.11
- v0.18.10
- v0.18.1
- v0.18.0
- v0.17.7
- v0.17.6
- v0.17.5
- v0.17.4
- v0.17.3
- v0.17.2
- v0.17.1
- v0.17.0
- v0.16.9
- v0.16.8
- v0.16.7
- v0.16.6
- v0.16.5
- v0.16.4
- v0.16.3
- v0.16.2
- v0.16.14
- v0.16.13
- v0.16.12
- v0.16.11
- v0.16.10
- v0.16.1
- v0.16.0
- v0.15.9
- v0.15.8
- v0.15.7
- v0.15.6
- v0.15.5
- v0.15.4
- v0.15.3
- v0.15.2
- v0.15.13
- v0.15.12
- v0.15.11.2
- v0.15.11.1
- v0.15.11
- v0.15.10
- v0.15.1
- v0.15.0
- v0.14.3
- v0.14.2
- v0.14.1
- v0.14.0
- v0.13.9
- v0.13.8
- v0.13.7
- v0.13.3
- v0.13.2
- v0.13.13
- v0.13.12
- v0.13.11
- v0.13.10
- v0.13.1
- v0.13.0
- v0.12.9
- v0.12.8
- v0.12.7
- v0.12.6
- v0.12.5
- v0.12.4
- v0.12.30
- v0.12.3
- v0.12.25
- v0.12.24
- v0.12.23
- v0.12.22
- v0.12.21
- v0.12.20
- v0.12.2
- v0.12.18
- v0.12.17
- v0.12.16
- v0.12.15
- v0.12.14
- v0.12.13
- v0.12.12
- v0.12.11
- v0.12.10
- v0.12.1
- v0.12.0
- v0.11.9
- v0.11.8
- v0.11.7
- v0.11.6
- v0.11.5
- v0.11.4
- v0.11.3
- v0.11.23
- v0.11.22
- v0.11.21
- v0.11.20
- v0.11.2
- v0.11.19
- v0.11.18
- v0.11.17
- v0.11.16
- v0.11.15
- v0.11.14
- v0.11.13
- v0.11.12
- v0.11.11
- v0.11.10
- v0.11.1
- v0.11.0
- v0.10.9
- v0.10.8
- v0.10.7
- v0.10.6
- v0.10.5
- v0.10.4
- v0.10.36
- v0.10.35
- v0.10.34
- v0.10.33
- v0.10.32
- v0.10.31
- v0.10.30
- v0.10.3
- v0.10.29
- v0.10.28-rc3
- v0.10.28-rc2
- v0.10.28-rc1
- v0.10.27
- v0.10.26
- v0.10.25
- v0.10.24
- v0.10.23
- v0.10.22
- v0.10.21
- v0.10.20
- v0.10.2
- v0.10.19
- v0.10.18
- v0.10.17
- v0.10.16
- v0.10.15
- v0.10.14
- v0.10.13
- v0.10.12
- v0.10.11
- v0.10.10
- v0.10.1
- v0.10.0
- v0.1.0
- v-test.22.6.15.1
- v-test.22.6.15.0
- v-test-220616-1
- v-test-220615-4
- v-test-220615-3
- v-test-220615-2
Take a new snapshot of a software origin
If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.
Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.![swh spinner](/static/img/swh-spinner.gif)
Processing "take a new snapshot" request ...
Permalinks
To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.
Revision | Author | Date | Message | Commit Date |
---|---|---|---|---|
dd43551 | Tim Foley | 18 November 2019, 18:36:38 UTC | Further refactoring of semantic checking (#1102) * Split apart `SemanticsVisitor` The existing `SemanticsVisitor` type was the visitor for expressions, statements, and declarations, and its monolithic nature made it hard to introduce distinct visitors for different phases of checking (despite the fact that we had, de facto, multiple phases of declaration checking). This change splits up `SemanticsVisitor` as follows: * There is nosw a `SharedSemanticsContext` type which holds the shared state that all semantics visiting logic needs. This includes state that gets mutated during the course of semantic checking. * The `SemanticsVisitor` type is now a base class that holds a pointer to a `SharedSemanticsContext`. Most of the non-visitor functions are still defined here, just to keep the code as simple as possible. The `SemanticsVisitor` type is no longer a "visitor" in any meaningful way, but retaining the old name minimizes the diffs to client code. * There are distinct `Semantics{Expr|Stmt|Decl}Visitor` types that have the actual `visit*` methods for an appropriate subset of the AST hierarchy. These all inherit from `SemanticsVisitor` primarily so that they can have easy access to all the helper methods it defines (which used to be accessible because these were all the same object). Any client code that was constructing a `SemanticsVisitor` now needs to construct a `SharedSemanticsContext` and then use that to initialize a `SemanticsVisitor`. Similarly, any code that was using `dispatch()` to invoke the visitor on an AST node needs to construct the appropriate sub-class and then invoke `dispatch()` on it instead. This is a pure refactoring change, so no effort has been made to move state or logic onto the visitor sub-types even when it is logical. Similarly, no attempt has been made to hoist any code out of the common headers to avoid duplication between `.h` and `.cpp` files. Those cleanups will follow. The one cleanup I allowed myself while doing this was getting rid of the `typeResult` member in `SemanticsVisitor` that appears to be a do-nothing field that got written to in a few places (for unclear reasons) but never read. * Remove some statefulness around statement checking Some of the state from the old `SemanticsVisitor` was used in a mutable way during semantic checking: * The `function` field would be set and the restored when checking the body of a function so that things like `return` statements could find the outer function. * The `outerStmts` list was used like a stack to track lexically surrounding statements to resolve things like `break` and `continue` targets. Both of these meant that semantic checking code was doing fine-grained mutations on the shared semantic checking state even though the statefullness wasn't needed. This change moves the relevant state down to `SemanticsStmtVisitor`, which is a type we create on-the-fly to check each statement, so that we now only need to establish the state once at creation time. The list of outer statements is handled as a linked list threaded up through the stack (a recurring idiom through the codebase). There was one place where the `function` field was being used that wasn't strictly inside statement checking: it appears that we were using it to detect whether a variable declaration represents a local, so I added an `_isLocalVar` function to serve the same basic purpose. With this change, the only stateful part of `SharedSemanticsContext` is the information to track imported modules, which seems like a necessary thing (since deduplication requires statefullness). * Refactor declaration checking to avoid recursion The flexiblity of the Slang language makes enforcing ordering on semantic checking difficult. In particular, generics (including some of the built-in standard library types) can take value arguments, so that type expressions can include value expressions. This means that being able to determine the type of a function parameter may require checking expressions, which may in turn require resolving calls to an overloaded function, which in turn requires knowing the types of the parameters of candidate callees. Up to this point there have been two dueling approaches to handling the ordering problem in the semantic checking logic: 1. There was the `EnsureDecl` operation, supported by the `DeclCheckState` type. Every declaration would track "how checked" it is, and `EnsureDecl(d, s)` would try to perform whatever checks are needed to bring declaration `d` up to state `s`. 2. There was top-down orchestration logic in `visitModuleDecl()` that tried to perform checking of declarations in a set of fixed phases that ensure things like all function declarations being checked before any function bodies. Each of these options had problems: 1. The `EnsureDecl()` approach wasn't implemented completely or consistently. It only understood two basic levels of checking: the "header" of a declaration was checked, and then the "body," and it relied on a single `visit*()` routine to try and handle both cases. Things ended up being checked twice, or in a circular fashion. 2. Rather than fix the problems with `EnsureDecl()` we layered on the top-down orchestration logic, but doing so ignores the fact that no fixed set of phases can work for our language. The orchestration logic was also done in a relatively ad hoc fashion that relied on using a single visitor to implement all phases of checking, but it added a second metric of "checked-ness" that worked alongside `DeclCheckState`. This change strives to unify the two worlds and make them consistent. One of the key changes is that instead of doing everything through a single visitor type, we now have distinct visitors for distinct phases of semantic checking, and those phases are one-to-one aligned with the values of the `DeclCheckState` type. More detailed notes: * Existing sites that used to call `checkDecl` to directly invoke semantic checking recursively now use `ensureDecl` instead. This makes sure that `ensureDecl` is the one bottleneck that everything passes through, so that it can guarantee that each phase of checking gets applied to each declaration at most once. * The existing `visitModuleDecl` was revamped into a `checkModule` routine that does the global orchestration, but now it is just a driver routine that makes sure `ensureDecl` gets called on everything in an order that represents an idealized "default schedule" for checking, while not ruling out cases where `ensureDecl()` will change the ordering to handle cases where the global order is insufficient. * Because `checkModule` handles much of the recursion over the declaration hierarchy, many cases where a declaration `visit*()` would recurse on its members have been eliminated. The only case where a declaration should recursively `ensureDecl()` its members is when its validity for a certain phase depends on those members being checked (e.g., determining the type of a function declaration depends on its parameters having been checked). * All cases where a `visit*()` routine was manually checking the state/phase of checking have been eliminated. It is now the responsibility of `ensureDecl` to make sure that checking logic doesn't get invoked twice or in an inappropriate order. * Most cases where a `visit*()` routine was manually *setting* the `DeclCheckState` of a declaration have been eliminated. The common case is now handled by `ensureDecl()` directly, and `visit*()` methods only need to override that logic when special cases arise. E.g., when a variable is declared without a type `(e.g., `let foo = ...;`) then we need to check its initial-value expression to determine its type, so that we must check it further than was initially expected/required. * This change goes to some lengths to try and keep semantic checking logic at the same location in the `slang-check-decl.cpp` file, so each of the per-phase visitor types is forward declared at the top of the file, and then the actual `visit*()` routines are interleaved throughout the rest of the file. A future change could do pure code movement (no semantic changes) to arrive at a more logical organization, but for now I tried to stick with what would minimize the diffs (although the resulting diffs can still be messy at times). * One important change to the semantic checking logic was that the test for use of a local variable ahead of its declaration (or as part of its own initial-value expression) was moved around, since its old location in the middle of the `ensureDecl` logic made the overall flow and intention of that function less clear. There is still a need to fix this check to be more robust in the future. * Add some design documentation on semantic checking The main thing this tries to lay out is the strategy for declaration checking and the rules/constraints on programmers that follow from it. * fixup: typos found during review | 18 November 2019, 18:36:38 UTC |
1123ff2 | Tim Foley | 14 November 2019, 23:33:33 UTC | Fix path to Linux x86 glslang binary (#1126) | 14 November 2019, 23:33:33 UTC |
a7336f5 | Tim Foley | 14 November 2019, 21:39:23 UTC | Update slang-binaries to include Linux x86 glslang (#1125) | 14 November 2019, 21:39:23 UTC |
ce4829b | Tim Foley | 14 November 2019, 21:11:07 UTC | Initial work on direct emission of SPIR-V (#1118) * Initial work on direct emission of SPIR-V This change adds a first vertical slice of support for emitting SPIR-V code directly from the Slang IR, instead of generating it indirectly via GLSL. This work isn't usable for anything valuable right now; the goal is just to get something checked in that we can incrementally extend over time. When invoking `slangc`, the `-emit-spirv-directly` option can be used to turn on the new code path. I have not bothered to add an equivalent API option, because this flag is only intended to be used for testing in the immediate future. The existing `emitEntryPoint()` function has become `emitEntryPointSource()` to more accurately reflect its role in a world where we can also emit entry points to a binary format. Much of the logic that was inside `emitEntryPoint()` had to do with linking and then optimizing/transforming Slang IR code to get it ready for emission on a particular target. This logic has been factored into a new `linkAndOptimizeIR()` function that can be shared between the path that emits source and the new one that emits SPIR-V. The meat of the change is then the `emitSPIRVFromIR()` function in `slang-emit-spirv.cpp`, which is called *after* all the optimizations and transformations have been applied to the Slang IR to get it ready. Rather than repeat myself here, I will try to make the comments in `slang-emit-spirv.cpp` usable as documentation of the approach being taken. Smaller notes: * I've included a test case that compares `slangc` output directly to expected SPIR-V. This is perhaps not an ideal plan for how to test SPIR-V emission going forward, but it suffices for now. * The `external/` directory needed to be added to the include dirs for the `slang` project so that the new code can depend on the SPIR-V header. * In `slang-ir-link`, the direct SPIR-V generation path means that we now link with a target of SPIR-V instead of GLSL. In principle this can be used to ensure that appropriate variants of intrinsics are selected based on the knowledge that we are emitting SPIR-V. In practice, that isn't being used at all. * Fixup: path for SPIR-V headers While working on this PR I used a copy of `spirv.h` that I placed into the repository tree manually, but since I started the work we ended up with SPIR-V headers in our tree anyway, albeit at a different path. This change tries to fix things up so that my code uses the headers that were already placed in the repository. * fixup; 64-bit build issue * fixup: typo fixes based on review | 14 November 2019, 21:11:07 UTC |
d631233 | Tim Foley | 14 November 2019, 19:03:02 UTC | Enable use of pre-built glslang binaries (#1120) * Enable use of pre-built glslang binaries This change uses an updated version of the `slang-binaries` submodule that includes pre-built versions of `slang-glslang.dll` and `libslang-glslang.so`, and enables the build of the main Slang project to rely on these binaries instead of building them from source. An option to the premake build file can be used to generate the appropriate project files for `slang-glslang`, which should enable us to build updated binaries as needed. The default option is to *not* build those projects, so that we can reduce build times in the common case (and on CI). * fixup: different copy commands per platform * fixup * fixup * fixup: remove stray line added to premake file by accident | 14 November 2019, 19:03:02 UTC |
2e2f987 | jsmall-nvidia | 14 November 2019, 16:21:42 UTC | Add -dump-intermediates option. (#1123) | 14 November 2019, 16:21:42 UTC |
57cedf6 | Tim Foley | 13 November 2019, 21:39:53 UTC | Add a premake flag to control whether glslang is built from source (#1122) This change adds the flag, but doesn't wire it up to anything. The idea is to allow us to modify CI build scripts to use the flag in cases where it will be needed, so that we can later on disable building glslang from source by default, without an intermediate step where CI is broken. | 13 November 2019, 21:39:53 UTC |
9604118 | jsmall-nvidia | 13 November 2019, 18:35:56 UTC | * Added getCStr(Name*) (#1121) * Added the name to the EntryPointLayout so is always available * Made spReflectionEntryPoint_getName use name * Improved checking for entry point name in render-test * Improved COMPILE test type to allow failure and output of failure. | 13 November 2019, 18:35:56 UTC |
166a738 | jsmall-nvidia | 12 November 2019, 19:00:35 UTC | Fix ref counting bug in cpu-hello-world (#1119) * Fix ref counting bug in cpu-hello-world that meant session was not released correctly. * Fix typo. | 12 November 2019, 19:00:35 UTC |
6ee483d | jsmall-nvidia | 08 November 2019, 23:52:15 UTC | Fix problem when getting default value for a bool, was producing 0, which on glsl could not be coerced. (#1117) | 08 November 2019, 23:52:15 UTC |
0ac010a | jsmall-nvidia | 08 November 2019, 14:13:44 UTC | Riff Container Stream Writing (#1116) * * Added option to get random bytes from RandomGenerator * Added ability to allocate only in current block on MemoryArena * Allowed RiffContainer to not allocate new Data blocks, if can just extend the Data it has (because it's at the end of current block and there is space for the new data). * Added coverage for change on Riff unit test * Add test coverage for allocations over multiple Data blocks. * Improve comment on riff unit tests. | 08 November 2019, 14:13:44 UTC |
99c2954 | jsmall-nvidia | 07 November 2019, 18:51:46 UTC | * Removed strip pass from emit as no longer needed (#1114) * If obfuscate is enabled do strip on Layout * Add option to keep insts that have layout decoration (else DCE strips layout) * Add NameHint back in lowering - as strip now correctly removes. We may want NameHints in some stages even with obfuscation (for error messages in IR passes), as long as they are removed appropriately at the end | 07 November 2019, 18:51:46 UTC |
fedda2e | Tim Foley | 07 November 2019, 02:43:33 UTC | Add basic support for entry points in `.slang-lib` files. (#1112) * Add basic support for entry points in `.slang-lib` files. The basic idea here is that when writing out a `.slang-lib` file based on a compile request, we include new sections in the generated RIFF that represent the entry points that were requested. The entry-point information is serialized in an entirely ad hoc fashion (a future change might clean it up to use the `OffsetContainer` machinery), and contains the name, profile, and mangled symbol name of an entry point. When deserializing this information, we create a list of "extra" entry points that gets attached to the front-end compile requests. These "extra" entry points get turned into `EntryPoint` objects at the same place in the code that entry points specified on the command line or via API would be checked, but the extra entry points bypass the semantic checking and just create "dummy" `EntryPoint` objects. Aside: the ability for a compile request to end up with entry points that weren't originally specified via API or command-line is not new. We already had support for compiling a translation unit with entry points entirely specified via `[shader(...)]` attributes, and this new support tries to function similarly. Because the "dummy" entry points don't retain AST-level information, several parts of the code have been modified to defensively check for `EntryPoint` objects without a matching AST declaration, and skip over them. The main place where this creates a problem is paramete binding, where ignoring the dummy entry point is appropriate since we currently assume linked-in library code has been laid out manually. One small cleanup here is that the `-r` command-line flag and the `spAddLibraryReference` API functio now bottleneck through a common routine to do their work, so that they both gain the new behavior without needing copy-paste programming. In order to keep the existing test case for library linking with entry points working, I had to add a flag to the `render-test` tool so that it can skip specifying entry point names as part of the compile request it creates. In that case it must instead assume that the entry points will be added to the compile request via other means. This logic is a bit magical, and hints that we should be looking for other ways to expose the library linking functionality over time. * fixup: remove alignment assertion | 07 November 2019, 02:43:33 UTC |
7a877c3 | jsmall-nvidia | 06 November 2019, 23:37:25 UTC | BasicTypeKey improvements/fix for gcc build issue (#1110) * Added RiffReadHelper * Move type to fourCC in Chunk simplifies some code. * Make MemoryArena able to track external blocks. Allow ownership of Data to vary. Changed IR serialization to use moved allocations to avoid copies. As it turns out all of the array writes could use unowned data, but doing so requires the IRData to stay in scope longer than IRSerialData, which it does at the moment - but perhaps needs better naming or a control for the feature. * Write out slang-module container. * WIP on -r option. Loading modules - with -r. * Making the serialized-module run (without using imported module). * Split compiling module from the test. * Separate module compilation with a function working. * Remove serialization test as not used. * Fix warning on gcc. * Updated test to have types across module boundary. * Allow entry point declaration. A test that tries to build with just an entry point declaration and a module. * Try to make link work with multiple modules. * Multi module linking first pass working. * Multi module test working with -module-name option * Added feature to repro manifest of approximation of command line that was used. * Use isDefinition - for determining to add decorations to entry point lowering. * Added support for repo-file-system.h More precise control of CacheFileSystem. Allow RelativeFileSystem to strip paths optionally. Use canonical paths in PathInfo cache. Fix bug in -D options for command line output of StateSerailizeUtil * Add missing slang-options.h * Fix bug in bit slang-state-serialize.cpp with bit removal. * Added documentation around -repro-file-system Added spLoadReproAsFileSystem function. * Fix warning. * spAddLibraryReference * * Add support for slang-lib extension * Container output when using -no-codegen option * Use the m_containerFormat to determine if the module container is constructed. Store the result in a blob. This allows for potential access via the API. Write the blob if a filename is set. Use m_ prefix for container variables. * Added spGetContainerCode. Made spGetCompileRequestCode work. * Use enum class for BasicTypeKey - removed type pun/bit field usage. Specifed invalid BasicTypeKey value. Fixed problem on gcc 7.4 not compiling claiming an uninitialized variable could be used. | 06 November 2019, 23:37:25 UTC |
13a2ca6 | Tim Foley | 06 November 2019, 22:01:53 UTC | Fixes to how "pending" data is reported in type layouts (#1108) These fixes were needed to get a Falcor example that uses Slang `interface`s for shader specialization to work. The basic fixes are: * In `applyOffsetToTypeLayout`, we need to account for the case where the type being offset had "pending" data, and make sure to offset it as well. This also means that when computing if offsetting is needed, we also need to check the pending data, if any. * In `_createParameterGroupTypeLayout` make sure to call `applyOffsetToTypeLayout` *after* the layout for "pending" data, if any, has been computed. * In `_createTypeLayout`, when computing layout for an `ExistentialSpecializedType` (a type that has had existential/interface-type slots specialized to known types), don't forget to set the type layout of the variable layout we create to store pending data. The first two items relate a "legacy" reflection API that the client code really shouldn't be using (but it was easier to fix the "do what I mean" behavior in Slang than to refactor the client), and the last is a detailed corner case in the layout of interface-based types that we are not currently equiped to test directly. | 06 November 2019, 22:01:53 UTC |
835eb1b | jsmall-nvidia | 06 November 2019, 19:11:41 UTC | Support for [__extern] attribute (#1111) * Added RiffReadHelper * Move type to fourCC in Chunk simplifies some code. * Make MemoryArena able to track external blocks. Allow ownership of Data to vary. Changed IR serialization to use moved allocations to avoid copies. As it turns out all of the array writes could use unowned data, but doing so requires the IRData to stay in scope longer than IRSerialData, which it does at the moment - but perhaps needs better naming or a control for the feature. * Write out slang-module container. * WIP on -r option. Loading modules - with -r. * Making the serialized-module run (without using imported module). * Split compiling module from the test. * Separate module compilation with a function working. * Remove serialization test as not used. * Fix warning on gcc. * Updated test to have types across module boundary. * Allow entry point declaration. A test that tries to build with just an entry point declaration and a module. * Try to make link work with multiple modules. * Multi module linking first pass working. * Multi module test working with -module-name option * Added feature to repro manifest of approximation of command line that was used. * Use isDefinition - for determining to add decorations to entry point lowering. * Added support for repo-file-system.h More precise control of CacheFileSystem. Allow RelativeFileSystem to strip paths optionally. Use canonical paths in PathInfo cache. Fix bug in -D options for command line output of StateSerailizeUtil * Add missing slang-options.h * Fix bug in bit slang-state-serialize.cpp with bit removal. * Added documentation around -repro-file-system Added spLoadReproAsFileSystem function. * Fix warning. * spAddLibraryReference * * Add support for slang-lib extension * Container output when using -no-codegen option * Use the m_containerFormat to determine if the module container is constructed. Store the result in a blob. This allows for potential access via the API. Write the blob if a filename is set. Use m_ prefix for container variables. * Added spGetContainerCode. Made spGetCompileRequestCode work. * * Put obfuscateCode on linkage * Remove obfuscation from variable names - as can be achieved by either stripping and/or removing NameHintDecorations at lowering * Remove name hints being added during lowering * Add stripping of SourceLoc location in strip phase * Hashing of linkage import/export names. * Do final strip in emitEntryPoint, removes any remaining SourceLoc. * Support for [__extern] to mark struct/function that are defined elsewhere. * Allow adding extern to any decl. * Use ExternAtrtibute to apply import decoration, rather than use an ir extern decoration. * Added a test for [__extern] * Improved comment around [__extern] | 06 November 2019, 19:11:41 UTC |
2e1be5c | jsmall-nvidia | 06 November 2019, 14:01:32 UTC | Feature/obfuscate improvements (#1107) * Added RiffReadHelper * Move type to fourCC in Chunk simplifies some code. * Make MemoryArena able to track external blocks. Allow ownership of Data to vary. Changed IR serialization to use moved allocations to avoid copies. As it turns out all of the array writes could use unowned data, but doing so requires the IRData to stay in scope longer than IRSerialData, which it does at the moment - but perhaps needs better naming or a control for the feature. * Write out slang-module container. * WIP on -r option. Loading modules - with -r. * Making the serialized-module run (without using imported module). * Split compiling module from the test. * Separate module compilation with a function working. * Remove serialization test as not used. * Fix warning on gcc. * Updated test to have types across module boundary. * Allow entry point declaration. A test that tries to build with just an entry point declaration and a module. * Try to make link work with multiple modules. * Multi module linking first pass working. * Multi module test working with -module-name option * Added feature to repro manifest of approximation of command line that was used. * Use isDefinition - for determining to add decorations to entry point lowering. * Added support for repo-file-system.h More precise control of CacheFileSystem. Allow RelativeFileSystem to strip paths optionally. Use canonical paths in PathInfo cache. Fix bug in -D options for command line output of StateSerailizeUtil * Add missing slang-options.h * Fix bug in bit slang-state-serialize.cpp with bit removal. * Added documentation around -repro-file-system Added spLoadReproAsFileSystem function. * Fix warning. * spAddLibraryReference * * Add support for slang-lib extension * Container output when using -no-codegen option * Use the m_containerFormat to determine if the module container is constructed. Store the result in a blob. This allows for potential access via the API. Write the blob if a filename is set. Use m_ prefix for container variables. * Added spGetContainerCode. Made spGetCompileRequestCode work. * * Put obfuscateCode on linkage * Remove obfuscation from variable names - as can be achieved by either stripping and/or removing NameHintDecorations at lowering * Remove name hints being added during lowering * Add stripping of SourceLoc location in strip phase * Hashing of linkage import/export names. * Do final strip in emitEntryPoint, removes any remaining SourceLoc. | 06 November 2019, 14:01:32 UTC |
a6a153f | jsmall-nvidia | 05 November 2019, 20:29:44 UTC | API support for IR modules - setting references to libs, and returns lib from compilation (#1105) * Added RiffReadHelper * Move type to fourCC in Chunk simplifies some code. * Make MemoryArena able to track external blocks. Allow ownership of Data to vary. Changed IR serialization to use moved allocations to avoid copies. As it turns out all of the array writes could use unowned data, but doing so requires the IRData to stay in scope longer than IRSerialData, which it does at the moment - but perhaps needs better naming or a control for the feature. * Write out slang-module container. * WIP on -r option. Loading modules - with -r. * Making the serialized-module run (without using imported module). * Split compiling module from the test. * Separate module compilation with a function working. * Remove serialization test as not used. * Fix warning on gcc. * Updated test to have types across module boundary. * Allow entry point declaration. A test that tries to build with just an entry point declaration and a module. * Try to make link work with multiple modules. * Multi module linking first pass working. * Multi module test working with -module-name option * Added feature to repro manifest of approximation of command line that was used. * Use isDefinition - for determining to add decorations to entry point lowering. * Added support for repo-file-system.h More precise control of CacheFileSystem. Allow RelativeFileSystem to strip paths optionally. Use canonical paths in PathInfo cache. Fix bug in -D options for command line output of StateSerailizeUtil * Add missing slang-options.h * Fix bug in bit slang-state-serialize.cpp with bit removal. * Added documentation around -repro-file-system Added spLoadReproAsFileSystem function. * Fix warning. * spAddLibraryReference * * Add support for slang-lib extension * Container output when using -no-codegen option * Use the m_containerFormat to determine if the module container is constructed. Store the result in a blob. This allows for potential access via the API. Write the blob if a filename is set. Use m_ prefix for container variables. * Added spGetContainerCode. Made spGetCompileRequestCode work. | 05 November 2019, 20:29:44 UTC |
d326d94 | jsmall-nvidia | 05 November 2019, 18:01:58 UTC | API support for IR modules - setting references to libs, and returns lib from compilation (#1105) * Added RiffReadHelper * Move type to fourCC in Chunk simplifies some code. * Make MemoryArena able to track external blocks. Allow ownership of Data to vary. Changed IR serialization to use moved allocations to avoid copies. As it turns out all of the array writes could use unowned data, but doing so requires the IRData to stay in scope longer than IRSerialData, which it does at the moment - but perhaps needs better naming or a control for the feature. * Write out slang-module container. * WIP on -r option. Loading modules - with -r. * Making the serialized-module run (without using imported module). * Split compiling module from the test. * Separate module compilation with a function working. * Remove serialization test as not used. * Fix warning on gcc. * Updated test to have types across module boundary. * Allow entry point declaration. A test that tries to build with just an entry point declaration and a module. * Try to make link work with multiple modules. * Multi module linking first pass working. * Multi module test working with -module-name option * Added feature to repro manifest of approximation of command line that was used. * Use isDefinition - for determining to add decorations to entry point lowering. * Added support for repo-file-system.h More precise control of CacheFileSystem. Allow RelativeFileSystem to strip paths optionally. Use canonical paths in PathInfo cache. Fix bug in -D options for command line output of StateSerailizeUtil * Add missing slang-options.h * Fix bug in bit slang-state-serialize.cpp with bit removal. * Added documentation around -repro-file-system Added spLoadReproAsFileSystem function. * Fix warning. * spAddLibraryReference * * Add support for slang-lib extension * Container output when using -no-codegen option * Use the m_containerFormat to determine if the module container is constructed. Store the result in a blob. This allows for potential access via the API. Write the blob if a filename is set. Use m_ prefix for container variables. * Added spGetContainerCode. Made spGetCompileRequestCode work. | 05 November 2019, 18:01:58 UTC |
608b7fb | jsmall-nvidia | 01 November 2019, 19:57:51 UTC | Using repro as a file system (#1104) * Added RiffReadHelper * Move type to fourCC in Chunk simplifies some code. * Make MemoryArena able to track external blocks. Allow ownership of Data to vary. Changed IR serialization to use moved allocations to avoid copies. As it turns out all of the array writes could use unowned data, but doing so requires the IRData to stay in scope longer than IRSerialData, which it does at the moment - but perhaps needs better naming or a control for the feature. * Write out slang-module container. * WIP on -r option. Loading modules - with -r. * Making the serialized-module run (without using imported module). * Split compiling module from the test. * Separate module compilation with a function working. * Remove serialization test as not used. * Fix warning on gcc. * Updated test to have types across module boundary. * Allow entry point declaration. A test that tries to build with just an entry point declaration and a module. * Try to make link work with multiple modules. * Multi module linking first pass working. * Multi module test working with -module-name option * Added feature to repro manifest of approximation of command line that was used. * Use isDefinition - for determining to add decorations to entry point lowering. * Added support for repo-file-system.h More precise control of CacheFileSystem. Allow RelativeFileSystem to strip paths optionally. Use canonical paths in PathInfo cache. Fix bug in -D options for command line output of StateSerailizeUtil * Add missing slang-options.h * Fix bug in bit slang-state-serialize.cpp with bit removal. * Added documentation around -repro-file-system Added spLoadReproAsFileSystem function. * Fix warning. | 01 November 2019, 19:57:51 UTC |
068f2a2 | jsmall-nvidia | 01 November 2019, 14:31:01 UTC | -extract-repro gives approximation of 'command line' used (#1103) * Added feature to repro manifest of approximation of command line that was used. * Add missing slang-options.h | 01 November 2019, 14:31:01 UTC |
f59df38 | jsmall-nvidia | 31 October 2019, 19:02:18 UTC | Reference IR modules with entry point (#1101) * Added RiffReadHelper * Move type to fourCC in Chunk simplifies some code. * Make MemoryArena able to track external blocks. Allow ownership of Data to vary. Changed IR serialization to use moved allocations to avoid copies. As it turns out all of the array writes could use unowned data, but doing so requires the IRData to stay in scope longer than IRSerialData, which it does at the moment - but perhaps needs better naming or a control for the feature. * Write out slang-module container. * WIP on -r option. Loading modules - with -r. * Making the serialized-module run (without using imported module). * Split compiling module from the test. * Separate module compilation with a function working. * Remove serialization test as not used. * Fix warning on gcc. * Updated test to have types across module boundary. * Allow entry point declaration. A test that tries to build with just an entry point declaration and a module. * Try to make link work with multiple modules. * Multi module linking first pass working. * Multi module test working with -module-name option * Use isDefinition - for determining to add decorations to entry point lowering. | 31 October 2019, 19:02:18 UTC |
72f86c8 | jsmall-nvidia | 30 October 2019, 21:28:55 UTC | WIP: Simple separate IR module linkage working (#1100) * Added RiffReadHelper * Move type to fourCC in Chunk simplifies some code. * Make MemoryArena able to track external blocks. Allow ownership of Data to vary. Changed IR serialization to use moved allocations to avoid copies. As it turns out all of the array writes could use unowned data, but doing so requires the IRData to stay in scope longer than IRSerialData, which it does at the moment - but perhaps needs better naming or a control for the feature. * Write out slang-module container. * WIP on -r option. Loading modules - with -r. * Making the serialized-module run (without using imported module). * Split compiling module from the test. * Separate module compilation with a function working. * Remove serialization test as not used. * Fix warning on gcc. * Updated test to have types across module boundary. | 30 October 2019, 21:28:55 UTC |
066bc37 | jsmall-nvidia | 29 October 2019, 18:50:15 UTC | Feature/riff improvements (#1099) * Added RiffReadHelper * Move type to fourCC in Chunk simplifies some code. * Make MemoryArena able to track external blocks. Allow ownership of Data to vary. Changed IR serialization to use moved allocations to avoid copies. As it turns out all of the array writes could use unowned data, but doing so requires the IRData to stay in scope longer than IRSerialData, which it does at the moment - but perhaps needs better naming or a control for the feature. | 29 October 2019, 18:50:15 UTC |
c27b7d9 | jsmall-nvidia | 29 October 2019, 12:51:24 UTC | Feature/container format (#1098) * WIP RiffContainer. * WIP riff container. * Testing out RiffContainer. * * Naming improvements * Visitor functions * Ability to dump riffs. * Renamed RiffChunk to RiffHeader * Remove m_ prefix on RiffHeader members. * Riff stream reading writing. Simple test of riff reading/writing. * Fix Riff alignment issue. Make IR serialization use the RiffContainer API. * Improve documentation. * Remove SubChunk fuctionality as not needed with RiffContainer. | 29 October 2019, 12:51:24 UTC |
c886ca8 | Tim Foley | 25 October 2019, 21:19:56 UTC | Refactor semantic checking code into more files (#1097) The semantic checking logic was all inside `slang-check.cpp` and as a result this was a monster file that was extremely hard to follow. This change splits `slang-check.cpp` into several smaller files, although some of the resulting files are still quite large. This change attempts to be a copy-paste job as much as possible and does *not* perform any cleanup on naming, structure, duplication, etc. in the code it deal with. No function bodies or signatures have been touched. | 25 October 2019, 21:19:56 UTC |
7cf9b65 | Tim Foley | 25 October 2019, 18:34:16 UTC | Don't use mangled names when emitting code (#1096) * Small cleanup to how standard-library code gets marked Declarations in the standard library used to be individualy marked with `FromStdLibModifier` so that downstream passes (notably IR lowering) could treat them specially. At some point we simplified things by just looking for `FromStdLibModifier` in the ancestor list of a declaration, so that we could handle nested declarations without having to recursively attach the modifier to everything. This change simplifies things a bit further in that the `FromStdLibModifier` now only get attached to the `ModuleDecl`, since that will be on the ancestor chain of all the declarations anyway. The second change here is that we attach this marker modifier *before* we parse and do semantic checking on the module, rather than after. There is no code in this change that relies on that difference, but changing the timing of when we attach the modifier means that the semantic checking logic can now reliably detect if something represents a declaration in the standard library. * Change implementation of `sign()` for GLSL target Issue #602 related to the `sign()` function having a different return type between GLSL and HLSL/SLang. At the time, the issue was fixed by adding special-case logic in the emit pass that looked for the `sign()` function by name. This change cleans up that logic to work using the existing `__target_intrinsic` mechanism instead. * Make sure code emit doesn't depend on mangled names There was existing logic in the HLSL/GLSL emit path (that got copy-pasted into the C/C++ path) where if a builtin function didn't have an application `__target_intrinsic` modifier (`IRTargetIntrinsicDecoration` at the IR level), we used some fairly fragile logic to take the mangled symbol name for a function and unmangle it to recover the original name, as well as the number of parameters (to detect member functions). This approach had always been a kludge, and we have reached a point where it actively hinders forward progress on some valuable new features. The big idea of this change is fairly simple: in the IR lowering pass we detect when we have a stdlib function that ought to have an intrinsic definition but doesn't have a "catch-all" `__target_intrinsic` modifier applied. If we discover such a function, we go ahead and emit it to the IR with just such a catch-all modifier. (The main alternative here would be to require that all functions in the stdlib be manually marked `__target_intrinsic` and make this a front-end issue where we get errors if we write stdlib functions wrong, but this workaround is more expedient for now) Some of the logic around target intrinsics already handled the idea of having catch-all intrinsic modifiers/decorations with an empty target name, but that support wasn't 100% complete so this change strives to get it working. One detail that was only being handled along this mangled-name path was support for emitting calls using member-function syntax. I updated the generic handling of `__target_intrinsic`-based calls to support specifying a member function name using a prefix `.` on the definition string. With this work in place, it is possible to clean up a bunch of logic in the `emit` code that had to assume that any function without a body/definition must be an intrinsic. Instead, with this change we can now use the presence of a suitable `IRTargetIntrinsicDecoration` as the indicator that a function is an intrinsic. This should make the emit logic a bit more robust. One wrinkle that remains with this change is the special handling of functions that get the name `operator[]` (that is, the `get`/`set`/etc. accessors for `__subscript` declarations). The logic no longer depends on the mangled name, but it still feels a bit gross to have this kind of string-based special case (especially since it is our main/only special case like this). Another wrinkle is that the C/C++ back-end logic for handling intrinsic functions largely mirrors the HLSL/GLSL case, but can't just use the same exact code because it has to be intercepted by the logic that generates some of the required functions on-demand. There's still a net cleanup with this change, but there is probably an opportunity to remove even more duplication down the road. | 25 October 2019, 18:34:16 UTC |
3c57c86 | jsmall-nvidia | 25 October 2019, 01:14:12 UTC | * Functionality to dump repo if there is a failure throught the -dump-repro-on-failure option (#1095) * Small typo fix | 25 October 2019, 01:14:12 UTC |
89ddb50 | jsmall-nvidia | 24 October 2019, 21:58:24 UTC | OffsetContainer serialization (#1093) * OffsetContainer with unit tests. * State serialization working with OffsetContainer. * Fixes to make work with OffsetContainer. * Added OffsetContainer documentation. * Remove RelativeContainer. * Fix problem with + on Offset32Ptr on windows x86 target. * * Made OffsetBase a base class of OffsetContainer. * Added MemoryOffsetBase to just handle being a chunk of memory. * * Use operator[] to access contents of OffsetContainer * Fix the type hash to work across different size_t sizes. * Fixed some Offset type related comments. * Fix bug around using asBase, because it returns a reference just using 'auto' will means it becomes a value type. Remove assignment and copy ctor from OffsetBase. * Evaluation order of assignment can lead to wrong behavior with Offset32Ptr/raw pointers. Document the fact, and fix in StateSerializeUtil. | 24 October 2019, 21:58:24 UTC |
58ad4b1 | Tim Foley | 24 October 2019, 19:18:34 UTC | Strip IR after front-end steps are done (#1092) * Strip IR after front-end steps are done The main feature of this change is to unconditonally strip out the `IRHighLevelDeclDecoration`s in an IR module once the "mandatory" IR passes in the front end have run. This ensures that later IR passes (e.g., code emission) *cannot* rely on AST-level information to get their job done. Since I was already writing a pass to remove some instructions at the end of the front-end passes, I went ahead and also made the `-obfuscate` flag apply to the front-end IR generation by causing it to strip `IRNameHintDecoration`s while it is doing the other stripping. With this, the main identifying information left in IR modules (other than semantics and entry-point names) is mangled name strings for imported/exported symbols. A few other things got changes along the way: * Removed the `.expected` file for one of the tests, where that file seemingly shouldn't have been checked in at all. * Updated the signature of the DCE pass both so that it doesn't require a back-end compile request (it wasn't using it anyway), and so that it takes some options to decide whether to keep symbols marked `[export(...)]` alive (the front-end wants to keep these, while back-end passes currently need to be able to eliminate them). * Moved the `obfuscateCode` flag from the back-end compile request to the base class shared between front- and back-end requests, and updated the options and repro logic to set both as needed. An obvious improvement in the future would be to have the front- and back-end requests share these settings by referencing a single common object in the end-to-end case, rather than each having their own copy. * Removed logic that was keeping layout instructions alive in DCE, even if they weren't used. This seems to have been a vestige of an intermediate step between AST and IR layout. * fixup: add the new files | 24 October 2019, 19:18:34 UTC |
4fd0448 | Tim Foley | 24 October 2019, 15:32:01 UTC | Address review comments on IR layout PR (#1091) These were meant to be merged into #1084, but I failed to push the changes to the server. | 24 October 2019, 15:32:01 UTC |
73dcec6 | jsmall-nvidia | 23 October 2019, 17:25:58 UTC | Version information on repro binary format. (#1090) * * Added semantic versioning and hashing test on repro data. * Added RiffSemanticVersion type * Fix linux build warning. | 23 October 2019, 17:25:58 UTC |
85f858c | jsmall-nvidia | 23 October 2019, 14:25:11 UTC | Documentation around Relative types (#1089) * * Added comments/documentation to better describe Relative/Safe types and usage * Renamed allocate methods to newObject/newArray on RelativeContainer. * Fix error introduced from automatic merge. | 23 October 2019, 14:25:11 UTC |
9c2d176 | jsmall-nvidia | 23 October 2019, 13:28:58 UTC | Expose more repro in API, support output params. (#1087) * Added spEnableReproCapture to the API. * Added MemoryStreamBase - which can be used to read from without copyin the data. Added the missing Repro API functions - spEnableReproCapture and spExtractRepro. Added support for serializing output filenames. * Improved naming around Stream. Brought Stream and sub types closer to code conventions. * Renamed content -> contents in Stream. | 23 October 2019, 13:28:58 UTC |
6a7f4c9 | Tim Foley | 22 October 2019, 21:53:21 UTC | User IR-based layout for all IR steps (#1084) This change builds on previous work that moves toward a more IR-based representation of layout. Those steps added some instructions for representing layout in the IR (initially just proxies for the AST layout objects), and an explicit lowering pass that could build a target-specific IR module that binds parameters and entry points to layout information. This change aims to complete that work, in the sense that the IR representation of layout is now self-contained and does not rely on having pointers back into the AST-level representation. Achieving this requires two main kinds of work: 1. Update any code that used layout information derived from the IR (most notably all the `slang-emit-*` code) to use the new IR representation and its accessors. 2. Update any code that *constructs* layouts using information derived from the IR to construct IR layouts instead. The biggest new infrastructure feature in this change is support for "attributes" in the IR (I'd welcome feedback on the naming). An attribute can either be thought of like key/value arguments that can be added to certain instructions to encode optional data, or alternatively like a decoration that is referenced as an operand instead of a child. The value of attributes over decorations is that they can affect the hash/identity of an instruction (which decorations can't), while the advantage of decorations is that they can easily be added/removed over the lifetime of an instruction (which attributes can't). We mostly use them here to represent operands that are logically optional. Once attributes are available, the encoding of layout information into the IR is mostly straightforward: * An `IRVarLayout` has a fixed operand for its type layout, and can accept a few different attributes * Zero or more `IRVarOffsetAttr`s that specify the offset of the variable for a given resource kind. These are equivalent to the `VarLayout::ResourceInfo`s at the AST level. * An optional `IRUserSemanticAttr` and `IRSystemValueSemanticAttr` to represent the (possibly derived) semantic of a varying input/output parameter. * An option `IRStageAttr` to represent the known stage for a parameter. * An `IREntryPointLayout` has a var layout for the entry point parameters (logically grouped in to a struct) and another var layout for the result parameter. * There is a small type hierarchy rooted at `IRTypeLayout` where each subtype can add fixed operands and attributes that are expected to appear. It also supports `IRTypeSizeAttr`s that serve a similar role to the `IRVarOffsetAttr`s. * Structure types maintain the mapping of fields to their var layouts using `IRStructFieldLayoutAttr`s. With the encoding in place, most of the changes in category (1) (code that just *uses* rather than *creates* layouts) was straightforward. The biggest different beyond name changes was that everything needs to be fetched using accessors instead of bare fields. It would have been possible to stage this commit and make the diffs smaller by first introducing mandatory acessors to the AST layout types. The changes in category (2) were more involved. There were a lot of places in the existing code where a `TypeLayout` or `VarLayout` would be created, and then initialized piecemeal over several lines of code (and sometimes even across functions). Because of the way that layouts need to support many optional properties, it did not seem practical to just have monolithic factory functions that took all the options as arguments, so I instead opted for a builder approach. The builders for `IRVarLayout` and `IREntryPointLayout` are both straightforward, and honestly there is no realy need for a builder for entry point layouts right now, but I was trying to future-proof in case we decidd to add some optional attributes to them. The builders for type layouts are more involved because of the inheritance hierarchy. Each concrete sub-type of type layout needs to define its own builder type that customizes the opcode, operands, and attributes of the final instruction. The refactoring that had to go into this change was a nice excuse to clean up a few ugly warts in the AST layout code that were largely there to support IR use cases. While this change adds a lot of new infrastructure code to the IR, most of the client code has stayed the same or gotten simpler. One annoying wart that remains with this change is the notion of an "offset element type layout" for parameter group types. That idea was added to deal with a legacy feature in the reflection API that we realized was a mistake, but unfortunately having that "offset" layout handy made writing a few other pieces of code simpler so that there are use cases of the feature even in the IR. Removing those uses is do-able, but requires careful refactoring so it is best left to a follow-on change. Another thing that could be considered for a follow-on change is how much information should be specified when constructing a `Builder` for an IR type layout, and how much should be allowed to be specified statefully/piecemeal. It would be nice to force all the required operands to be specified up front, but `IRParameterGroupTypeLayout::Builder` doesn't currently work that way because so much of the client code that needs it involved a lot of stateful setting and would need to be refactored heavily to provide the necessary information up front. | 22 October 2019, 21:53:21 UTC |
365cd4d | jsmall-nvidia | 21 October 2019, 19:51:01 UTC | First pass Repro documentation (#1086) * WIP on serialize/save state. * Relative string encoding. * Added RelativeContainer unit test. Split out RelativeContainer into core. * Fix bug in RelativeString encoding. * More work around relative container. * Fix checks. * Use RelativeBase for safe access. Use malloc/free/realloc instead of List. * Add natvis support for relative types. * Setting up of state (not includes) writing of repro state. * Capture after spCompile. * Writing SourceFile and file system files. Added -dump-repo * First pass at loading state. * First pass at reading repro. * Small optimization around Safe32Ptr * Refactor how repro data is stored - to make saving off the files more simple, by having all all backed by 'files'. Make file loading always set up PathInfo so we get uniqueIdentifier info. * Generate unique file names. * Added RelativeFileSystem Added saveFile to ISlangFileSystemExt and implemented for interfaces Added mechanism to save of files (and manifest) * Added ability to replace files in repo with directory holding their contents. * Add support for entry points. * Fix problem compiling on linux. * Added SIMPLE_EX option, where everything on command line must be specified. * Fix typo in unit test for relative container. * Fix another typo in unit test for RelativeContainer. * Fix small bugs. * Fix release unused variable issue in slang-state-serialize.cpp * Fix checking for SIMPLE_EX in testing, else broke COMMAND_LINE_SIMPLE. * Fix warnings on 32 bit debug build. * First pass repro docs. | 21 October 2019, 19:51:01 UTC |
5ca4468 | jsmall-nvidia | 21 October 2019, 19:32:13 UTC | `Repro` functionality (#1085) * WIP on serialize/save state. * Relative string encoding. * Added RelativeContainer unit test. Split out RelativeContainer into core. * Fix bug in RelativeString encoding. * More work around relative container. * Fix checks. * Use RelativeBase for safe access. Use malloc/free/realloc instead of List. * Add natvis support for relative types. * Setting up of state (not includes) writing of repro state. * Capture after spCompile. * Writing SourceFile and file system files. Added -dump-repo * First pass at loading state. * First pass at reading repro. * Small optimization around Safe32Ptr * Refactor how repro data is stored - to make saving off the files more simple, by having all all backed by 'files'. Make file loading always set up PathInfo so we get uniqueIdentifier info. * Generate unique file names. * Added RelativeFileSystem Added saveFile to ISlangFileSystemExt and implemented for interfaces Added mechanism to save of files (and manifest) * Added ability to replace files in repo with directory holding their contents. * Add support for entry points. * Fix problem compiling on linux. * Added SIMPLE_EX option, where everything on command line must be specified. * Fix typo in unit test for relative container. * Fix another typo in unit test for RelativeContainer. * Fix small bugs. * Fix release unused variable issue in slang-state-serialize.cpp * Fix checking for SIMPLE_EX in testing, else broke COMMAND_LINE_SIMPLE. * Fix warnings on 32 bit debug build. * Added import-subdir-search-path-repro.slang test. Although disabled for now as writes to root of slang project. * Remove wrong version of import-subdir-search-path-repro.slang * Added import-subdir-search-path-repro.slang | 21 October 2019, 19:32:13 UTC |
a854bf2 | Tim Foley | 18 October 2019, 00:34:31 UTC | Initial work on representing layout at IR level (#1079) * Initial work on representing layout at IR level This change starts the process of making the back-end of the compiler independent of the AST-level layout information (`TypeLayout`, `VarLayout`, etc.) so that it instead only relies on layout information that is embedded into IR modules. This brings us incrementally closer to a world in which the back-end could be run without the AST-level structures even existing (e.g., for an application that just wants to ship IR without any AST information for IP protection, while still supporting some amount of linking and specialization). The main parts of the change are: * There is a bunch of incidental churn related to specifying entry points by index instead of the `EntryPoint` object for certain operations. This ends up being a better choice because we can use the index to look up side-band information about the entry point that might not be stored on the `EntryPoint` object itself. In particular... * We expand the `ComponentType` interface to support looking up the mangled name of an entry point by index. In common cases (no generic/interface specialization) this would be the same as asking the `EntryPoint` for its mangled name, but in cases where we have specialized a generic entry point, the mangled name would include speicalization arguments that are only available on the `SpecializedComponentType` that wraps the entry point. This part of the change isn't ideal and there might be a better solution waiting to be invented. Note that we store mangled entry point names as strings rather than using `DeclRef`s because that ensures that the information could be serialized and deserialized without a dependence on the AST. * The `TargetProgram` type (which represents binding a specific `ComponentType` for a shader program to a specific `TargetRequest` that represents the target platform) is expanded to include an `IRModule` that represents layout information, in addition to the AST-level `ProgramLayout` it already contained. We create both of these objects at the same time (on-demand) to simplify the overall flow (so that any code that triggers creation of the AST-level layout will also ensure that the IR-level layout exists). * A bunch of code in the emit passes that was passing down layout-related objects has been eliminated. It appears that most of those objects weren't actually being used, so this is just a cleanup, but it helps ensure that the back-end steps are "clean" and don't depend on the AST-level information. The one big exception here is that the emit logic needs to know the stage for the entry point being emitted (to deal with one wrinkle in translating DXR to VKRT). * A big change (actually introduced by @jsmall-nvidia in a branch that this change copied and then built from) is to introduce some more explicit IR instructions to represent layout information, notably an `IRTypeLayout` and an `IRVarLayout`. For now these objects still reference their AST equivalents, but the separation gives us an incremental path to move information from the AST-level objects over to the IR ones. This work includes logic in `IRBuilder` to construct the IR-level layout objects from the AST-level ones on-demand, so that the existing code paths that try to attach AST-level layout will continue to work for now. * Because layout information is now embedded in the IR, the `slang-ir-link.cpp` logic loses a lot of cases that used to deal with attaching AST-level layout objects to IR-level instructions during the linking process. Instead, the linker now assumes that one (or more) of the input IR modules will have layout information associated with it, and the linker makes sure to copy layout decorations (and the instructions they reference) from the input IR module(s) to the output using its more ordinary mechanisms. * Inside `slang-lower-to-ir.cpp`, we add logic to construct an IR module in a `TargetProgram` that simply references the global shader parameters, entry points, etc. and attaches IR layout decorations to them. This is akin to the existing pass in the same file that constructs IR to represent specialization information, and both of these passes share infrastructure with the main AST->IR lowering pass. Eventually, it is expected that this pass will encompass more of the logic for copying AST-level layout information over to IR-level equivalents. * One small wrinkle with this change was that the output for an HLSL generation test case changed some of its `#line` directives. The old code was actually more inaccurate than the new, so this change just updated the baseline. It also added some logic in the linker to make sure that when an IR instruction has multiple definitions, we try to pick up a source location from any of them, in case the "main" one somehow didn't get a location. * Another small fix was that the key/value map in `StructTypeLayout` for mapping fields/members to their layouts was keyed on `Decl*` when it really should have been `VarDeclBase*`. This change should in principle be a pure refactoring with no functionality changes, so no new tests were added. It is unfortunately also a change that has a high probability of breaking at least *some* client code, so we may want to be defensive and mark this with a new major version number (well, a new *minor* version number since we are pre-`1.0`) to give us some room for releasing hotfixes to the old version if needed. * fixup: infinite recursion bug detected by clang * fixup: remove commented-out code | 18 October 2019, 00:34:31 UTC |
bb4a2ac | Robert Stepinski | 17 October 2019, 21:22:46 UTC | Enable spriv-opt on spirv (#1076) * Add spirv-tools module and set ENABLE_OPT to be true * Add spirv-headers dependency * Build spirv-opt into glslang project * Add optimization pass * Add generated spirv-opt files Modify solution to avoid obj file conflicts * Add optimization pass to SPIR-V generation * Don't pass additional optimizer options to glslang * Build spirv-opt in Linux | 17 October 2019, 21:22:46 UTC |
1102c53 | jsmall-nvidia | 17 October 2019, 16:06:58 UTC | Feature/gpu unbound array of array (#1083) * Simple testing of unbounded array of array on GPU. * Fix problem on CPU targets around NonUniformResourceIndex Use the unbounded-array-of-array-syntax test for CPU and GPU tests. | 17 October 2019, 16:06:58 UTC |
fb44993 | jsmall-nvidia | 15 October 2019, 19:19:46 UTC | GetDimension on GLSL for StructuredBuffer (#1081) * Fix GetDimensions for glsl. * Add test for Load on RWStructuredBuffer as part of GetDimension. | 15 October 2019, 19:19:46 UTC |
2420f47 | jsmall-nvidia | 11 October 2019, 18:35:07 UTC | CPU unsized array documentation and another example (#1080) * WIP: Unsized arrays on CPU. * unbounded-array-of-array working on CPU. * Test that has an unbounded array of array directly (ie without wrapping with ParameterBlock). Test works on CPU. * Remove some left over comments. * Added documention on unsized array usage on CPU targets. | 11 October 2019, 18:35:07 UTC |
9c17d0b | jsmall-nvidia | 11 October 2019, 18:14:08 UTC | Support for unbounded array of arrays (#1078) * WIP: Unsized arrays on CPU. * unbounded-array-of-array working on CPU. * Remove some left over comments. | 11 October 2019, 18:14:08 UTC |
deeb864 | Robert Stepinski | 11 October 2019, 15:30:32 UTC | Add ability to obfuscate name when generating GLSL/HLSL source (#1075) | 11 October 2019, 15:30:32 UTC |
9a09e2e | jsmall-nvidia | 09 October 2019, 18:24:00 UTC | Feature/decor entry point name (#1073) * Use name hint on EntryPoint naming. * Placed the entry point name on the EntryPointDecoration. | 09 October 2019, 18:24:00 UTC |
0b61643 | jsmall-nvidia | 08 October 2019, 18:29:15 UTC | Fixed from Review of Entry Point decoration #1068 (#1072) * Remove typo around GeometryPrimitiveTypeDecoration * * GeometryPrimitiveTypeDecoration -> GeometryInputPrimitiveTypeDecoration (to try and closer match meaning and the Modifier name) * Remove a small problem around definition of IRGeometryPrimitiveTypeDecoration * Fix comment around IRStreamOutputTypeDecoration | 08 October 2019, 18:29:15 UTC |
c61d529 | jsmall-nvidia | 08 October 2019, 15:50:43 UTC | Remove EntryPointLayout* use in emit logic. (#1071) * Split out EntryPointParamDecoration. * Add profile to EntryPointDecoration. * WIP for GS handling for GLSL. * WIP for StreamOut GLSL * Fixed GLSL geometry output. * Clean up - remove unneeded/commented out code from the entry point change. * Use Op nums to identify GeometryTypeDecorations (as opposed to contained enum). * Remove setSampleRateFlag & doSampleRateInputCheck * Remove EntryPointLayout from emit. * Change to force CI. | 08 October 2019, 15:50:43 UTC |
cae5612 | jsmall-nvidia | 08 October 2019, 13:37:46 UTC | Make CPU/C++ generate a single temporary file name basis that used for both source (if source isn't available as a file) and binaries. (#1070) | 08 October 2019, 13:37:46 UTC |
73a8cb5 | jsmall-nvidia | 08 October 2019, 12:38:24 UTC | Feature/remove entry point layout flags (#1069) * Split out EntryPointParamDecoration. * Add profile to EntryPointDecoration. * WIP for GS handling for GLSL. * WIP for StreamOut GLSL * Fixed GLSL geometry output. * Clean up - remove unneeded/commented out code from the entry point change. * Use Op nums to identify GeometryTypeDecorations (as opposed to contained enum). * Remove setSampleRateFlag & doSampleRateInputCheck | 08 October 2019, 12:38:24 UTC |
dc1e735 | jsmall-nvidia | 08 October 2019, 12:37:53 UTC | Feature/ir entry point profile (#1068) * Split out EntryPointParamDecoration. * Add profile to EntryPointDecoration. * WIP for GS handling for GLSL. * WIP for StreamOut GLSL * Fixed GLSL geometry output. * Clean up - remove unneeded/commented out code from the entry point change. * Use Op nums to identify GeometryTypeDecorations (as opposed to contained enum). | 08 October 2019, 12:37:53 UTC |
7c8527d | jsmall-nvidia | 04 October 2019, 13:46:03 UTC | IR types for subset of Attributes (#1067) * IROutputControlPointsDecoration * IROutputTopologyDecoration * IRPartitioningDecoration * IRDomainDecoration * Use IRPatchConstantDecoration alone for hlsl output. * IRMaxVertexCountDecoration * IRInstanceDecoration * Removed _emitHLSLAttributeSingleString and _emitHLSLAttributeSingleInt Removed GLSLBindingAttribute and just use NumThreadsAttribute * Added IRNumThreadsDecoration. * Added IRNumThreadsDecoration * Fix build problem on x86. Improve diagnostic text based on review. | 04 October 2019, 13:46:03 UTC |
0bc7d9b | jsmall-nvidia | 24 September 2019, 13:00:40 UTC | Added SLANG_PRELUDE_ASSERT to make assert handling more controlable. (#1064) | 24 September 2019, 13:00:40 UTC |
dc76577 | jsmall-nvidia | 23 September 2019, 21:42:14 UTC | CPU Hello World (#1065) * First pass on cpu-hello-world application. * Improvements to cpu-hello-world * Improved documentation around cpu-hello-world. Added information about C++/CPU targets to README.md Referenced cpu-target. | 23 September 2019, 21:42:14 UTC |
e9f0544 | jsmall-nvidia | 23 September 2019, 19:42:06 UTC | Fix for preprocessor defines for C++ / C (#1063) * First pass support for performance profiling * Test across all elements * Fix bug - sourceContents is not used, should use rawSource. * * Add ability to get prelude from API. * Allow specifying source language for render-test * Made it possible to compile a test input file as C++ * Special handling for reflection * Added C++ impl to performance-profile.slang * Remove some clang warnings. * Output profile timings on appveyor and other TC. * Remove passing around of StdWriters (can use global). Small comment improvements. * Fix defines being passed through to Visual Studio. * Fix bug handling preprocessor definitions in Gcc/Clang targets. | 23 September 2019, 19:42:06 UTC |
05af41d | jsmall-nvidia | 23 September 2019, 19:38:25 UTC | Simple test profiling (#1062) * First pass support for performance profiling * Test across all elements * Fix bug - sourceContents is not used, should use rawSource. * * Add ability to get prelude from API. * Allow specifying source language for render-test * Made it possible to compile a test input file as C++ * Special handling for reflection * Added C++ impl to performance-profile.slang * Remove some clang warnings. * Output profile timings on appveyor and other TC. * Remove passing around of StdWriters (can use global). Small comment improvements. | 23 September 2019, 19:38:25 UTC |
ede0792 | jsmall-nvidia | 19 September 2019, 17:02:04 UTC | Disable dx12 half-structured-buffer.slang test, as produces inconsistent results. (#1061) | 19 September 2019, 17:02:04 UTC |
a431d4f | Tim Foley | 18 September 2019, 20:20:22 UTC | Clean up some behavior of operator% (#1060) Work on #1059 The `%` operator in the Slang implementation had several issues, and this change tries to address some of them: * Renamed most occurences of "mod" describing this operator to be "rem" for "remainder" to better match its semantics in HLSL * Split the operator into distinct integer and floating-point variants (`IRem` and `FRem`) to simplify having different codegen for the two * Added floating-point variants of `operator%` and `operator%=` to the stdlib. * Added custom C++ codegen for `kIROp_FRem` such that it maps to the standard C/C++ `remainder()` function * Added custom GLSL codegen so that `kIROp_FRem` maps to the GLSL `mod()` function (which isn't correct...) * Added a test case to confirm that D3D11, D3D12, and CPU targets all agree on the definition of floating-point `%` * Fixed `render-test-tool` to allow a negative integer in a `data=...` specification. This didn't end up being used in the final test, but still seems like a good fix. * Added a customized baseline for the Vulkan flavor of that test to confirm that we are *not* compiling correctly to SPIR-V just yet Addressing the correctness of the output for GLSL/SPIR-V will have to come as a later change given that the operation we want is not exposed directly by unextended GLSL. | 18 September 2019, 20:20:22 UTC |
a4c7cf3 | Tim Foley | 18 September 2019, 18:31:21 UTC | Fix a bug in SSA form creation (#1058) It was possible for a recursive call to `tryRemoveTriviailPhi` to remove/replace a phi node that was already in a list of removal candidates to be processed. When the recursive call returned and that candidate was again considered, its operands would have already been cleared, leading to an assertion failure. This case is what was coming up in practice in a user shader, although I have not been able to reproduce the failure with a more minimal synthetic test yet. This change also changes the SSA creation logic to avoid a runtime crash in the case of a trivial phi that only references itself (which was how the above bug surfaced to the user). The "fix" there is not ideal (it leaves a trivial phi behind), but should be enough to retain semantic correctness if user code ever causes that (corneer-case) code path to execute. It is also expected that such a trivial phi would be removed in later DCE passes anyway. | 18 September 2019, 18:31:21 UTC |
31c7abc | jsmall-nvidia | 18 September 2019, 15:40:59 UTC | Improvements to testing and ABI for CPU (#1057) * WIP: Improving CPU performance/ABI * Optionally output code on CPU for groupThreadID and groupID. * Added ability to set compute dispatch size on command line for render-test. Dispatch compute tests taking into account dispatch size. Added test for semantics are working. * Test using GroupRange. * Fix problem with adding \n for externa diagnostic - to do it if there isn't a \n at the end. Change the ouput order (put result before) so last value is diagnostic string. * Made GroupRange the default exposed CPU ABI entry point style. Removed CPU_EXECUTE test style -as tested via the now cross platform render-test * Split out execution from setup for execution to improve perf. * For better code coverage/testing test all styles of CPU compute entry point. * Improve documentation for ABI changes for CPU code. Add 'expecting' to error message from review. * Fix small typos. | 18 September 2019, 15:40:59 UTC |
3af404d | jsmall-nvidia | 17 September 2019, 16:25:45 UTC | CPU ABI improvements (#1056) * WIP: Improving CPU performance/ABI * Optionally output code on CPU for groupThreadID and groupID. * Added ability to set compute dispatch size on command line for render-test. Dispatch compute tests taking into account dispatch size. Added test for semantics are working. * Test using GroupRange. * Fix problem with adding \n for externa diagnostic - to do it if there isn't a \n at the end. Change the ouput order (put result before) so last value is diagnostic string. | 17 September 2019, 16:25:45 UTC |
3758a50 | jsmall-nvidia | 16 September 2019, 15:06:03 UTC | Remove remaining unused cpu-render-test files/references. (#1054) | 16 September 2019, 15:06:03 UTC |
40d8f3a | jsmall-nvidia | 16 September 2019, 13:38:21 UTC | CPU Performance/Testing improvements (#1055) * First pass of render-test refactor. * Make window construction a function that can choose an implementation. * Remove OpenGL as currently has windows dependency. * Disable Vulkan as Renderer impl has dependency on windows. * Pass Window in as parameter of 'update'. * Add win-window.cpp as was missing. * Fix warning on windows about signs during comparison. * * Added mechanism to add random arrays as buffer inputs and select type * Improved RenderGenerator to generate more types, and to be more careful around int32 ranges. * Added support for security checks (for Visual Studio C++) * Disable Execption handling being on by default when compiling kernels * Added a 'Group' version of the entry point that will evaluate all threads in a group in a single call. In test code use this method if available. * Added -compile-arg to be able to pass arguments to the compile within render-test * Add documention for the _Group execution feature. * Fix some typos in cpu-target.md | 16 September 2019, 13:38:21 UTC |
c2e5d24 | jsmall-nvidia | 13 September 2019, 19:59:15 UTC | Refactor render-test to make cross platform (#1053) * First pass of render-test refactor. * Make window construction a function that can choose an implementation. * Remove OpenGL as currently has windows dependency. * Disable Vulkan as Renderer impl has dependency on windows. * Pass Window in as parameter of 'update'. * Add win-window.cpp as was missing. * Fix warning on windows about signs during comparison. | 13 September 2019, 19:59:15 UTC |
0b6321b | Tim Foley | 13 September 2019, 17:41:11 UTC | Revisions to "new" Slang API based on use in Falcor (#1052) * Revisions to "new" Slang API based on use in Falcor As I've been integrating the new/revised Slang API (using the "COM-lite" interfaces) I've run into some cases where the API was either missing features or didn't really work as originally implemented. This change fixes the gaps/problems that came up. There are two main things here: 1. Some of the routines that returned an `IComponentType*` as a function result weren't actually doing anythign to retain the object they returned (e.g., putting it into a cache). Leaving aside the question of whether we need to add that caching layer, it made sense to instead have the return be through an output argument. Discussion after the initial iteration of the COM-lite API came around to the point that properly reference-counting objects that get returned would be useful if we ever decide we don't like having ever-expanding memory usage for caches of specialized/composed component types. 2. There was no way with the existing API to get at an `IComponentType` that represents an entry point produced during compilation, so that a user could include it in their own composition. This change alters `spCompileRequest_getProgram` to return the global program *without* the entry points, and adds a separate `spCompileRequest_getEntryPoint`. This design lets an application compose whatever combination/layout they want, rather than being stuck with a pre-designed composition baked into the compiler. * fixup: review feedback | 13 September 2019, 17:41:11 UTC |
33f95e0 | jsmall-nvidia | 12 September 2019, 20:38:39 UTC | Fix problems with x86 CPU tests (#1051) * Try to make x86 builds on x86 platforms (not the default for the os). * Use c style include for stdint.h cos not found on x86 linux. * Simplified x86 issue for linux. * Fix typo. * Remove the need for the shared-library category. * Disable CPU tests on linux x86. * Fix typo. * Named test requirement methods so overloading not confusing (around flags, and SlangPassThroughType which are both 'int') | 12 September 2019, 20:38:39 UTC |
bde858b | jsmall-nvidia | 12 September 2019, 14:15:53 UTC | ParameterBlock support. (#1049) * Updated docs to reflect ParameterBlock support * Fixed CPU binding to handle ParameterBlocks * Updated parameter-block.slang to be able to work as a CPU test | 12 September 2019, 14:15:53 UTC |
047daae | jsmall-nvidia | 09 September 2019, 17:54:31 UTC | CPU compute testing on non windows targets (#1045) * WIP: Refactor of CPUCompute and stand alone cpu-render-test * Fix compilation on CygWin. * Make CPU compute tests run on non windows targets. * Check that C/C++ compiler is available for CPU compute. * Fix some tabbing issues. * Add -fPIC on gfx * Use dxcompiler_47.dll from slang-binaries on windows. * make https for git module slang-binaries * Fix comment in premake5.lua around d3dcompiler_47.dll * Add resources to the CPUComputeUtil::Context to keep in scope. * Fixes problem compiling on cygwin where dx12 is included in build of gfx lib. | 09 September 2019, 17:54:31 UTC |
4fc0761 | jsmall-nvidia | 06 September 2019, 17:04:50 UTC | Use d3dcompiler_47.dll from slang-binaries on windows. (#1047) * Use dxcompiler_47.dll from slang-binaries on windows. * make https for git module slang-binaries | 06 September 2019, 17:04:50 UTC |
ef36883 | jsmall-nvidia | 04 September 2019, 20:16:17 UTC | Allow multiple threads to call glslang (#1046) * Allow multiple threads to be able to call into glslang by * Having a single call to glslang::InitializeProcess() per process (in our case dll load) * Explicitly call glslang::InitThread * Fix problem with case in path for linux. * Rename s_processInitializer to g_processInitializer. Move into the function. | 04 September 2019, 20:16:17 UTC |
30083e5 | Tim Foley | 04 September 2019, 16:59:52 UTC | Allow slang-vs-dxc output comparison tets (#1044) We already have test cases that compare `slangc` and `fxc` output (in DXBC assembly). This change adds an option to do the same basic thing for `slangc` and `dxc` (comparing DXIL output). This isn't being enabled for any of our regression tests right now. It is mostly just a useful feature to have when reproducing customer issues that relate to DXIL output in cases where `dxc` can produce a baseline to compare against to isolate the problem. | 04 September 2019, 16:59:52 UTC |
146c343 | jsmall-nvidia | 03 September 2019, 21:41:23 UTC | Make CPUMemoryBinding::Location use a ctor. (#1042) | 03 September 2019, 21:41:23 UTC |
b5b3a8d | jsmall-nvidia | 03 September 2019, 18:36:55 UTC | CPU uniform entry point params (#1041) * * Made entry point parameters a separate entry point * Made CPUMemoryBinding work with entry point parameters/initialize constant buffers * Added isCPUOnly to bindings, because entry point parameters do not layout like constant buffer * entry-point-uniform.slang works on CPU * EntryPointParams -> UniformEntryPointParams Updated CPU documentation. * Update cpu-target.md to removed completed issues. * Only allocate CPU buffers if the size is > 0. Small update to cpu-target doc. | 03 September 2019, 18:36:55 UTC |
ce5fd43 | jsmall-nvidia | 28 August 2019, 20:29:40 UTC | Support for getting git version from IGlobalSession (#1040) * Added slang-tag-version.h and travis code to generate the file. * Generate slang-tag-version.h on appveyor. * Move where slang-tag-version.h is generated on appveyor. * Dump slang-tag-version.h to console on travis. * Cat slang-tag-version.h * Added method getBuildTagVersion to IGlobalSession. Added -v option. | 28 August 2019, 20:29:40 UTC |
fecfb36 | jsmall-nvidia | 28 August 2019, 14:26:48 UTC | Use getElementStride in toIndex. (#1039) Make toIndex and toField methods of Location. | 28 August 2019, 14:26:48 UTC |
6c6be3c | jsmall-nvidia | 27 August 2019, 20:29:04 UTC | Two fixes to avoid random crash on destruction of GLRenderer (#1038) * Two fixes to avoid random crash on destruction of GLRenderer * Use of a weak reference from objects created by GLRenderer, such that GLRenderer dtor can disable those objects assuming GLRenderer is live * Make sure window is not destroyed before the renderer * Used WeakSink for weak pointer. | 27 August 2019, 20:29:04 UTC |
e44a653 | jsmall-nvidia | 27 August 2019, 17:40:16 UTC | Add the prelude to distros. (#1037) | 27 August 2019, 17:40:16 UTC |
2c4307a | jsmall-nvidia | 26 August 2019, 19:45:28 UTC | WIP: CPU sample working with Texture2D (#1033) * WIP: Memory binding. * WIP for binding. * Fix handling of writing to constant buffer. * Fix bug in handling indices. | 26 August 2019, 19:45:28 UTC |
6a0ca6c | jsmall-nvidia | 26 August 2019, 18:52:00 UTC | CPU docs update. (#1035) | 26 August 2019, 18:52:00 UTC |
04465b2 | jsmall-nvidia | 26 August 2019, 13:20:17 UTC | Hotfix/cpu asdouble (#1032) * Fix asdouble in C++ prelude. * Fix small typo | 26 August 2019, 13:20:17 UTC |
06a0e39 | jsmall-nvidia | 22 August 2019, 19:58:28 UTC | WIP: CPU compute coverage (#1030) * Add support for '=' when defining a name in test. * Add support for double intrinsics. * Add support for asdouble Add findOrAddInst - used instead of findOrEmitHoistableInst, for nominal instructions. Support cloning of string literals. C++ working on more compute tests. * Constant buffer support in reflection. Fixed debugging into source for generated C++. buffer-layout.slang works. * Added cpu test result. * Remove some commented out code. Comment on next fixes. * Improvements to reflection CPU code. * C++ working with ByteAddressBuffer. * Enabled more compute tests for CPU. * Enabled more compute tests on CPU. Added support for [] style access to a vector. * Enabled more CPU compute tests. * Handling of buffer-type-splitting.slang Named buffers can be paths to resources * Fix some warnings, remove some dead code. * Fix problem with verification of number of operands for asuint/asint as they can have 1 or 3 operands. asdouble takes 2. * Fix handling in MemoryArena around aligned allocations. That _allocateAlignedFromNewBlock assumed the block allocated has the aligment that was requested and so did not correct the start address. | 22 August 2019, 19:58:28 UTC |
bc392f9 | Tim Foley | 22 August 2019, 16:49:11 UTC | Update signatures for Shader Model 6 functions (#1029) * Update signatures for Shader Model 6 functions We originally culled out list of Shader Model 6 function prototypes from some combination of MSDN and the dxc wiki, but this was when things were in a pre-release state and the names of many functions changed (as well as some functions being added/removed). For this change, I initially tried to look at MSDN, but the documentation there was internally inconsistent and included things like misspellings in function names (which I *hoped* weren't accurate to the real implementation). Instead, I looked at the meta-program input that dxc uses to generate its intrinsic definitions and used that to discover the updated function names along with what was added/removed, a few signature differences, and some extra functions that don't even seem to be documented at all on MSDN> These have *not* been tested in any meaningful way, so this is really a best-effort thing. Given that most of the old functions had the wrong names there was no way for them to be used in working code anyway, so this is unlikely to cause breakage. * fixup: quadLaneID is a uint | 22 August 2019, 16:49:11 UTC |
7258ef4 | jsmall-nvidia | 20 August 2019, 13:43:59 UTC | User defined downstream compiler prelude (#1028) * Added setDownstreamCompilerPrelude Renamed setPassThroughPath to setDownstreamCompilerPath. Fixed tests. Added prelude directory & code to TestToolUtil to setup default preludes for testing/command line apis. * Fix merge problem * Remove hacks to make prelude work by adding a search path as no longer needed with 'user prelude'. * Split up prelude into scalar intrinsics, and types. Use slang.h for main header. slang-cpp-prelude.h can now just include what it needs (relative to prelude directory) and define the few remaining things/work arounds. * Fix typo. | 20 August 2019, 13:43:59 UTC |
3e78e46 | Tim Foley | 19 August 2019, 23:54:54 UTC | Support shifts and a few other ops in front-end constant folding (#1027) The set of supported operations in front-end constant folding was very limited: `+`, `-`, `*`, `/`, and `%`. This meant that enum declarations like: ``` enum MyBits { A = 1 << 0, B = 1 << 1, C = A | C, } ``` would fail to compile, with a claim that the expressions like `1 << 0` aren't compile-time constants. This change adds `<<`, `>>`, `&`, `|`, and `^` to the list of integer operations we will cosntant-fold in the front-end. It also changes one of the declarations in the existing test case for `enum`s to use the added functionality. Note that this change does *not* address the more deep-seated problems with our approach to constant-folding in the front-end. It does not change the constant folding to rely on IR machinery, or to allow for more general `constexpr` functions, and it does not address the fact that constant-folding is currently applied without paying attention to the type (and thus precision) of the original expression. | 19 August 2019, 23:54:54 UTC |
3284144 | jsmall-nvidia | 19 August 2019, 20:26:41 UTC | Testing using a 'naked' ISlangFileSystemExt option. (#1026) | 19 August 2019, 20:26:41 UTC |
f390351 | jsmall-nvidia | 19 August 2019, 19:27:27 UTC | Change handling of paths for backends via replacing the ISlangSharedLibrary mechansim. Use the m_passThroughPaths as set on the Session via the IGlobalSession interface. (#1025) | 19 August 2019, 19:27:27 UTC |
dc6d041 | jsmall-nvidia | 19 August 2019, 18:08:57 UTC | WIP: Compute test running on CPU (#1023) * * Simplify some of test code around CPPCompiler * Test using 'callable' with pass-through * Small cpu doc improvements * Improvements to Clang output parsing. * Remove temporary file (base filename) . * Improve handling of external errors - handle severity. * On error dumping out to 'actual' file for runCPPCompilerCompile. * Small fixes. Set the source language type correctly for pass thru. * Remove warning for test for clang backend c * Preliminary work around making render-test compute potentiall work with CPU. Made ShaderCompiler -> a stateless ShaderCompilerUtil. Means we don't require a Renderer interface to do shader compilation. * Refactor such that CPU test can take place in without Window or Renderer. * Hack to look for prelude in source file directory. Fix bug returning the SharedLibrary for HostCallable. * Compute test running on CPU. * Need the prelude currently in same directly as test. * Hack to remove warning - that then produces an error on appveyor build. Disable running render CPU test on non-windows. * Improve handling of disabling CPU tests on linux. * Added bit-cast.slang working on CPU. | 19 August 2019, 18:08:57 UTC |
c4541e8 | Robert Stepinski | 16 August 2019, 15:30:48 UTC | Fix a typo in core.meta.slang which was causing an assert when (#1024) compiling shaders that used texture2DMS Load() operations | 16 August 2019, 15:30:48 UTC |
77fe3dd | jsmall-nvidia | 15 August 2019, 22:38:59 UTC | A more convoluted #pragma once file identity test, using relative paths. (#1021) * A more convoluted #pragma once file identity test, using relative paths. * Fix bug with passing - to slang as a command line option causes a crash. Ability to set file-system to use on command line. #pragma once tests try with 'normal' and 'read-file' only versions * OSFileSystem -> OSFileSystemExt LoadFileOSFileSystem -> OSFileSystem Implemented OSFileSystem like OSFileSystemExt as as singleton. Fixes to comments. | 15 August 2019, 22:38:59 UTC |
4450660 | jsmall-nvidia | 15 August 2019, 16:11:16 UTC | Fix bug where in emitCPUBinaryForEntryPoint for HostCallable doesn't correctly return the created SharedLibrary. (#1022) | 15 August 2019, 16:11:16 UTC |
27583e9 | jsmall-nvidia | 14 August 2019, 19:02:21 UTC | CPPCompiler::OutputMessage -> CPPCompiler::Diagnostic (#1019) * CPPCompiler::OutputMessage -> CPPCompiler::Diagnostic * Fix problem with merge. * Fix another small merge issue around Diagnostic. | 14 August 2019, 19:02:21 UTC |
dc493d4 | jsmall-nvidia | 14 August 2019, 16:57:33 UTC | Small improvements around C/C++ testing (#1017) * * Simplify some of test code around CPPCompiler * Test using 'callable' with pass-through * Small cpu doc improvements * Improvements to Clang output parsing. * Remove temporary file (base filename) . * Improve handling of external errors - handle severity. * On error dumping out to 'actual' file for runCPPCompilerCompile. * Small fixes. Set the source language type correctly for pass thru. * Remove warning for test for clang backend c | 14 August 2019, 16:57:33 UTC |
ea20066 | jsmall-nvidia | 12 August 2019, 20:28:18 UTC | Ability to set Paths on Pass Through/Back End Compilers (#1010) * Expanded prelude for some other resource types. Disable C++ output for ParameterGroup. * WIP: Layout for CPU. * Fixes to CPU layout. * WIP: The uniform is output, but the variable definition is not. * WIP: Entry point parameters to global scope in C++. Handling of resource types (in so far as outputting) * Some discussion of ABI and different input types. * WIP: More C++ support around resource types. * WIP: Split up variables into different structures on emit. * WIP: Emitting C++ with wrapping up of 'Context' * WIP: C++ code has access to semantic values. Wrap in struct so can use method calls to pass shared state. Disable legalizeResourceTypes and legalizeExistentialTypeLayout * Fix structured buffer layout for CPU. * Remove testing/handling of global uniforms on CPU path. Typo fix. Changed CPU tests to use new CPU calling convention. * Check globals are working. Initalize context to zero globals. * Order the global parameters for C++ ouput by their layout. Note - that layout isn't quite working correctly because the StructuredBuffer<int> the int seems to be consuming uniform space. * Work around for reflection not having all data needed for layout ordering for C++ code. * Output constant buffers as pointers. * Entry point parameters accessed through pointer to struct. * WIP: Layout for CPU is reasonable for test case. * Only output 'f' after float literal if type marks as a float. * Cast construction works on C++. * Made IntrinsicOp::ConvertConstruct to make intent clearer. * C++ handling construction from scalar. Handle access of a scalar with .x. Check default initialization. * Comment about need for split of kIROp_construct. Release build works. * Added support from constructVectorFromScalar to C/C++ target. * Handling of in/out in C/C++. * First pass documentation CPU support. * Improvements to C++/C slang code generation documentation. * Small doc change to include need for mechansim to specify cpp compiler path. * WIP: Being able to set path for backends. * Better handling of swizzling - allow swizzling a scalar into a vector. * Fix missing/broken headers for path setting on session. * Fix for compiling using clang on Windows. * Remove Clang test code. * * Removed spSessionGetGlobalSession - no longer needed because SlangSession is slang::IGlobalSession alias. * Gave Session a ref count on spCreateSession, and have it checked on spDestroySession, so behaves correctly as ISlangUnknown Note that spDestroySession does a release (and checks the ref count on debug builds). It's behaviour could be the same as just release, but this seems closer to the original intention. | 12 August 2019, 20:28:18 UTC |
6fc2c37 | jsmall-nvidia | 12 August 2019, 19:41:41 UTC | Callable CPU code support (#1014) * First pass support for compiling to a loaded shared library. * Improve documentation for cpu target. * Removed the SLANG_COMPILE_FLAG_LOAD_SHARED_LIBRARY flag. Use the SLANG_HOST_CALLABLE code target Document mechanism. * Fix typo in cpp-resource.slang In test code if the target is 'callable' we don't need to compile (indeed there is no source file). * Small refactor using CommandLineCPPCompiler as base class to implement VisualStudioCPPCompiler and GCCCPPCompiler. * Improvements around CPPCompiler. Mechanism to know products produced. Cleaning up products after execution. * Fix multiple definition of 'SourceType' | 12 August 2019, 19:41:41 UTC |
a041621 | jsmall-nvidia | 09 August 2019, 18:14:56 UTC | Small improvements to CPU target docs (#1012) * Small fixes to CPU documentation. * Small typo fixes. | 09 August 2019, 18:14:56 UTC |
97c46dd | jsmall-nvidia | 09 August 2019, 16:40:35 UTC | Fix TeamCity CI issues (#1013) * Added CPU_REFLECTION test option - that has two versions of the reflection output depending on ptr size. * Added 'shared-library' test category. This category is disabled on CI targets that have issues. | 09 August 2019, 16:40:35 UTC |
41247c3 | jsmall-nvidia | 08 August 2019, 21:23:03 UTC | WIP: Preliminary Slang -> C++ code generation (#1009) * Expanded prelude for some other resource types. Disable C++ output for ParameterGroup. * WIP: Layout for CPU. * Fixes to CPU layout. * WIP: The uniform is output, but the variable definition is not. * WIP: Entry point parameters to global scope in C++. Handling of resource types (in so far as outputting) * Some discussion of ABI and different input types. * WIP: More C++ support around resource types. * WIP: Split up variables into different structures on emit. * WIP: Emitting C++ with wrapping up of 'Context' * WIP: C++ code has access to semantic values. Wrap in struct so can use method calls to pass shared state. Disable legalizeResourceTypes and legalizeExistentialTypeLayout * Fix structured buffer layout for CPU. * Remove testing/handling of global uniforms on CPU path. Typo fix. Changed CPU tests to use new CPU calling convention. * Check globals are working. Initalize context to zero globals. * Order the global parameters for C++ ouput by their layout. Note - that layout isn't quite working correctly because the StructuredBuffer<int> the int seems to be consuming uniform space. * Work around for reflection not having all data needed for layout ordering for C++ code. * Output constant buffers as pointers. * Entry point parameters accessed through pointer to struct. * WIP: Layout for CPU is reasonable for test case. * Only output 'f' after float literal if type marks as a float. * Cast construction works on C++. * Made IntrinsicOp::ConvertConstruct to make intent clearer. * C++ handling construction from scalar. Handle access of a scalar with .x. Check default initialization. * Comment about need for split of kIROp_construct. Release build works. * Added support from constructVectorFromScalar to C/C++ target. * Handling of in/out in C/C++. * First pass documentation CPU support. * Improvements to C++/C slang code generation documentation. * Small doc change to include need for mechansim to specify cpp compiler path. * Better handling of swizzling - allow swizzling a scalar into a vector. | 08 August 2019, 21:23:03 UTC |
c1cc93d | jsmall-nvidia | 08 August 2019, 20:09:29 UTC | Make SlangSession an alias for slang::IGlobalSession (#1011) * Make SlangSession an alias for slang::IGlobalSession. Use asInternal/asExternal for casting in slang.cpp Special case handling of asInternal which argument dependent lookup doesn't find. * To improve implementation asInternal/asExternal in slang.cpp - tried making the internal impls forward to the Slang:: implementations. This caused ambiguities (for example when a function has using namespace Slang in it). To avoid these problems and make it clear where implementation is coming from use Slang::asInternal and removed the forwarding functions. Made the impls SLANG_FORCE_INLINE instead of inline. * Made asInternal/asExternal use SLANG_FORCE_INLINE uniformly. | 08 August 2019, 20:09:29 UTC |
2552217 | Tim Foley | 08 August 2019, 18:22:32 UTC | Revise new COM-lite API (#1007) * Revise new COM-lite API This change revises the "COM-lite" API that was recently introduced to try to streamline it and introduce some missing central/base concepts. The central new abstraction in the API is the notion of a "component type," which is a unit of shader code composition. A component type can have: * IR code for some number of functions/types/etc. * Zero or more global shader parameters * Zero or more "entry point" functions at which execution can start * Zero or more "specialization" parameters (types or values that must be filled in before kernel code can be generated) * Zero or more "requirements" (dependencies on other component types that must be satisfied before kernel code can be generated) Both individual compiled modules, and validated entry points are then examples of component types, and we additionally define a few services that apply to all component types: * We can take N component types and compose them to create a new component type that combines their code, shader parameters, entry points, and specialization parameters. A composed component type may also include requirements from the sub-component types, but it is also possible that by composing thing we satisfy requirements (if `A` requires `B`, and we compose `A` and `B`, then the requirement is now satisfied, and doesn't appear on the composite). * We can take a component type with N specialization parameters, and specialize it by giving N compatible specialization arguments. The result of specialization is a new component type with zero specialization parameters. Under the right circumstances the specialzed component type will be layout compatible with the unspecialized one. * One more example that isn't exposed in the public API today is that we can take a component with requirements and "complete" it by automatically composing it with component types that satisfy those requirements. This can be seen as a kind of linking step that pulls together the transitive closure of dependencies. * We can query the layout for the shader parameters and entry points of a component type, for a specific target. * We can query compiled kernel code for an entry point in a component type (for a specific target). This only works for component types with zero specialization parameters and zero requirements. The idea is that by giving users a fairly general algebra of operations on component types, they can compose final programs in ways that meet their requirements. For example, it becomes possible to incrementally "grow" a component type to represent the global root signature for ray tracing shaders as new entry points are added, in such a way that it always stays layout-compatible with kernels that have already been compiled. Much of the implementation work here is in implementing the unifying component type abstraction, and in particular re-writing code that used to assume a program consisted of a flat list of modules and entry points to work with a hierarchical representation that reflects the underlying algebra (e.g., with types to represent composite and specialized component types). There's also a hidden "legacy" case of a component type to deal with some legacy compiler behaviors that can't be directly modeled on top of the simple algebra with modules and entry points. This API is by no means feature-complete or fully developed. It is expected that we will flesh it out more when bringing up application code (e.g., Falcor) on top of the revamped API. One notable thing that went away in this change is explicit support for "entry point groups" and notions of local root signatures (especially the Falcor-specific handling of the `shared` keyword, which a previous change turned into an explicitly supported feature). With the new "building blocks" approach, it should be possible for a DXR application to deal with local root signatures as a matter of policy (on top of the API we provide). If/when we need to provide some kind of emulation of local root signatures for Vulkan (and/or if Vulkan is extended with an explicit notion of local root signatures), we might need to revisit this choice. * Fix debug build There was invalid code inside an `assert()`, so the release build didn't catch it. * fixup: warnings * fixup: more warnings-as-errors * fixup: review notes * fixup: use component type visitors in place of dynamic casting | 08 August 2019, 18:22:32 UTC |
81ce78d | Tim Foley | 06 August 2019, 19:14:52 UTC | Add support for the HLSL "cast from zero" idiom (#1008) If the user writes code like this: MyStruct s = (MyStruct) 0; then we will interpret it as if they had written: MyStruct s = {}; That is, the "cast from zero" idiom will be taken as a legacy syntax for default construction (using an empty initializer list). This will be semantically equivalent to zero-initialization for all existing HLSL code (where `struct` fields can't have default initialization expressions defined), and is the easiest option for us to support in Slang (since we already support default-initialization using empty initializer lists). The implementation of this feature is narrowly scoped: * It only targets explicit cast expressions like `(MyStruct) 0` and not "constructor" syntax like `MyStruct(0)` * It only applies when there is a single argument that is exactly an integer literal with a zero value (not a reference to a `static const int` that happens to be zero). This change adds a test case to make sure that the feature works as expected. Because it relies on our existing initializer-list handling, the "cast from zero" idiom should work for any user-defined type where an initializer list would work. | 06 August 2019, 19:14:52 UTC |
8975854 | Tim Foley | 29 July 2019, 21:55:04 UTC | Fix issue with outputting "static" in GLSL (#1006) This appears to be a regression introduced in #1001, and missed because none of our existing tests covered `static const` arrays on the GLSL/SPIR-V targets. The basic problem is that we cannot output a `static const` definition in GLSL because `static` is a reserved word and not a keyword. Instead for GLSL we just want a `const` array. This change makes the emission of `static` for global-scope constants key on the target language for code generation, and only emit it for HLSL, C, and C++. This change also adds a test case specifically for running Slang input that has a `static const` array on the Vulkan target. | 29 July 2019, 21:55:04 UTC |