summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-10-05 22:55:59 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-10-24 10:06:55 +0000
commit799f10bfa9cccbf9a5628c19df9ce28205754b69 (patch)
tree4a9e2751089f4ea0150b94c46a7887983fad80ad
parentd4cbcdb37b505ecc2e8beaa141237e2830f0ef4e (diff)
GraphicsContext: remove misleading check in specifyAttribute()
The 'location' argument is checked for non-negativeness first thing in the function, and is not modified in between, so the re-check in the loop is both unneeded and misleading, as it suggests that the variable may have changed from the previous test. Fix by removing the second check. Introduced by 8c1e1df4be02de8d64807d7abeccedc6becd3076, which means only 5.7+ is affected. Coverity-Id: 168546 Change-Id: I3adc0ace2eac234142ab856738e553b1a7e76e1f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r--src/render/graphicshelpers/graphicscontext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/render/graphicshelpers/graphicscontext.cpp b/src/render/graphicshelpers/graphicscontext.cpp
index 3a67db729..7a72e5e87 100644
--- a/src/render/graphicshelpers/graphicscontext.cpp
+++ b/src/render/graphicshelpers/graphicscontext.cpp
@@ -1198,7 +1198,7 @@ void GraphicsContext::specifyAttribute(const Attribute *attribute, Buffer *buffe
VAOVertexAttribute attr;
attr.bufferHandle = glBufferHandle;
attr.bufferType = bufferType;
- attr.location = (location >= 0 ? location + i : location);
+ attr.location = location + i;
attr.dataType = attributeDataType;
attr.byteOffset = attribute->byteOffset() + (i * attrCount * typeSize);
attr.vertexSize = attribute->vertexSize() / attrCount;