Fix debug annotations and shaders.
The Program refactor inadvertantly broken Debug annotations. Fix this
by correctly passing the path to the temporary shader source in the
first "C" string argument to ShCompile, instead of as the first part
of the source string.
BUG=angleproject:1177
TEST=manual testing with MSVS
Change-Id: Ie77bb11b51645a474b542ddd2ae0f391e019e341
Reviewed-on: https://chromium-review.googlesource.com/306210
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/libANGLE/Shader.cpp b/src/libANGLE/Shader.cpp
index 98fcdca..0b9b4f0 100644
--- a/src/libANGLE/Shader.cpp
+++ b/src/libANGLE/Shader.cpp
@@ -219,7 +219,9 @@
std::stringstream sourceStream;
- int additionalOptions = mImplementation->prepareSourceAndReturnOptions(&sourceStream);
+ std::string sourcePath;
+ int additionalOptions =
+ mImplementation->prepareSourceAndReturnOptions(&sourceStream, &sourcePath);
int compileOptions = (SH_OBJECT_CODE | SH_VARIABLES | additionalOptions);
// Some targets (eg D3D11 Feature Level 9_3 and below) do not support non-constant loop indexes
@@ -231,8 +233,17 @@
}
std::string sourceString = sourceStream.str();
- const char *sourceCString = sourceString.c_str();
- bool result = ShCompile(compilerHandle, &sourceCString, 1, compileOptions);
+ std::vector<const char *> sourceCStrings;
+
+ if (!sourcePath.empty())
+ {
+ sourceCStrings.push_back(sourcePath.c_str());
+ }
+
+ sourceCStrings.push_back(sourceString.c_str());
+
+ bool result =
+ ShCompile(compilerHandle, &sourceCStrings[0], sourceCStrings.size(), compileOptions);
if (!result)
{