- Pass vertex color and normal via uniform buffer when the attribute isn't available

This commit is contained in:
Magnus Norddahl 2019-03-02 01:56:08 +01:00
commit 05a6896d4f
8 changed files with 38 additions and 14 deletions

View file

@ -89,8 +89,13 @@ int VkRenderPassManager::GetVertexFormat(int numBindingPoints, int numAttributes
VkVertexFormat fmt;
fmt.NumBindingPoints = numBindingPoints;
fmt.Stride = stride;
fmt.UseVertexData = false;
for (int j = 0; j < numAttributes; j++)
{
if (attrs[j].location == VATTR_COLOR)
fmt.UseVertexData = true;
fmt.Attrs.push_back(attrs[j]);
}
VertexFormats.push_back(fmt);
return (int)VertexFormats.size() - 1;
}