@@ -815,45 +815,49 @@ bool lovrGraphicsInit(GraphicsConfig* config) {
815815
816816 state .vertexFormats [VERTEX_SHAPE ] = (gpu_vertex_format ) {
817817 .bufferCount = 2 ,
818- .attributeCount = 5 ,
818+ .attributeCount = 6 ,
819819 .bufferStrides [0 ] = sizeof (ShapeVertex ),
820820 .attributes [0 ] = { 0 , 10 , offsetof(ShapeVertex , position ), GPU_TYPE_F32x3 },
821821 .attributes [1 ] = { 0 , 11 , offsetof(ShapeVertex , normal ), GPU_TYPE_F32x3 },
822822 .attributes [2 ] = { 0 , 12 , offsetof(ShapeVertex , uv ), GPU_TYPE_F32x2 },
823- .attributes [3 ] = { 1 , 13 , 16 , GPU_TYPE_F32x4 },
824- .attributes [4 ] = { 1 , 14 , 0 , GPU_TYPE_F32x4 }
823+ .attributes [3 ] = { 1 , 13 , 0 , GPU_TYPE_F32x2 },
824+ .attributes [4 ] = { 1 , 14 , 16 , GPU_TYPE_F32x4 },
825+ .attributes [5 ] = { 1 , 15 , 0 , GPU_TYPE_F32x4 }
825826 };
826827
827828 state .vertexFormats [VERTEX_POINT ] = (gpu_vertex_format ) {
828829 .bufferCount = 2 ,
829- .attributeCount = 5 ,
830+ .attributeCount = 6 ,
830831 .bufferStrides [0 ] = 12 ,
831832 .attributes [0 ] = { 0 , 10 , 0 , GPU_TYPE_F32x3 },
832833 .attributes [1 ] = { 1 , 11 , 0 , GPU_TYPE_F32x4 },
833834 .attributes [2 ] = { 1 , 12 , 0 , GPU_TYPE_F32x4 },
834- .attributes [3 ] = { 1 , 13 , 16 , GPU_TYPE_F32x4 },
835- .attributes [4 ] = { 1 , 14 , 0 , GPU_TYPE_F32x4 }
835+ .attributes [3 ] = { 1 , 13 , 0 , GPU_TYPE_F32x2 },
836+ .attributes [4 ] = { 1 , 14 , 16 , GPU_TYPE_F32x4 },
837+ .attributes [5 ] = { 1 , 15 , 0 , GPU_TYPE_F32x4 }
836838 };
837839
838840 state .vertexFormats [VERTEX_GLYPH ] = (gpu_vertex_format ) {
839841 .bufferCount = 2 ,
840- .attributeCount = 5 ,
842+ .attributeCount = 6 ,
841843 .bufferStrides [0 ] = sizeof (GlyphVertex ),
842844 .attributes [0 ] = { 0 , 10 , offsetof(GlyphVertex , position ), GPU_TYPE_F32x2 },
843845 .attributes [1 ] = { 1 , 11 , 0 , GPU_TYPE_F32x4 },
844846 .attributes [2 ] = { 0 , 12 , offsetof(GlyphVertex , uv ), GPU_TYPE_UN16x2 },
845- .attributes [3 ] = { 0 , 13 , offsetof(GlyphVertex , color ), GPU_TYPE_UN8x4 },
846- .attributes [4 ] = { 1 , 14 , 0 , GPU_TYPE_F32x4 }
847+ .attributes [3 ] = { 1 , 13 , 0 , GPU_TYPE_F32x2 },
848+ .attributes [4 ] = { 0 , 14 , offsetof(GlyphVertex , color ), GPU_TYPE_UN8x4 },
849+ .attributes [5 ] = { 1 , 15 , 0 , GPU_TYPE_F32x4 }
847850 };
848851
849852 state .vertexFormats [VERTEX_EMPTY ] = (gpu_vertex_format ) {
850853 .bufferCount = 2 ,
851- .attributeCount = 5 ,
854+ .attributeCount = 6 ,
852855 .attributes [0 ] = { 1 , 10 , 0 , GPU_TYPE_F32x3 },
853856 .attributes [1 ] = { 1 , 11 , 0 , GPU_TYPE_F32x3 },
854857 .attributes [2 ] = { 1 , 12 , 0 , GPU_TYPE_F32x2 },
855- .attributes [3 ] = { 1 , 13 , 16 , GPU_TYPE_F32x4 },
856- .attributes [4 ] = { 1 , 14 , 0 , GPU_TYPE_F32x4 }
858+ .attributes [3 ] = { 1 , 13 , 0 , GPU_TYPE_F32x2 },
859+ .attributes [4 ] = { 1 , 14 , 16 , GPU_TYPE_F32x4 },
860+ .attributes [5 ] = { 1 , 15 , 0 , GPU_TYPE_F32x4 }
857861 };
858862
859863 float16Init ();
@@ -5199,6 +5203,7 @@ Model* lovrModelCreate(const ModelInfo* info) {
51995203 { .name = "VertexPosition" , .type = TYPE_F32x3 , .offset = offsetof(ModelVertex , position ) },
52005204 { .name = "VertexNormal" , .type = TYPE_SN10x3 , .offset = offsetof(ModelVertex , normal ) },
52015205 { .name = "VertexUV" , .type = TYPE_F32x2 , .offset = offsetof(ModelVertex , uv ) },
5206+ { .name = "VertexUV2" , .type = TYPE_UN16x2 , .offset = offsetof(ModelVertex , uv2 ) },
52025207 { .name = "VertexColor" , .type = TYPE_UN8x4 , .offset = offsetof(ModelVertex , color ) },
52035208 { .name = "VertexTangent" , .type = TYPE_SN10x3 , .offset = offsetof(ModelVertex , tangent ) }
52045209 }
0 commit comments