Towards a simpler SkSL -> GLSL pipeline (and better shader reflection)
The pretty printer didn't actually need the original (separate) strings,
so make it just operate on a single SkSL::String. Also remove the unused
line numbering, and the unit test. (Testing of test code, yay!)
With that done, cut down on passing around arrays of char* + length, and
just do the compaction to a single SkSL::String in the program builder.
Change-Id: Ieef9d9a8e3c5620c011b17477f1b0f9a9faa6273
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208226
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
index 96eb4fd..504c976 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
@@ -22,8 +22,6 @@
// We push back some dummy pointers which will later become our header
for (int i = 0; i <= kCode; i++) {
fShaderStrings.push_back();
- fCompilerStrings.push_back(nullptr);
- fCompilerStringLengths.push_back(0);
}
this->main() = "void main() {";
@@ -252,8 +250,7 @@
this->code().append("}");
for (int i = 0; i <= fCodeIndex; i++) {
- fCompilerStrings[i] = fShaderStrings[i].c_str();
- fCompilerStringLengths[i] = (int)fShaderStrings[i].size();
+ fCompilerString.append(fShaderStrings[i].c_str(), fShaderStrings[i].size());
}
fFinalized = true;