summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-options.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-12-01 17:29:01 -0500
committerGitHub <noreply@github.com>2020-12-01 17:29:01 -0500
commit200e236d64a02d9e85cb4a459477e073b81f5182 (patch)
tree7c1c7b75eb8d95238afe154ff826ec065767104b /source/slang/slang-options.cpp
parent339422dc91e10d15cf861ba3006025e3cec250c5 (diff)
Make SlangCompileRequest COM type (#1620)
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP for COM CompileRequest. * Add more methods to IGlobalSession. * Fix createCompileRequest. Made slangc tool use COM style methods. * m_ prefix variables in EndToEndCompileRequest
Diffstat (limited to 'source/slang/slang-options.cpp')
-rw-r--r--source/slang/slang-options.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index 60d41ee5c..ab88b489a 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -488,12 +488,12 @@ struct OptionsParser
}
else if (argStr == "-dump-repro")
{
- SLANG_RETURN_ON_FAIL(tryReadCommandLineArgument(sink, arg, &argCursor, argEnd, requestImpl->dumpRepro));
+ SLANG_RETURN_ON_FAIL(tryReadCommandLineArgument(sink, arg, &argCursor, argEnd, requestImpl->m_dumpRepro));
spEnableReproCapture(compileRequest);
}
else if (argStr == "-dump-repro-on-error")
{
- requestImpl->dumpReproOnError = true;
+ requestImpl->m_dumpReproOnError = true;
}
else if (argStr == "-extract-repro")
{
@@ -597,7 +597,7 @@ struct OptionsParser
}
else if(argStr == "-skip-codegen" )
{
- requestImpl->shouldSkipCodegen = true;
+ requestImpl->m_shouldSkipCodegen = true;
}
else if(argStr == "-parameter-blocks-use-register-spaces" )
{
@@ -1170,7 +1170,7 @@ struct OptionsParser
// because fxc/dxc/glslang don't have a facility for taking
// a named entry point and pulling its stage from an attribute.
//
- if(_passThroughRequiresStage(requestImpl->passThrough) )
+ if(_passThroughRequiresStage(requestImpl->m_passThrough) )
{
for( auto& rawEntryPoint : rawEntryPoints )
{
@@ -1513,10 +1513,10 @@ struct OptionsParser
auto targetID = rawTargets[rawOutput.targetIndex].targetID;
auto target = requestImpl->getLinkage()->targets[targetID];
RefPtr<EndToEndCompileRequest::TargetInfo> targetInfo;
- if( !requestImpl->targetInfos.TryGetValue(target, targetInfo) )
+ if( !requestImpl->m_targetInfos.TryGetValue(target, targetInfo) )
{
targetInfo = new EndToEndCompileRequest::TargetInfo();
- requestImpl->targetInfos[target] = targetInfo;
+ requestImpl->m_targetInfos[target] = targetInfo;
}
if (rawOutput.isWholeProgram)
@@ -1556,14 +1556,14 @@ struct OptionsParser
SlangResult parseOptions(
- SlangCompileRequest* compileRequestIn,
+ SlangCompileRequest* inCompileRequest,
int argc,
char const* const* argv)
{
- Slang::EndToEndCompileRequest* compileRequest = (Slang::EndToEndCompileRequest*) compileRequestIn;
+ Slang::EndToEndCompileRequest* compileRequest = asInternal(inCompileRequest);
OptionsParser parser;
- parser.compileRequest = compileRequestIn;
+ parser.compileRequest = inCompileRequest;
parser.requestImpl = compileRequest;
parser.session = (SlangSession*)compileRequest->getSession();
@@ -1573,7 +1573,7 @@ SlangResult parseOptions(
if (sink->getErrorCount() > 0)
{
// Put the errors in the diagnostic
- compileRequest->mDiagnosticOutput = sink->outputBuffer.ProduceString();
+ compileRequest->m_diagnosticOutput = sink->outputBuffer.ProduceString();
}
return res;
@@ -1582,10 +1582,4 @@ SlangResult parseOptions(
} // namespace Slang
-SLANG_API SlangResult spProcessCommandLineArguments(
- SlangCompileRequest* request,
- char const* const* args,
- int argCount)
-{
- return Slang::parseOptions(request, argCount, args);
-}
+