From 3638e7735be67c8f4dae3f4544134441aa1e029d Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 21 Apr 2022 13:47:18 -0400 Subject: `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. --- source/slang/slang-artifact.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-artifact.cpp') diff --git a/source/slang/slang-artifact.cpp b/source/slang/slang-artifact.cpp index 612c2365d..770f2202a 100644 --- a/source/slang/slang-artifact.cpp +++ b/source/slang/slang-artifact.cpp @@ -148,6 +148,13 @@ static const KindExtension g_cpuKindExts[] = { switch (payload) { + case Payload::DXBC: + { + // It seems as if DXBC is potentially linkable from + // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-keywords#export + return true; + } + case Payload::DXIL: case Payload::PTX: case Payload::SPIRV: @@ -397,16 +404,18 @@ SlangResult Artifact::requireFilePath(Keep keep, String& outFilePath) auto parentDir = Path::getParentDirectory(path); if (parentDir.getLength()) { - // Prefix the lib + // Combine the name with path if their is a parent path = Path::combine(parentDir, buf); } else { + // Just use the name as is path = buf; } } } + // If there is an extension append it if (ext.getLength()) { path.appendChar('.'); -- cgit v1.2.3