mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user