};
layout(location = 0) in mediump vec2 vTexCoord;
-layout(binding = 0) uniform sampler2D sTexture;
+layout(binding = 2) uniform sampler2D sTexture;
-out mediump vec4 fragColor;
+layout(location=0) out mediump vec4 fragColor;
void main()
{
};
layout(location = 0) in mediump vec2 vTexCoord;
-layout(binding = 0) uniform sampler2D sTexture;
+layout(binding = 2) uniform sampler2D sTexture;
#define gl_FragColor _glFragColor
-out mediump vec4 _glFragColor;
+layout(location=0) out mediump vec4 _glFragColor;
void main()
{
gl_FragColor = TEXTURE(sTexture, vTexCoord) * uColor;
else
{
// for fragment shader the gl_FragColor is our output
- // we will use OUT_COLOR
+ // we will use OUT_COLOR, in such shader we have only single output
auto varName = GetToken(l, -1);
- ss << "out" << l.line.substr(l.tokens[0].first + l.tokens[0].second).c_str() << "\n";
+ ss << "layout(location=0) out" << l.line.substr(l.tokens[0].first + l.tokens[0].second).c_str() << "\n";
outString += ss.str();
}
return true;
Shader fragmentShader;
std::map<std::string, int> varyings;
int uboBinding{0};
- int samplerBinding{0};
+ int& samplerBinding{uboBinding}; // sampler bindings and ubo bindings are the same
};
struct ShaderParserInfo