| 1602 | }; |
| 1603 | |
| 1604 | void CacheDataForIteration(QVector<CachedElData> &cache, const rdcarray<ShaderConstant> &columns, |
| 1605 | const rdcarray<BufferElementProperties> &props, |
| 1606 | const QList<BufferData *> buffers, uint32_t inst) |
| 1607 | { |
| 1608 | cache.reserve(columns.count()); |
| 1609 | |
| 1610 | for(int col = 0; col < columns.count(); col++) |
| 1611 | { |
| 1612 | const ShaderConstant &el = columns[col]; |
| 1613 | const BufferElementProperties &prop = props[col]; |
| 1614 | |
| 1615 | CachedElData d; |
| 1616 | |
| 1617 | d.el = ⪙ |
| 1618 | d.prop = ∝ |
| 1619 | |
| 1620 | d.byteSize = el.type.arrayByteStride; |
| 1621 | d.nulls = QByteArray(d.byteSize, '\0'); |
| 1622 | d.numColumns = el.type.columns; |
| 1623 | |
| 1624 | if(prop.instancerate > 0) |
| 1625 | d.instIdx = inst / prop.instancerate; |
| 1626 | |
| 1627 | if(prop.buffer < buffers.size()) |
| 1628 | { |
| 1629 | d.data = buffers[prop.buffer]->data(); |
| 1630 | d.end = buffers[prop.buffer]->end(); |
| 1631 | |
| 1632 | d.stride = buffers[prop.buffer]->stride; |
| 1633 | |
| 1634 | d.data += el.byteOffset; |
| 1635 | |
| 1636 | if(prop.perinstance) |
| 1637 | d.data += d.stride * d.instIdx; |
| 1638 | } |
| 1639 | |
| 1640 | if(prop.perprimitive) |
| 1641 | d.end = d.data; |
| 1642 | |
| 1643 | cache.push_back(d); |
| 1644 | } |
| 1645 | } |
| 1646 | |
| 1647 | static void ConfigureStatusColumn(rdcarray<ShaderConstant> &columns, |
| 1648 | rdcarray<BufferElementProperties> &props) |