Improve Windows vulkan draw performance by reducing the size of a struct.

This commit is contained in:
Sasha Szpakowski
2024-03-10 14:33:29 -03:00
parent b12ecf49d8
commit ec9fb6eb28
5 changed files with 12 additions and 7 deletions
+6 -3
View File
@@ -298,9 +298,12 @@ struct BufferBindings
struct VertexAttributeInfo
{
uint8 bufferIndex;
DataFormat format : 8;
uint16 offsetFromVertex;
uint8 packedFormat;
uint8 bufferIndex;
void setFormat(DataFormat format) { packedFormat = (uint8)format; }
DataFormat getFormat() const { return (DataFormat)packedFormat; }
};
struct VertexBufferLayout
@@ -335,7 +338,7 @@ struct VertexAttributes
enableBits |= (1u << index);
attribs[index].bufferIndex = bufferindex;
attribs[index].format = format;
attribs[index].setFormat(format);
attribs[index].offsetFromVertex = offsetfromvertex;
}