Reduces vertex maximum stride to 16

https://wikis.khronos.org/opengl/Vertex_Specification_Best_Practices

> The alignment of any attribute's data should be no less than 4 bytes.

But to make it a bit safer for older drivers we prefer to use 16 bytes
alignment (vec4) for now to match std140.
This commit is contained in:
Vladislav Belov
2026-07-12 17:54:26 +02:00
parent db8c05572f
commit abf444d91c
3 changed files with 4 additions and 7 deletions
+2 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2025 Wildfire Games.
/* Copyright (C) 2026 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -231,10 +231,8 @@ static uint32_t RoundStride(uint32_t stride)
return 4;
if (stride <= 8)
return 8;
if (stride <= 16)
return 16;
return Align<32>(stride);
return Align<16>(stride);
}
// Re-layout by assigning offsets on a first-come first-serve basis,