Commit 2c7d84ac by Jamie Madill

Store un-linked shader attributes in ProgramBinary.

Our caching of compiled vertex shaders according to their input signature needs a consistent input signature to match up shaders. Since the linking step currently shuffles attributes according to API specified locations we need a separate list. BUG=angle:560 Change-Id: Icc4d5df1d37ae895d5c882b86e60f05b5c268461 Reviewed-on: https://chromium-review.googlesource.com/185193Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent c5a83000
......@@ -1039,6 +1039,8 @@ bool ProgramBinary::load(InfoLog &infoLog, const void *binary, GLsizei length)
std::string name;
stream.read(&name);
mLinkedAttribute[i].name = name;
stream.read(&mShaderAttributes[i].type);
stream.read(&mShaderAttributes[i].name);
stream.read(&mSemanticIndex[i]);
}
......@@ -1258,6 +1260,8 @@ bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length)
{
stream.write(mLinkedAttribute[i].type);
stream.write(mLinkedAttribute[i].name);
stream.write(mShaderAttributes[i].type);
stream.write(mShaderAttributes[i].name);
stream.write(mSemanticIndex[i]);
}
......@@ -1529,6 +1533,8 @@ bool ProgramBinary::linkAttributes(InfoLog &infoLog, const AttributeBindings &at
const sh::Attribute &attribute = activeAttributes[attributeIndex];
const int location = attribute.location == -1 ? attributeBindings.getAttributeBinding(attribute.name) : attribute.location;
mShaderAttributes[attributeIndex] = attribute;
if (location != -1) // Set by glBindAttribLocation or by location layout qualifier
{
const int rows = AttributeRegisterCount(attribute.type);
......
......@@ -212,6 +212,7 @@ class ProgramBinary : public RefCountObject
rx::ShaderExecutable *mPixelExecutable;
sh::Attribute mLinkedAttribute[MAX_VERTEX_ATTRIBS];
sh::Attribute mShaderAttributes[MAX_VERTEX_ATTRIBS];
int mSemanticIndex[MAX_VERTEX_ATTRIBS];
int mAttributesByLayout[MAX_VERTEX_ATTRIBS];
......
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