forked from qt-creator/qt-creator
Use the GLSL/ES system library by default.
This commit is contained in:
@@ -78,7 +78,8 @@ public:
|
|||||||
Variant_VertexShader = 0x00200000,
|
Variant_VertexShader = 0x00200000,
|
||||||
Variant_FragmentShader = 0x00400000,
|
Variant_FragmentShader = 0x00400000,
|
||||||
Variant_Reserved = 0x80000000,
|
Variant_Reserved = 0x80000000,
|
||||||
Variant_Mask = 0xFFFF0000
|
Variant_Mask = 0xFFFF0000,
|
||||||
|
Variant_All = 0xFFFF0000
|
||||||
};
|
};
|
||||||
|
|
||||||
union Value {
|
union Value {
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ bool GLSLEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er
|
|||||||
parseGlslFile(QLatin1String("glsl_120.frag"), &m_glsl_120_frag);
|
parseGlslFile(QLatin1String("glsl_120.frag"), &m_glsl_120_frag);
|
||||||
parseGlslFile(QLatin1String("glsl_120.vert"), &m_glsl_120_vert);
|
parseGlslFile(QLatin1String("glsl_120.vert"), &m_glsl_120_vert);
|
||||||
parseGlslFile(QLatin1String("glsl_120_common.glsl"), &m_glsl_120_common);
|
parseGlslFile(QLatin1String("glsl_120_common.glsl"), &m_glsl_120_common);
|
||||||
|
parseGlslFile(QLatin1String("glsl_es_100.frag"), &m_glsl_es_100_frag);
|
||||||
|
parseGlslFile(QLatin1String("glsl_es_100.vert"), &m_glsl_es_100_vert);
|
||||||
|
parseGlslFile(QLatin1String("glsl_es_100_common.glsl"), &m_glsl_es_100_common);
|
||||||
|
|
||||||
|
|
||||||
// m_modelManager = new ModelManager(this);
|
// m_modelManager = new ModelManager(this);
|
||||||
@@ -251,9 +254,8 @@ QByteArray GLSLEditorPlugin::glslFile(const QString &fileName)
|
|||||||
|
|
||||||
void GLSLEditorPlugin::parseGlslFile(const QString &fileName, InitFile *initFile)
|
void GLSLEditorPlugin::parseGlslFile(const QString &fileName, InitFile *initFile)
|
||||||
{
|
{
|
||||||
const int variant = GLSL::Lexer::Variant_GLSL_Qt | // ### hardcoded
|
// Parse the builtins for any langugage variant so we can use all keywords.
|
||||||
GLSL::Lexer::Variant_VertexShader |
|
const int variant = GLSL::Lexer::Variant_All;
|
||||||
GLSL::Lexer::Variant_FragmentShader;
|
|
||||||
|
|
||||||
const QByteArray code = glslFile(fileName);
|
const QByteArray code = glslFile(fileName);
|
||||||
initFile->engine = new GLSL::Engine();
|
initFile->engine = new GLSL::Engine();
|
||||||
@@ -263,17 +265,21 @@ void GLSLEditorPlugin::parseGlslFile(const QString &fileName, InitFile *initFile
|
|||||||
|
|
||||||
const GLSLEditorPlugin::InitFile *GLSLEditorPlugin::fragmentShaderInit() const
|
const GLSLEditorPlugin::InitFile *GLSLEditorPlugin::fragmentShaderInit() const
|
||||||
{
|
{
|
||||||
return &m_glsl_120_frag;
|
// TODO: select the correct language variant
|
||||||
|
//return &m_glsl_120_frag;
|
||||||
|
return &m_glsl_es_100_frag;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GLSLEditorPlugin::InitFile *GLSLEditorPlugin::vertexShaderInit() const
|
const GLSLEditorPlugin::InitFile *GLSLEditorPlugin::vertexShaderInit() const
|
||||||
{
|
{
|
||||||
return &m_glsl_120_vert;
|
//return &m_glsl_120_vert;
|
||||||
|
return &m_glsl_es_100_vert;
|
||||||
}
|
}
|
||||||
|
|
||||||
const GLSLEditorPlugin::InitFile *GLSLEditorPlugin::shaderInit() const
|
const GLSLEditorPlugin::InitFile *GLSLEditorPlugin::shaderInit() const
|
||||||
{
|
{
|
||||||
return &m_glsl_120_common;
|
//return &m_glsl_120_common;
|
||||||
|
return &m_glsl_es_100_common;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_EXPORT_PLUGIN(GLSLEditorPlugin)
|
Q_EXPORT_PLUGIN(GLSLEditorPlugin)
|
||||||
|
|||||||
@@ -115,6 +115,9 @@ private:
|
|||||||
InitFile m_glsl_120_frag;
|
InitFile m_glsl_120_frag;
|
||||||
InitFile m_glsl_120_vert;
|
InitFile m_glsl_120_vert;
|
||||||
InitFile m_glsl_120_common;
|
InitFile m_glsl_120_common;
|
||||||
|
InitFile m_glsl_es_100_frag;
|
||||||
|
InitFile m_glsl_es_100_vert;
|
||||||
|
InitFile m_glsl_es_100_common;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user