GLSL错误:`out'限定符仅适用于GLSL 1.10中的函数参数 [英] GLSL error: `out' qualifier only valid for function parameters in GLSL 1.10

查看:934
本文介绍了GLSL错误:`out'限定符仅适用于GLSL 1.10中的函数参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的着色器有in / out关键字。但是我有GLSL编译错误:'out'限定符仅适用于GLSL 1.10 中的函数参数。着色器有 #version 330 指令。调用 glGetString(GL_SHADING_LANGUAGE_VERSION)返回3.30。

My shaders have in/out keywords. But I've got GLSL compile error: 'out' qualifier only valid for function parameters in GLSL 1.10. Shaders have #version 330 directive. Calling glGetString(GL_SHADING_LANGUAGE_VERSION) returns 3.30.

这是我的项目: github.com/wlad031/ssu-coursework-2016 。输入文件夹中包含着色器。主要源文件是 src / ShaderProgramControl.cpp src / Shader.cpp

Here is my project: github.com/wlad031/ssu-coursework-2016. Input folder contains shaders. Main source files are src/ShaderProgramControl.cpp and src/Shader.cpp. Where is my mistake?

推荐答案

在您的src / FileReader.cpp中,您有:

In your src/FileReader.cpp you have :

        if (first != '#') {
            res.push_back(line);
        }

这会剥掉#version 330 ...

And this strips out the #version 330 ...

这篇关于GLSL错误:`out'限定符仅适用于GLSL 1.10中的函数参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆