mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-29 00:32:18 +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:
@@ -62,7 +62,7 @@ namespace
|
||||
//
|
||||
// Created on a model load and read by a compute shader for each frame where
|
||||
// the model is visible.
|
||||
// InputVertex(size/stride=64):
|
||||
// InputVertex(size/stride=48):
|
||||
// vec4/CVector4D tangent (offset=0)
|
||||
// vec3/CVector3D normal (offset=16)
|
||||
// vec3/CVector3D position (offset=32)
|
||||
@@ -251,7 +251,7 @@ ModelDefRData::ModelDefRData(const CModelDefPtr& modelDef)
|
||||
m_UVArray.FreeBackingStore();
|
||||
}
|
||||
|
||||
ENSURE(m_Array.GetStride() == INPUT_VERTEX_ATTRIBUTE_ALIGNMENT * 4);
|
||||
ENSURE(m_Array.GetStride() == INPUT_VERTEX_ATTRIBUTE_ALIGNMENT * 3);
|
||||
ENSURE(m_Position.offset == INPUT_VERTEX_POSITION_OFFSET);
|
||||
ENSURE(m_Normal.offset == INPUT_VERTEX_NORMAL_OFFSET);
|
||||
ENSURE(m_Tangent.offset == INPUT_VERTEX_TANGENT_OFFSET);
|
||||
|
||||
Reference in New Issue
Block a user