put sksl->glsl modifiers in correct order
authorEthan Nicholas <ethannicholas@google.com>
Thu, 9 Mar 2017 21:35:09 +0000 (16:35 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 10 Mar 2017 15:49:04 +0000 (15:49 +0000)
BUG=skia:6352

Change-Id: I7cdf6fa9c5b48fd2686c5cfc28c594bd291feea5
Reviewed-on: https://skia-review.googlesource.com/9520
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
src/sksl/SkSLGLSLCodeGenerator.cpp

index 35a2f62..a19de8f 100644 (file)
@@ -532,6 +532,10 @@ void GLSLCodeGenerator::writeModifiers(const Modifiers& modifiers,
     if (modifiers.fFlags & Modifiers::kNoPerspective_Flag) {
         this->write("noperspective ");
     }
+    SkString layout = modifiers.fLayout.description();
+    if (layout.size()) {
+        this->write(layout + " ");
+    }
     if (modifiers.fFlags & Modifiers::kReadOnly_Flag) {
         this->write("readonly ");
     }
@@ -547,10 +551,6 @@ void GLSLCodeGenerator::writeModifiers(const Modifiers& modifiers,
     if (modifiers.fFlags & Modifiers::kRestrict_Flag) {
         this->write("restrict ");
     }
-    SkString layout = modifiers.fLayout.description();
-    if (layout.size()) {
-        this->write(layout + " ");
-    }
     if ((modifiers.fFlags & Modifiers::kIn_Flag) &&
         (modifiers.fFlags & Modifiers::kOut_Flag)) {
         this->write("inout ");