summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-repro.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-12-10 14:04:29 -0500
committerGitHub <noreply@github.com>2020-12-10 14:04:29 -0500
commit4337338ed2d9525b4638f32c6b91ef61b69e41cd (patch)
treebade08ed9e1b835a73fe97b5ecb331ae940fee86 /source/slang/slang-repro.cpp
parente4a8251749cf1fbf005b045e26e25f3ef7cccb8b (diff)
Building with embedded stdlib (#1634)
* #include an absolute path didn't work - because paths were taken to always be relative. * Move reflection to reflection-api. * Slight reorg to pull out potentially Slang internal functions from the reflection API impls. * Remove visual studio projects * Fix for slang-binaries copy. * Add the visual studio projects in build/visual-studio * Remove miniz project. * Differentiate the linePath from the filePath. * Improve comment in premake5.lua + to kick of CI. * Kick CI. * Use COM compile request for calls to functions inside api-less-slang. Add static-slang project. * Fix const typo issue. * Don't include 'core' link in 'api-less-slang' * Removed static-slang lib causes problems on linux with linking. Embed Slang stdlib Added StaticBlob Added dumpSourceBytes Use ConstArrayView for the archive. At startup allow loading of zip with stdlib. Made -save-stdlib -load-stdlib take a name Added '-save-stdlib-bin-source' to save out serialized stdlib as source. * Ability enable/disable stdlib embedding. * Fix problem with moduleDecl not having module pointer set when serialized in. * Set of debugdir for slang-test and examples. * Add slang-stdlib-api.cpp * Update slang filters for VS. * Try to use pic, and -mcmodel=medium * Some more efforts ot make premake work. * WIP premake5.lua from previously working version. * Remove api-less-slang project. * Disable dllexport on gcc/clang. * Embed via slangc-bootstrap. * Fix slang-profile. Always compiles without stdlib. * Use pic "On" * Remove slangc-bootstrap and embed-stdlib-generator if embedding not required. Make bootstrap run the generators. * Improve comments in premake5.lua. Kick off another CI build. * Remove generation of stdlib source from std-lib-serialize.slang
Diffstat (limited to 'source/slang/slang-repro.cpp')
-rw-r--r--source/slang/slang-repro.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/source/slang/slang-repro.cpp b/source/slang/slang-repro.cpp
index 14e341bbc..e47fade70 100644
--- a/source/slang/slang-repro.cpp
+++ b/source/slang/slang-repro.cpp
@@ -881,13 +881,13 @@ struct LoadContext
// Try to set state through API - as doing so means if state stored in multiple places it will be ok
{
- spSetCompileFlags(externalRequest, (SlangCompileFlags)requestState->compileFlags);
- spSetDumpIntermediates(externalRequest, int(requestState->shouldDumpIntermediates));
- spSetLineDirectiveMode(externalRequest, SlangLineDirectiveMode(requestState->lineDirectiveMode));
- spSetDebugInfoLevel(externalRequest, SlangDebugInfoLevel(requestState->debugInfoLevel));
- spSetOptimizationLevel(externalRequest, SlangOptimizationLevel(requestState->optimizationLevel));
- spSetOutputContainerFormat(externalRequest, SlangContainerFormat(requestState->containerFormat));
- spSetPassThrough(externalRequest, SlangPassThrough(request->m_passThrough));
+ externalRequest->setCompileFlags((SlangCompileFlags)requestState->compileFlags);
+ externalRequest->setDumpIntermediates(int(requestState->shouldDumpIntermediates));
+ externalRequest->setLineDirectiveMode(SlangLineDirectiveMode(requestState->lineDirectiveMode));
+ externalRequest->setDebugInfoLevel(SlangDebugInfoLevel(requestState->debugInfoLevel));
+ externalRequest->setOptimizationLevel(SlangOptimizationLevel(requestState->optimizationLevel));
+ externalRequest->setOutputContainerFormat(SlangContainerFormat(requestState->containerFormat));
+ externalRequest->setPassThrough(SlangPassThrough(request->m_passThrough));
request->getBackEndReq()->useUnknownImageFormatAsDefault = requestState->useUnknownImageFormatAsDefault;
linkage->m_obfuscateCode = requestState->obfuscateCode;
@@ -900,7 +900,7 @@ struct LoadContext
for (Index i = 0; i < requestState->targetRequests.getCount(); ++i)
{
TargetRequestState& src = base.asRaw(requestState->targetRequests[i]);
- int index = spAddCodeGenTarget(externalRequest, SlangCompileTarget(src.target));
+ int index = externalRequest->addCodeGenTarget(SlangCompileTarget(src.target));
SLANG_ASSERT(index == i);
auto dstTarget = linkage->targets[index];
@@ -1005,7 +1005,7 @@ struct LoadContext
List<const char*> args = context.toList(srcEntryPoint.specializationArgStrings);
- spAddEntryPointEx(externalRequest, int(srcEntryPoint.translationUnitIndex), name, SlangStage(stage), int(args.getCount()), args.getBuffer());
+ externalRequest->addEntryPointEx(int(srcEntryPoint.translationUnitIndex), name, SlangStage(stage), int(args.getCount()), args.getBuffer());
}
}
@@ -1372,10 +1372,9 @@ static SlangResult _calcCommandLine(OffsetBase& base, ReproUtil::RequestState* r
//cmd.addArg("-profile");
//cmd.addArg(Profile(srcEntryPoint.profile).getName());
-
//List<const char*> args = context.toList(srcEntryPoint.specializationArgStrings);
- //spAddEntryPointEx(externalRequest, int(srcEntryPoint.translationUnitIndex), name, SlangStage(stage), int(args.getCount()), args.getBuffer());
+ //externalRequest->addEntryPointEx(int(srcEntryPoint.translationUnitIndex), name, SlangStage(stage), int(args.getCount()), args.getBuffer());
}
}