summaryrefslogtreecommitdiff
path: root/source/slang/slang-dxc-support.cpp
diff options
context:
space:
mode:
authorDietrich Geisler <dag368@cornell.edu>2020-07-07 11:57:56 -0400
committerGitHub <noreply@github.com>2020-07-07 08:57:56 -0700
commit1301f6bc85f4005a548a5a63601689616d511d0b (patch)
treef93d718131451e398fafbe732460eef46da7772c /source/slang/slang-dxc-support.cpp
parentcf62f13cdc8a7f21c78f03b097bff6edf09fdead (diff)
Multiple Entry Point Cleanup (#1427)
* Multiple Entry Point Cleanup This commit provides some in-code cleanup of the previous multiple entry point PR (#1411). Specifically, this PR provides refactoring of multiple entry point functions into helper functions, the removal of the EntryPointAndIndex struct, and various stylistic improvements. * Minor updates Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-dxc-support.cpp')
-rwxr-xr-x[-rw-r--r--]source/slang/slang-dxc-support.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/slang/slang-dxc-support.cpp b/source/slang/slang-dxc-support.cpp
index 1bd4f101a..6f8151921 100644..100755
--- a/source/slang/slang-dxc-support.cpp
+++ b/source/slang/slang-dxc-support.cpp
@@ -46,8 +46,8 @@ namespace Slang
}
SlangResult emitDXILForEntryPointUsingDXC(
+ ComponentType* program,
BackEndCompileRequest* compileRequest,
- EntryPoint* entryPoint,
Int entryPointIndex,
TargetRequest* targetReq,
EndToEndCompileRequest* endToEndReq,
@@ -82,9 +82,7 @@ namespace Slang
// Now let's go ahead and generate HLSL for the entry
// point, since we'll need that to feed into dxc.
SourceResult source;
- List<Int> entryPointIndices;
- entryPointIndices.add(entryPointIndex);
- SLANG_RETURN_ON_FAIL(emitEntryPointsSource(compileRequest, entryPointIndices,
+ SLANG_RETURN_ON_FAIL(emitEntryPointSource(compileRequest, entryPointIndex,
targetReq, CodeGenTarget::HLSL, endToEndReq, source));
const auto& hlslCode = source.source;
@@ -170,6 +168,7 @@ namespace Slang
//
args[argCount++] = L"-no-warnings";
+ EntryPoint* entryPoint = program->getEntryPoint(entryPointIndex);
String entryPointName = getText(entryPoint->getName());
OSString wideEntryPointName = entryPointName.toWString();
@@ -193,7 +192,7 @@ namespace Slang
args[argCount++] = L"-enable-16bit-types";
}
- const String sourcePath = calcSourcePathForEntryPoints(endToEndReq, entryPointIndices);
+ const String sourcePath = calcSourcePathForEntryPoint(endToEndReq, entryPointIndex);
ComPtr<IDxcOperationResult> dxcResult;
SLANG_RETURN_ON_FAIL(dxcCompiler->Compile(dxcSourceBlob,