diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2022-04-21 13:47:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-21 13:47:18 -0400 |
| commit | 3638e7735be67c8f4dae3f4544134441aa1e029d (patch) | |
| tree | f59c6965321ddcc5991df2bab3ea507b3ce50292 /tests/library | |
| parent | 34f8b5e722aede018e275324c43055cad9a9ca5a (diff) | |
`export` support in HLSL (#2188)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Compile to a dxil library.
* Added CompileProduct.
* Support handling of ModuleLibrary.
* CacheBehavior -> Cache
* Use CompileProduct for -r references.
* CompileProduct -> Artifact.
* Determining an artifact type on binding.
* Determine binary linkability.
* Added Artifact::exists.
* Added ArtifactKeep.
* Small fixes.
* Small improvements to Artifact.
* Add zip extension.
* Fix some comments.
* Fix multiple adding of PublicDecoration.
Make public output export for DXIL/lib.
Add checking for simpleDecorations such that only added once.
* Use 'whole program' to identify library build.
* Add -target dxil so test infrastructure knows it needs DXC.
Diffstat (limited to 'tests/library')
| -rw-r--r-- | tests/library/library-test.slang | 3 | ||||
| -rw-r--r-- | tests/library/library.slang | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/library/library-test.slang b/tests/library/library-test.slang index 06bb22961..143b1cbe1 100644 --- a/tests/library/library-test.slang +++ b/tests/library/library-test.slang @@ -6,7 +6,7 @@ // This didn't work for lib_6_2 when compiling via DXC (!). Even though it's stated elsewhere the feature is available from 6.1 //TEST:COMPILE: tests/library/library.slang -profile lib_6_3 -target dxil -o tests/library/library.dxil -//DISABLE_TEST:COMPILE: tests/library/library-test.slang -profile cs_6_3 tests/library/library.dxil -o tests/library/library-test.dxil +//TEST:COMPILE: tests/library/library-test.slang -profile lib_6_3 -target dxil -o tests/library/library-test.dxil // It seems that I can't just compile the source containing the entry point/stage with the library/s. // Instead I have to compile all the parts with lib profile, and then link together at the end. @@ -18,6 +18,7 @@ extern int foo(int a); //TEST_INPUT:ubuffer(data=[0 0 0 0 ], stride=4):out,name outputBuffer RWStructuredBuffer<int> outputBuffer; +[shader("compute")] [numthreads(4, 1, 1)] void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) { diff --git a/tests/library/library.slang b/tests/library/library.slang index a9e7e5e7a..fafb1018c 100644 --- a/tests/library/library.slang +++ b/tests/library/library.slang @@ -2,8 +2,13 @@ // library.slang +int doThing(int b) +{ + return b + b + 1; +} + public int foo(int a) { - return a * a + 1; + return a * a + 1 + doThing(a + 2); } |
