diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-10-31 15:02:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-31 15:02:18 -0400 |
| commit | f59df3814a514cab01f69a24e3330d13de3f9c92 (patch) | |
| tree | e8178e2ea376556b79d66c342547134f92640f34 /tests/serialization | |
| parent | 72f86c8273b196d204213f02e73ba772201f903d (diff) | |
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.
Diffstat (limited to 'tests/serialization')
4 files changed, 41 insertions, 1 deletions
diff --git a/tests/serialization/serialized-module-entry-point-test.slang b/tests/serialization/serialized-module-entry-point-test.slang new file mode 100644 index 000000000..51bc8a57f --- /dev/null +++ b/tests/serialization/serialized-module-entry-point-test.slang @@ -0,0 +1,10 @@ +// serialized-module-entry-point-test.slang + +//TEST:COMPILE: -module-name module -target hlsl -profile cs_5_0 -entry computeMain tests/serialization/serialized-module-entry-point.slang -o tests/serialization/serialized-module-entry-point.slang-module +//TEST:COMPILE: -module-name module tests/serialization/serialized-module.slang -o tests/serialization/serialized-module.slang-module +//TEST:COMPARE_COMPUTE_EX: -xslang -module-name -xslang module -slang -compute -xslang -r -xslang tests/serialization/serialized-module-entry-point.slang-module -xslang -r -xslang tests/serialization/serialized-module.slang-module + +//TEST_INPUT:ubuffer(data=[0 0 0 0 ], stride=4):dxbinding(0),glbinding(0),out,name outputBuffer + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID);
\ No newline at end of file diff --git a/tests/serialization/serialized-module-entry-point-test.slang.expected.txt b/tests/serialization/serialized-module-entry-point-test.slang.expected.txt new file mode 100644 index 000000000..bc856dafa --- /dev/null +++ b/tests/serialization/serialized-module-entry-point-test.slang.expected.txt @@ -0,0 +1,4 @@ +0 +1 +2 +3 diff --git a/tests/serialization/serialized-module-entry-point.slang b/tests/serialization/serialized-module-entry-point.slang new file mode 100644 index 000000000..412a67ce6 --- /dev/null +++ b/tests/serialization/serialized-module-entry-point.slang @@ -0,0 +1,26 @@ +//TEST_IGNORE_FILE: + +// serialized-module-entry-point.slang + +struct Thing +{ + int a; + int b; +}; + +int foo(Thing thing); + +RWStructuredBuffer<int> outputBuffer; + +[numthreads(4, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + Thing thing; + + int index = (int)dispatchThreadID.x; + + thing.a = index; + thing.b = -index; + + outputBuffer[index] = foo(thing); +} diff --git a/tests/serialization/serialized-module-test.slang b/tests/serialization/serialized-module-test.slang index 63c31e039..b3f1d2149 100644 --- a/tests/serialization/serialized-module-test.slang +++ b/tests/serialization/serialized-module-test.slang @@ -3,7 +3,7 @@ // A test to try out the basics of module // serialization. -//TEST:SIMPLE_EX: tests/serialization/serialized-module.slang -o tests/serialization/serialized-module.slang-module +//TEST:COMPILE: tests/serialization/serialized-module.slang -o tests/serialization/serialized-module.slang-module //TEST:COMPARE_COMPUTE_EX:-slang -compute -xslang -r -xslang tests/serialization/serialized-module.slang-module //import serialized_module; |
