Handle half floats as well for position data

This commit is contained in:
Baldur Karlsson
2014-08-08 13:56:31 +01:00
parent e19daa58e3
commit 9925392042
+15 -3
View File
@@ -718,10 +718,22 @@ void GLReplay::RenderMesh(int frameID, vector<int> eventID, MeshDisplay cfg)
// TODO: we should probably use glBindVertexBuffer, glVertexAttribFormat, glVertexAttribBinding.
// For now just assume things about the format and vbuffer.
RDCASSERT(attr.Format.compType == eCompType_Float && attr.Format.compByteWidth == 4);
gl.glBindBuffer(eGL_ARRAY_BUFFER, m_pDriver->GetResourceManager()->GetLiveResource(vb.Buffer).name);
gl.glVertexAttribPointer(0, attr.Format.compCount, eGL_FLOAT, GL_FALSE, 0, (void *)intptr_t(vb.Offset + attr.RelativeOffset));
if(attr.Format.compType == eCompType_Float && attr.Format.compByteWidth == 4)
{
gl.glVertexAttribPointer(0, attr.Format.compCount, eGL_FLOAT, GL_FALSE, 0, (void *)intptr_t(vb.Offset + attr.RelativeOffset));
}
else if(attr.Format.compType == eCompType_Float && attr.Format.compByteWidth == 2)
{
gl.glVertexAttribPointer(0, attr.Format.compCount, eGL_HALF_FLOAT, GL_FALSE, 0, (void *)intptr_t(vb.Offset + attr.RelativeOffset));
}
else
{
RDCERR("Not handling mesh display of unsupported format");
return;
}
gl.glEnableVertexAttribArray(0);
{