diff options
| author | cheneym2 <acheney@nvidia.com> | 2024-09-05 14:59:28 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-05 11:59:28 -0700 |
| commit | 313677160a186efebf83fab4df7d08dd119a5cd2 (patch) | |
| tree | e12e159846f0b7b0e3567d028ad4a57cd9f001aa /tests/library/precompiled-module-library-resource.slang | |
| parent | 33e8bfd43f66613f6f834fb0e1816ef43071f2e4 (diff) | |
Initial -embed-spirv support (#4974)
* Initial -embed-spirv support
Add support for SPIR-V precompilation using the framework
established for DXIL.
Work on #4883
* SLANG_UNUSED
* Add linkage attributes to exported spirv functions
* Combine DXIL and SPIRV paths
* Whitespace fix
* Merge remaining precompiled spirv/dxil paths
* Change inst accessors to return codegentarget
* Add unit test for precompiled spirv
---------
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'tests/library/precompiled-module-library-resource.slang')
| -rw-r--r-- | tests/library/precompiled-module-library-resource.slang | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/library/precompiled-module-library-resource.slang b/tests/library/precompiled-module-library-resource.slang index 3eeab39d8..35b83b72f 100644 --- a/tests/library/precompiled-module-library-resource.slang +++ b/tests/library/precompiled-module-library-resource.slang @@ -1,9 +1,11 @@ // precompiled-module-library-resource.slang -// Compile this library source with -embed-dxil option. Tests that modules can be -// precompiled to dxil despite having resource parameters or return types. +// Compile this library source with embedded DXIL and SPIRV options. +// Tests that modules can be precompiled to downstream IR despite having resource +// parameters or return types. -//TEST(windows):COMPILE: tests/library/precompiled-module-library-resource.slang -o tests/library/precompiled-module-library-resource.slang-module -embed-dxil -profile lib_6_6 -incomplete-library +//TEST(windows):COMPILE: tests/library/precompiled-module-library-resource.slang -o tests/library/precompiled-module-library-resource-dxil.slang-module -target dxil -embed-downstream-ir -profile lib_6_6 -incomplete-library +//TEST:COMPILE: tests/library/precompiled-module-library-resource.slang -o tests/library/precompiled-module-library-resource-spv.slang-module -target spirv -embed-downstream-ir -incomplete-library module "precompiled-module-library-resource"; @@ -26,13 +28,13 @@ public int resource_in_struct_parameter(ResourceStruct rs) return rs.buffer[0]; } -internal int matrix_in_parameter_internal(int1x1 matrix) +internal float matrix_in_parameter_internal(float2x2 matrix) { return matrix[0][0]; } -public int matrix_in_parameter_public(int a) +public float matrix_in_parameter_public(float a) { - int1x1 matrix = {a}; + float2x2 matrix = {a, .2, .3, .4}; return matrix_in_parameter_internal(matrix); } |
