Fetch enough data even for odd vertex attribute offsets. Closes #1007

This commit is contained in:
baldurk
2018-06-05 21:08:06 +01:00
parent 0e826a9263
commit 4de23d8d8b
+5 -1
View File
@@ -1659,12 +1659,16 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r)
bool pi = false;
bool pv = false;
uint32_t maxAttrOffset = 0;
for(const FormatElement &col : m_ModelVSIn->columns)
{
if(col.buffer == vbIdx)
{
used = true;
maxAttrOffset = qMax(maxAttrOffset, col.offset);
if(col.perinstance)
pi = true;
else
@@ -1701,7 +1705,7 @@ void BufferViewer::RT_FetchMeshData(IReplayController *r)
if(used)
{
bytebuf bufdata = r->GetBufferData(vb.resourceId, vb.byteOffset + offset * vb.byteStride,
(maxIdx + 1) * vb.byteStride);
(maxIdx + 1) * vb.byteStride + maxAttrOffset);
buf->data = new byte[bufdata.size()];
memcpy(buf->data, bufdata.data(), bufdata.size());