- fix use after delete

This commit is contained in:
Magnus Norddahl 2019-05-27 20:03:11 +02:00
commit 9f8cd68211
5 changed files with 71 additions and 15 deletions

View file

@ -76,14 +76,12 @@ void PolyBuffer::Unlock()
void PolyVertexBuffer::SetFormat(int numBindingPoints, int numAttributes, size_t stride, const FVertexBufferAttribute *attrs)
{
for (int j = 0; j < numAttributes; j++)
{
mOffsets[attrs[j].location] = attrs[j].offset;
}
mStride = stride;
VertexFormat = GetPolyFrameBuffer()->GetRenderState()->GetVertexFormat(numBindingPoints, numAttributes, stride, attrs);
}
void PolyVertexBuffer::Load(PolyTriangleThreadData *thread, const void *vertices, int index)
/////////////////////////////////////////////////////////////////////////////
void PolyVertexInputAssembly::Load(PolyTriangleThreadData *thread, const void *vertices, int index)
{
const uint8_t *vertex = static_cast<const uint8_t*>(vertices) + mStride * index;
const float *attrVertex = reinterpret_cast<const float*>(vertex + mOffsets[VATTR_VERTEX]);