From 1301f6bc85f4005a548a5a63601689616d511d0b Mon Sep 17 00:00:00 2001 From: Dietrich Geisler Date: Tue, 7 Jul 2020 11:57:56 -0400 Subject: 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 --- source/slang/slang-dxc-support.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) mode change 100644 => 100755 source/slang/slang-dxc-support.cpp (limited to 'source/slang/slang-dxc-support.cpp') diff --git a/source/slang/slang-dxc-support.cpp b/source/slang/slang-dxc-support.cpp old mode 100644 new mode 100755 index 1bd4f101a..6f8151921 --- 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 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 dxcResult; SLANG_RETURN_ON_FAIL(dxcCompiler->Compile(dxcSourceBlob, -- cgit v1.2.3