From 613a29affe272772dfe0c463d866fb0b8c1d42ee Mon Sep 17 00:00:00 2001 From: cheneym2 Date: Tue, 29 Oct 2024 16:42:18 -0400 Subject: Precompiled SPIR-V import support (#5048) * Precompiled SPIR-V import support Adds appropriate linkage and function declaration syntax for SPIR-V functions that are declared, to be imported from another SPIR-V module. Unlike DXIL, stripping the Slang IR for a function down to a declaration requires retaining a block of parameters, as the function declaration must be emitted to SPIR-V with the same parameters as a definition. Because that thwarts the logic in Slang to tell the difference between a declaration and definition, and explicit decoration is introduced to explicitly mark functions which need to be treated as declarations during emit phase. Fixes #4992 Co-authored-by: Yong He --- tests/library/precompiled-spirv-generics.slang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/library/precompiled-spirv-generics.slang') diff --git a/tests/library/precompiled-spirv-generics.slang b/tests/library/precompiled-spirv-generics.slang index a55f58513..64fd8a64c 100644 --- a/tests/library/precompiled-spirv-generics.slang +++ b/tests/library/precompiled-spirv-generics.slang @@ -24,5 +24,5 @@ struct Attributes [shader("anyhit")] void anyhit(inout Payload payload, Attributes attrib) { - payload.val = normalFunc(x * y) + normalFuncUsesGeneric(y); + payload.val = normalFunc(floor(x * y), x) + normalFuncUsesGeneric(y); } -- cgit v1.2.3