GLSL 1.00 ES must be selected using "#version 100"

I was mistaken before, the "es" part for that version isn't optional, it
*must* be omitted.

Change-Id: I9e83d2317523fb0a905e40b95a56033cf693b93b
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
This commit is contained in:
Kevin Ottens 2017-08-03 17:28:47 +02:00 committed by Simon Hausmann
parent f2c6e10ad5
commit b6c3f55b93
2 changed files with 4 additions and 4 deletions

View File

@ -294,7 +294,7 @@ QByteArray QShaderGenerator::createShaderCode(const QStringList &enabledLayers)
: major == 3 && minor <= 2 ? 100 + 10 * (minor + 3)
: major * 100 + minor * 10;
const auto profile = isGLES ? QByteArrayLiteral(" es")
const auto profile = isGLES && version > 100 ? QByteArrayLiteral(" es")
: version >= 150 && format.api() == QShaderFormat::OpenGLCoreProfile ? QByteArrayLiteral(" core")
: version >= 150 && format.api() == QShaderFormat::OpenGLCompatibilityProfile ? QByteArrayLiteral(" compatibility")
: QByteArray();

View File

@ -220,7 +220,7 @@ void tst_QShaderGenerator::shouldGenerateShaderCode_data()
const auto openGL32 = createFormat(QShaderFormat::OpenGLCoreProfile, 3, 2);
const auto openGL4 = createFormat(QShaderFormat::OpenGLCoreProfile, 4, 0);
const auto versionGLES2 = QByteArrayList() << "#version 100 es" << "";
const auto versionGLES2 = QByteArrayList() << "#version 100" << "";
const auto versionGL3 = QByteArrayList() << "#version 130" << "";
const auto versionGL32 = QByteArrayList() << "#version 150 core" << "";
const auto versionGL4 = QByteArrayList() << "#version 400 core" << "";
@ -298,7 +298,7 @@ void tst_QShaderGenerator::shouldGenerateVersionCommands_data()
QTest::addColumn<QShaderFormat>("format");
QTest::addColumn<QByteArray>("version");
QTest::newRow("GLES2") << createFormat(QShaderFormat::OpenGLES, 2, 0) << QByteArrayLiteral("#version 100 es");
QTest::newRow("GLES2") << createFormat(QShaderFormat::OpenGLES, 2, 0) << QByteArrayLiteral("#version 100");
QTest::newRow("GLES3") << createFormat(QShaderFormat::OpenGLES, 3, 0) << QByteArrayLiteral("#version 300 es");
QTest::newRow("GL20") << createFormat(QShaderFormat::OpenGLNoProfile, 2, 0) << QByteArrayLiteral("#version 110");
@ -659,7 +659,7 @@ void tst_QShaderGenerator::shouldProcessLanguageQualifierAndTypeEnums_data()
<< " fragColor = v0;"
<< "}"
<< "").join("\n");
const auto es2Code = (QByteArrayList() << "#version 100 es"
const auto es2Code = (QByteArrayList() << "#version 100"
<< ""
<< QStringLiteral("%1 highp %2 worldPosition;").arg(toGlsl(qualifierValue, es2))
.arg(toGlsl(typeValue))