aboutsummaryrefslogtreecommitdiff
path: root/src/libGLESv2/renderer
diff options
context:
space:
mode:
authorGeoff Lang <geofflang@chromium.org>2014-09-09 10:14:17 -0400
committerGeoff Lang <geofflang@chromium.org>2014-09-09 14:23:01 +0000
commit5ac5ae8636968a822cd07ae02b7345989befa7bb (patch)
tree299e6e817cb1e4eae568234b11b0a3cfc1d9316b /src/libGLESv2/renderer
parent63d2fc7f40d626342a0f9a82457b3fe0a81efca7 (diff)
downloadangle-5ac5ae8636968a822cd07ae02b7345989befa7bb.tar.gz
Move assertion into if-block.
Since the loop always goes up to MAX_VERTEX_ATTRIBS, the ASSERTION may be triggered even though no more attributes are enabled. BUG=angle:740 Change-Id: I2bb30d7e9f426ae1a0b8250e65c1fd02107973ac Reviewed-on: https://chromium-review.googlesource.com/217027 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Diffstat (limited to 'src/libGLESv2/renderer')
-rw-r--r--src/libGLESv2/renderer/d3d/DynamicHLSL.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libGLESv2/renderer/d3d/DynamicHLSL.cpp b/src/libGLESv2/renderer/d3d/DynamicHLSL.cpp
index 63f06ab4..c91008a8 100644
--- a/src/libGLESv2/renderer/d3d/DynamicHLSL.cpp
+++ b/src/libGLESv2/renderer/d3d/DynamicHLSL.cpp
@@ -365,13 +365,12 @@ std::string DynamicHLSL::generateVertexShaderForInputLayout(const std::string &s
for (unsigned int attributeIndex = 0; attributeIndex < MAX_VERTEX_ATTRIBS; attributeIndex++)
{
- ASSERT(inputIndex < MAX_VERTEX_ATTRIBS);
-
- const VertexFormat &vertexFormat = inputLayout[inputIndex];
const sh::Attribute &shaderAttribute = shaderAttributes[attributeIndex];
-
if (!shaderAttribute.name.empty())
{
+ ASSERT(inputIndex < MAX_VERTEX_ATTRIBS);
+ const VertexFormat &vertexFormat = inputLayout[inputIndex];
+
// HLSL code for input structure
if (IsMatrixType(shaderAttribute.type))
{