summaryrefslogtreecommitdiffstats
path: root/source/slang/compiler.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-07-12 14:52:21 -0700
committerGitHub <noreply@github.com>2017-07-12 14:52:21 -0700
commit9058358792fa393e0e92af80f24a54a037aa9691 (patch)
tree156c36903426a4f18f0e4c857d9d9eb987459789 /source/slang/compiler.cpp
parent6101e483ae8ea9e10db2b5a9423af3cc7fafb710 (diff)
parent02f77bbf12981abe376b2d5987684224a50ae4b2 (diff)
Merge pull request #80 from tfoleyNV/falcor-work
Fixes for shader cross-compilation
Diffstat (limited to 'source/slang/compiler.cpp')
-rw-r--r--source/slang/compiler.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/slang/compiler.cpp b/source/slang/compiler.cpp
index 7df978707..284bb200a 100644
--- a/source/slang/compiler.cpp
+++ b/source/slang/compiler.cpp
@@ -236,15 +236,14 @@ namespace Slang
// TODO(tfoley): need a better policy for how we translate diagnostics
// back into the Slang world (although we should always try to generate
// HLSL that doesn't produce any diagnostics...)
- String diagnostics = (char const*) diagnosticsBlob->GetBufferPointer();
- fprintf(stderr, "%s", diagnostics.begin());
- OutputDebugStringA(diagnostics.begin());
+ entryPoint->compileRequest->mSink.diagnoseRaw(
+ FAILED(hr) ? Severity::Error : Severity::Warning,
+ (char const*) diagnosticsBlob->GetBufferPointer());
diagnosticsBlob->Release();
}
if (FAILED(hr))
{
- // TODO(tfoley): What to do on failure?
- exit(1);
+ return List<uint8_t>();
}
return data;
}
@@ -376,9 +375,10 @@ namespace Slang
if (err)
{
- OutputDebugStringA(diagnosticOutput.Buffer());
- fprintf(stderr, "%s", diagnosticOutput.Buffer());
- exit(1);
+ entryPoint->compileRequest->mSink.diagnoseRaw(
+ Severity::Error,
+ diagnosticOutput.begin());
+ return err;
}
return 0;