Commit 3618d296 authored by Christopher Tenter's avatar Christopher Tenter

skip custom polyline properties unbound to shaders in updateVBO

parent ac96a097
......@@ -531,6 +531,8 @@ updateVBO() {
typename PolyLine::CustomPropertyHandle proph = polyline_.enumerate_custom_property_handles(i);
const void* propDataBuf = polyline_.get_custom_property_buffer(proph);
typename std::map< typename PolyLine::CustomPropertyHandle, int >::iterator mapEntry = polylinePropMap_.find(proph);
......@@ -542,13 +544,13 @@ updateVBO() {
ACG::VertexElement desc;
unsigned int propSize = 0;
polyline_.get_custom_property_shader_binding(proph, &propSize, &desc.shaderInputName_, &desc.type_);
if (polyline_.get_custom_property_shader_binding(proph, &propSize, &desc.shaderInputName_, &desc.type_)) {
// assume aligned memory without byte padding
desc.numElements_ = propSize / VertexDeclaration::getGLTypeSize(desc.type_);
desc.pointer_ = 0;
// assume aligned memory without byte padding
desc.numElements_ = propSize / VertexDeclaration::getGLTypeSize(desc.type_);
desc.pointer_ = 0;
polylinePropMap_[proph] = addCustomBuffer(desc, propDataBuf);
polylinePropMap_[proph] = addCustomBuffer(desc, propDataBuf);
}
}
else // otherwise update pointer of property data buffer
setCustomBuffer(mapEntry->second, propDataBuf);
......
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