Skip to content

Commit 66c4892

Browse files
Mee-guminggo
authored andcommitted
fix attribute location (#20064)
1 parent 6d8b1f5 commit 66c4892

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cocos/navmesh/CCNavMeshDebugDraw.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,16 @@ NavMeshDebugDraw::NavMeshDebugDraw()
4141
_locMVP = _programState->getUniformLocation("u_MVPMatrix");
4242

4343
auto vertexLayout = _programState->getVertexLayout();
44-
vertexLayout->setAttribute("a_position", 0, backend::VertexFormat::FLOAT3, offsetof(V3F_C4F, position), false);
45-
vertexLayout->setAttribute("a_color", 1, backend::VertexFormat::FLOAT4, offsetof(V3F_C4F, color), false);
44+
vertexLayout->setAttribute("a_position",
45+
_programState->getAttributeLocation("a_position"),
46+
backend::VertexFormat::FLOAT3,
47+
offsetof(V3F_C4F, position),
48+
false);
49+
vertexLayout->setAttribute("a_color",
50+
_programState->getAttributeLocation("a_color"),
51+
backend::VertexFormat::FLOAT4,
52+
offsetof(V3F_C4F, color),
53+
false);
4654
vertexLayout->setLayout(sizeof(V3F_C4F));
4755

4856
_beforeCommand.func = CC_CALLBACK_0(NavMeshDebugDraw::onBeforeVisitCmd, this);

0 commit comments

Comments
 (0)