Stop generating duplicate vertex binaries.
We would generate multiple vertex binaries that result in the same
HLSL code, eg for vec2 and vec3 vertex attributes. Eliminate
duplicates by using the converted attribute type for testing
for matching binaries.
BUG=angle:599
Change-Id: I061588164577ff9fa69ebb7d8a3f2bf6bb6fe013
Reviewed-on: https://chromium-review.googlesource.com/197830
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/ProgramBinary.h b/src/libGLESv2/ProgramBinary.h
index 9b65d01..be45825 100644
--- a/src/libGLESv2/ProgramBinary.h
+++ b/src/libGLESv2/ProgramBinary.h
@@ -218,16 +218,19 @@
public:
VertexExecutable(rx::Renderer *const renderer,
const VertexFormat inputLayout[MAX_VERTEX_ATTRIBS],
+ const GLenum signature[MAX_VERTEX_ATTRIBS],
rx::ShaderExecutable *shaderExecutable);
~VertexExecutable();
- bool matchesInputLayout(const VertexFormat attributes[MAX_VERTEX_ATTRIBS]) const;
+ bool matchesSignature(const GLenum convertedLayout[MAX_VERTEX_ATTRIBS]) const;
const VertexFormat *inputs() const { return mInputs; }
+ const GLenum *signature() const { return mSignature; }
rx::ShaderExecutable *shaderExecutable() const { return mShaderExecutable; }
private:
VertexFormat mInputs[MAX_VERTEX_ATTRIBS];
+ GLenum mSignature[MAX_VERTEX_ATTRIBS];
rx::ShaderExecutable *mShaderExecutable;
};