Commit eb979bfd by Jamie Madill Committed by Commit Bot

Program: Small cleanup to linkAttributes.

The comment here was incorrect, and the signature passed some redundant arguments. Noticed this when I was looking at the code for Vulkan/glslang. BUG=angleproject:1576 Change-Id: Ie9e7eb7cbe4b65503901b2550e95cd818b7c28c0 Reviewed-on: https://chromium-review.googlesource.com/412324Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 1079bb2e
......@@ -624,7 +624,7 @@ Error Program::link(const ContextState &data)
return NoError();
}
if (!linkAttributes(data, mInfoLog, mAttributeBindings, mState.mAttachedVertexShader))
if (!linkAttributes(data, mInfoLog))
{
return NoError();
}
......@@ -2003,12 +2003,11 @@ bool Program::linkValidateInterfaceBlockFields(InfoLog &infoLog,
return true;
}
// Determines the mapping between GL attributes and Direct3D 9 vertex stream usage indices
bool Program::linkAttributes(const ContextState &data,
InfoLog &infoLog,
const Bindings &attributeBindings,
const Shader *vertexShader)
// Assigns locations to all attributes from the bindings and program locations.
bool Program::linkAttributes(const ContextState &data, InfoLog &infoLog)
{
const auto *vertexShader = mState.getAttachedVertexShader();
unsigned int usedLocations = 0;
mState.mAttributes = vertexShader->getActiveAttributes();
GLuint maxAttribs = data.getCaps().maxVertexAttributes;
......@@ -2028,7 +2027,7 @@ bool Program::linkAttributes(const ContextState &data,
// TODO(jmadill): do staticUse filtering step here, or not at all
ASSERT(attribute.staticUse);
int bindingLocation = attributeBindings.getBinding(attribute.name);
int bindingLocation = mAttributeBindings.getBinding(attribute.name);
if (attribute.location == -1 && bindingLocation != -1)
{
attribute.location = bindingLocation;
......
......@@ -379,10 +379,7 @@ class Program final : angle::NonCopyable, public LabeledObject
void unlink(bool destroy = false);
void resetUniformBlockBindings();
bool linkAttributes(const ContextState &data,
InfoLog &infoLog,
const Bindings &attributeBindings,
const Shader *vertexShader);
bool linkAttributes(const ContextState &data, InfoLog &infoLog);
bool validateUniformBlocksCount(GLuint maxUniformBlocks,
const std::vector<sh::InterfaceBlock> &block,
const std::string &errorMessage,
......
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