2019-01-30 09:35:17 +08:00
|
|
|
#include "3d/CCBundle3DData.h"
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_BEGIN
|
2019-01-30 09:35:17 +08:00
|
|
|
|
|
|
|
int MeshVertexAttrib::getAttribSizeBytes() const
|
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
switch (type)
|
|
|
|
{
|
2019-02-22 14:06:26 +08:00
|
|
|
case backend::VertexFormat::FLOAT4:
|
|
|
|
case backend::VertexFormat::INT4:
|
2019-01-30 09:35:17 +08:00
|
|
|
return 16;
|
2019-02-22 14:06:26 +08:00
|
|
|
case backend::VertexFormat::FLOAT3:
|
|
|
|
case backend::VertexFormat::INT3:
|
2019-01-30 09:35:17 +08:00
|
|
|
return 12;
|
2019-02-22 14:06:26 +08:00
|
|
|
case backend::VertexFormat::FLOAT2:
|
|
|
|
case backend::VertexFormat::INT2:
|
|
|
|
case backend::VertexFormat::USHORT4:
|
2019-01-30 09:35:17 +08:00
|
|
|
return 8;
|
2019-02-22 14:06:26 +08:00
|
|
|
case backend::VertexFormat::FLOAT:
|
|
|
|
case backend::VertexFormat::INT:
|
|
|
|
case backend::VertexFormat::UBYTE4:
|
|
|
|
case backend::VertexFormat::USHORT2:
|
2019-01-30 09:35:17 +08:00
|
|
|
return 4;
|
|
|
|
default:
|
2022-07-16 10:43:05 +08:00
|
|
|
AXASSERT(false, "VertexFormat convert to size error");
|
2019-01-30 09:35:17 +08:00
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
NS_AX_END
|