Skip to content

Commit d2e6b81

Browse files
committed
Fix #2819 positionUColor vertex format mismatch
1 parent 3a3fece commit d2e6b81

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

axmol/renderer/VertexLayoutManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ struct BuiltinVertexDefine
146146
desc.startLayout(1);
147147

148148
desc.addAttrib(rhi::VERTEX_INPUT_NAME_POSITION, program->getVertexInputDesc(rhi::VertexInputKind::POSITION),
149-
rhi::VertexFormat::FLOAT3, 0, false);
149+
rhi::VertexFormat::FLOAT2, 0, false);
150150
desc.endLayout();
151151
}
152152

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#version 310 es
22

3-
4-
layout(location = POSITION) in vec4 a_position;
3+
layout(location = POSITION) in vec2 a_position;
54

65
layout(location = COLOR0) out vec4 v_color;
76

@@ -12,6 +11,6 @@ layout(std140) uniform vs_ub {
1211

1312
void main()
1413
{
15-
gl_Position = u_MVPMatrix * a_position;
14+
gl_Position = u_MVPMatrix * vec4(a_position, 0.0, 1.0);
1615
v_color = u_color;
1716
}

0 commit comments

Comments
 (0)