From 47b43f8b15ef35c520b9b287fd17ff25e36bfe95 Mon Sep 17 00:00:00 2001 From: Dietrich Geisler Date: Mon, 29 Jun 2020 17:42:12 -0400 Subject: Backend for Multiple Entry Points (#1411) * Backend for Multiple Entry Points Introduces the basic backend on the compiler for zero or more entry points. Entry points have been extended to lists for several functions, with loopFunctions have been extended to take in entry points and indices as appropriate, to allow for multiple entry points once the frontend is expanded. Several functions are currently being assumed to have a single entry point for simplicity and provide a work in progress commit. * Progress on debugging fixes * Tests passing * Refactored emitEntryPoints * Updated lists to be by constant reference * Fixes to formatting * Refactoring updates for the compiler * Fix for compilation errors * Reformatting * More reformatting * Moved struct around to help with compilation Co-authored-by: Tim Foley --- source/slang/slang-dxc-support.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-dxc-support.cpp') diff --git a/source/slang/slang-dxc-support.cpp b/source/slang/slang-dxc-support.cpp index ffcc405c8..4fdb55e29 100644 --- a/source/slang/slang-dxc-support.cpp +++ b/source/slang/slang-dxc-support.cpp @@ -82,7 +82,10 @@ 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; - SLANG_RETURN_ON_FAIL(emitEntryPointSource(compileRequest, entryPointIndex, targetReq, CodeGenTarget::HLSL, endToEndReq, source)); + List entryPointIndices; + entryPointIndices.add(entryPointIndex); + SLANG_RETURN_ON_FAIL(emitEntryPointsSource(compileRequest, entryPointIndices, + targetReq, CodeGenTarget::HLSL, endToEndReq, source)); const auto& hlslCode = source.source; @@ -190,7 +193,9 @@ namespace Slang args[argCount++] = L"-enable-16bit-types"; } - const String sourcePath = calcSourcePathForEntryPoint(endToEndReq, entryPointIndex); + List entryPointIndices2; + entryPointIndices.add(entryPointIndex); + const String sourcePath = calcSourcePathForEntryPoints(endToEndReq, entryPointIndices2); ComPtr dxcResult; SLANG_RETURN_ON_FAIL(dxcCompiler->Compile(dxcSourceBlob, -- cgit v1.2.3