combined mesh vertex buffers into one resource and refactors

This commit is contained in:
Turánszki János
2022-03-01 15:10:19 +01:00
parent 4ddd09ab12
commit daa0f21681
9 changed files with 462 additions and 365 deletions
+12 -11
View File
@@ -670,18 +670,19 @@ void MeshWindow::SetEntity(Entity entity, int subset)
ss += "Vertex count: " + std::to_string(mesh->vertex_positions.size()) + "\n";
ss += "Index count: " + std::to_string(mesh->indices.size()) + "\n";
ss += "Subset count: " + std::to_string(mesh->subsets.size()) + "\n";
ss += "GPU memory: " + std::to_string((mesh->indexBuffer.GetDesc().size + mesh->generalBuffer.GetDesc().size + mesh->streamoutBuffer.GetDesc().size) / 1024.0f / 1024.0f) + " MB\n";
ss += "\nVertex buffers: ";
if (mesh->vertexBuffer_POS.IsValid()) ss += "position; ";
if (mesh->vertexBuffer_UV0.IsValid()) ss += "uvset_0; ";
if (mesh->vertexBuffer_UV1.IsValid()) ss += "uvset_1; ";
if (mesh->vertexBuffer_ATL.IsValid()) ss += "atlas; ";
if (mesh->vertexBuffer_COL.IsValid()) ss += "color; ";
if (mesh->vertexBuffer_PRE.IsValid()) ss += "previous_position; ";
if (mesh->vertexBuffer_BON.IsValid()) ss += "bone; ";
if (mesh->vertexBuffer_TAN.IsValid()) ss += "tangent; ";
if (mesh->streamoutBuffer_POS.IsValid()) ss += "streamout_position; ";
if (mesh->streamoutBuffer_TAN.IsValid()) ss += "streamout_tangents; ";
if (mesh->subsetBuffer.IsValid()) ss += "subset; ";
if (mesh->vb_pos_nor_wind.IsValid()) ss += "position; ";
if (mesh->vb_uv0.IsValid()) ss += "uvset_0; ";
if (mesh->vb_uv1.IsValid()) ss += "uvset_1; ";
if (mesh->vb_atl.IsValid()) ss += "atlas; ";
if (mesh->vb_col.IsValid()) ss += "color; ";
if (mesh->vb_pre.IsValid()) ss += "previous_position; ";
if (mesh->vb_bon.IsValid()) ss += "bone; ";
if (mesh->vb_tan.IsValid()) ss += "tangent; ";
if (mesh->so_pos_nor_wind.IsValid()) ss += "streamout_position; ";
if (mesh->so_tan.IsValid()) ss += "streamout_tangents; ";
if (mesh->subset_view.IsValid()) ss += "subset; ";
if (mesh->IsTerrain()) ss += "\n\nTerrain will use 4 blend materials and blend by vertex colors, the default one is always the subset material and uses RED vertex color channel mask, the other 3 are selectable below.";
meshInfoLabel.SetText(ss);