Attribute location wasn't incrementing for SPIRV-GLSL output. This patch fixes it.
Change-Id: If3f0adf770d0951855ac8413e29b50b40729d1e1
//@ignore:off
INPUT mediump vec2 aPosition;
+INPUT mediump vec2 aTexCoord;
OUTPUT mediump vec2 vTexCoord;
UNIFORM_BLOCK VertBlock
{
#define TEXTURE texture2D
attribute mediump vec2 aPosition;
+attribute mediump vec2 aTexCoord;
varying mediump vec2 vTexCoord;
uniform highp mat4 uMvpMatrix;
uniform highp vec3 uSize;
#define TEXTURE texture
in mediump vec2 aPosition;
+in mediump vec2 aTexCoord;
out mediump vec2 vTexCoord;
layout(std140) uniform VertBlock
{
#define TEXTURE texture
layout(location = 0) in mediump vec2 aPosition;
+layout(location = 1) in mediump vec2 aTexCoord;
layout(location=0) out mediump vec2 vTexCoord;
layout(set=0, binding=0, std140) uniform VertBlock
{
template<class IT>
bool ProcessTokenINPUT(IT& it, Program& program, OutputLanguage lang, ShaderStage stage)
{
- int attributeLocation = 0;
+ int& attributeLocation = program.attributeLocation;
auto& l = *it;
std::string& outString = ((stage == ShaderStage::VERTEX) ? program.vertexShader.output : program.fragmentShader.output);
std::stringstream ss;
std::map<std::string, int> varyings;
int uboBinding{0};
int& samplerBinding{uboBinding}; // sampler bindings and ubo bindings are the same
+ int attributeLocation{0};
};
struct ShaderParserInfo