Commit a0c1b009 authored by Rhys Weatherley's avatar Rhys Weatherley

Shader vars now prefixed with "qt_", not "qgl_".

parent c598118d
......@@ -187,7 +187,7 @@ bool Semantic::visit(IdentifierExpressionAST *ast)
if (Symbol *s = _scope->lookup(*ast->name)) {
_expr.type = s->type();
} else {
if (ast->name->startsWith(QLatin1String("qgl_"))) {
if (ast->name->startsWith(QLatin1String("qt_"))) {
// ### well, at least for now.
} else {
_engine->error(ast->lineno, QString("`%1' was not declared in this scope").arg(*ast->name));
......
......@@ -82,45 +82,45 @@ QString GLSLFileWizard::fileContents(const QString &, ShaderType shaderType) con
switch (shaderType) {
case GLSLFileWizard::VertexShaderES:
str << QLatin1String("attribute highp vec4 qgl_Vertex;\n")
<< QLatin1String("attribute highp vec4 qgl_TexCoord0;\n")
<< QLatin1String("uniform highp mat4 qgl_ModelViewProjectionMatrix;\n")
<< QLatin1String("varying highp vec4 qTexCoord0;\n")
str << QLatin1String("attribute highp vec4 qt_Vertex;\n")
<< QLatin1String("attribute highp vec4 qt_MultiTexCoord0;\n")
<< QLatin1String("uniform highp mat4 qt_ModelViewProjectionMatrix;\n")
<< QLatin1String("varying highp vec4 qt_TexCoord0;\n")
<< QLatin1String("\n")
<< QLatin1String("void main(void)\n")
<< QLatin1String("{\n")
<< QLatin1String(" gl_Position = qgl_ModelViewProjectionMatrix * qgl_Vertex;\n")
<< QLatin1String(" qTexCoord0 = qgl_TexCoord0;\n")
<< QLatin1String(" gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;\n")
<< QLatin1String(" qt_TexCoord0 = qt_MultiTexCoord0;\n")
<< QLatin1String("}\n");
break;
case GLSLFileWizard::FragmentShaderES:
str << QLatin1String("uniform sampler2D qgl_Texture0;\n")
<< QLatin1String("varying highp vec4 qTexCoord0;\n")
str << QLatin1String("uniform sampler2D qt_Texture0;\n")
<< QLatin1String("varying highp vec4 qt_TexCoord0;\n")
<< QLatin1String("\n")
<< QLatin1String("void main(void)\n")
<< QLatin1String("{\n")
<< QLatin1String(" gl_FragColor = texture2D(qgl_Texture0, qTexCoord0.st);\n")
<< QLatin1String(" gl_FragColor = texture2D(qt_Texture0, qt_TexCoord0.st);\n")
<< QLatin1String("}\n");
break;
case GLSLFileWizard::VertexShaderDesktop:
str << QLatin1String("attribute vec4 qgl_Vertex;\n")
<< QLatin1String("attribute vec4 qgl_TexCoord0;\n")
<< QLatin1String("uniform mat4 qgl_ModelViewProjectionMatrix;\n")
<< QLatin1String("varying vec4 qTexCoord0;\n")
str << QLatin1String("attribute vec4 qt_Vertex;\n")
<< QLatin1String("attribute vec4 qt_MultiTexCoord0;\n")
<< QLatin1String("uniform mat4 qt_ModelViewProjectionMatrix;\n")
<< QLatin1String("varying vec4 qt_TexCoord0;\n")
<< QLatin1String("\n")
<< QLatin1String("void main(void)\n")
<< QLatin1String("{\n")
<< QLatin1String(" gl_Position = qgl_ModelViewProjectionMatrix * qgl_Vertex;\n")
<< QLatin1String(" qTexCoord0 = qgl_TexCoord0;\n")
<< QLatin1String(" gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;\n")
<< QLatin1String(" qt_TexCoord0 = qt_MultiTexCoord0;\n")
<< QLatin1String("}\n");
break;
case GLSLFileWizard::FragmentShaderDesktop:
str << QLatin1String("uniform sampler2D qgl_Texture0;\n")
<< QLatin1String("varying vec4 qTexCoord0;\n")
str << QLatin1String("uniform sampler2D qt_Texture0;\n")
<< QLatin1String("varying vec4 qt_TexCoord0;\n")
<< QLatin1String("\n")
<< QLatin1String("void main(void)\n")
<< QLatin1String("{\n")
<< QLatin1String(" gl_FragColor = texture2D(qgl_Texture0, qTexCoord0.st);\n")
<< QLatin1String(" gl_FragColor = texture2D(qt_Texture0, qt_TexCoord0.st);\n")
<< QLatin1String("}\n");
break;
default: break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment