summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWieland Hagen <wieland.hagen@kdab.com>2017-09-06 17:20:17 +0200
committerWieland Hagen <wieland.hagen@kdab.com>2017-09-08 11:53:09 +0000
commitf05cb2bebb0ec8beed0988a27b46bf9d850f4839 (patch)
treeeb82316204ad9a87625513e613c68c7bceddad32
parent414122d2b02862b6f1815fb71083c0a1913d5a44 (diff)
Properly handle byte stride
If a specific byte stride is given by the user, we should expect that he knows how the buffers look. Change-Id: I0ee9a92bf628d3f3fda935e9cd83e7c1150cd089 Reviewed-by: Sean Harmer <sean.harmer@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 e7f8af71c..b13449760 100644
--- a/src/render/graphicshelpers/graphicscontext.cpp
+++ b/src/render/graphicshelpers/graphicscontext.cpp
@@ -1422,7 +1422,7 @@ void GraphicsContext::specifyAttribute(const Attribute *attribute, Buffer *buffe
attr.dataType = attributeDataType;
attr.byteOffset = attribute->byteOffset() + (i * attrCount * typeSize);
attr.vertexSize = attribute->vertexSize() / attrCount;
- attr.byteStride = attribute->byteStride() + (attrCount * attrCount * typeSize);
+ attr.byteStride = (attribute->byteStride() != 0) ? attribute->byteStride() : (attrCount * attrCount * typeSize);
attr.divisor = attribute->divisor();
enableAttribute(attr);