From 6dbe03c4d15261d0b860d76acaf6d64243213d15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?=
 <jean-michael.celerier@kdab.com>
Date: Thu, 12 Mar 2020 15:20:47 +0100
Subject: [PATCH] Make vulkan-flavored GLSL known to QShaderFormat

Change-Id: I6a3799c35aafa38095b316ee01d14b9db3af5e04
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
---
 src/gui/util/qshaderformat_p.h      | 3 ++-
 src/gui/util/qshadernodesloader.cpp | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gui/util/qshaderformat_p.h b/src/gui/util/qshaderformat_p.h
index c50d7d5729..d9d0378f63 100644
--- a/src/gui/util/qshaderformat_p.h
+++ b/src/gui/util/qshaderformat_p.h
@@ -66,7 +66,8 @@ public:
         OpenGLNoProfile,
         OpenGLCoreProfile,
         OpenGLCompatibilityProfile,
-        OpenGLES
+        OpenGLES,
+        VulkanFlavoredGLSL
     };
 
     enum ShaderType : int {
diff --git a/src/gui/util/qshadernodesloader.cpp b/src/gui/util/qshadernodesloader.cpp
index 922479332c..349f11c541 100644
--- a/src/gui/util/qshadernodesloader.cpp
+++ b/src/gui/util/qshadernodesloader.cpp
@@ -217,9 +217,10 @@ void QShaderNodesLoader::load(const QJsonObject &prototypesObject)
                             : api == QStringLiteral("OpenGLNoProfile") ? QShaderFormat::OpenGLNoProfile
                             : api == QStringLiteral("OpenGLCoreProfile") ? QShaderFormat::OpenGLCoreProfile
                             : api == QStringLiteral("OpenGLCompatibilityProfile") ? QShaderFormat::OpenGLCompatibilityProfile
+                            : api == QStringLiteral("VulkanFlavoredGLSL") ? QShaderFormat::VulkanFlavoredGLSL
                             : QShaderFormat::NoApi);
                 if (format.api() == QShaderFormat::NoApi) {
-                    qWarning() << "Format API must be one of: OpenGLES, OpenGLNoProfile, OpenGLCoreProfile or OpenGLCompatibilityProfile";
+                    qWarning() << "Format API must be one of: OpenGLES, OpenGLNoProfile, OpenGLCoreProfile or OpenGLCompatibilityProfile, VulkanFlavoredGLSL";
                     hasError = true;
                     break;
                 }