|
|
|
@ -518,40 +518,6 @@ void InterleaveTest::interleavedDataArrayAttributes() { |
|
|
|
CORRADE_COMPARE(interleaved.stride()[1], 1); |
|
|
|
CORRADE_COMPARE(interleaved.stride()[1], 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void InterleaveTest::interleavedDataZeroStride() { |
|
|
|
|
|
|
|
Containers::Array<char> vertexData{100 + 20}; |
|
|
|
|
|
|
|
Containers::StridedArrayView1D<Vector2> positions{vertexData, |
|
|
|
|
|
|
|
reinterpret_cast<Vector2*>(vertexData.data() + 100), 3, 0}; |
|
|
|
|
|
|
|
Containers::StridedArrayView1D<Vector3> normals{vertexData, |
|
|
|
|
|
|
|
reinterpret_cast<Vector3*>(vertexData.data() + 100 + 8), 3, 0}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { |
|
|
|
|
|
|
|
Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions}, |
|
|
|
|
|
|
|
Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals} |
|
|
|
|
|
|
|
}}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Technically they *are*, but it causes way too many problems especially
|
|
|
|
|
|
|
|
when used within interleavedLayout() etc. May tackle properly later. */ |
|
|
|
|
|
|
|
CORRADE_VERIFY(!MeshTools::isInterleaved(data)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void InterleaveTest::interleavedDataNegativeStride() { |
|
|
|
|
|
|
|
Containers::Array<char> vertexData{100 + 3*20}; |
|
|
|
|
|
|
|
Containers::StridedArrayView1D<Vector2> positions{vertexData, |
|
|
|
|
|
|
|
reinterpret_cast<Vector2*>(vertexData.data() + 100), 3, 20}; |
|
|
|
|
|
|
|
Containers::StridedArrayView1D<Vector3> normals{vertexData, |
|
|
|
|
|
|
|
reinterpret_cast<Vector3*>(vertexData.data() + 100 + 8), 3, 20}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { |
|
|
|
|
|
|
|
Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions.flipped<0>()}, |
|
|
|
|
|
|
|
Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals.flipped<0>()} |
|
|
|
|
|
|
|
}}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Technically they *are*, but it causes way too many problems especially
|
|
|
|
|
|
|
|
when used within interleavedLayout() etc. May tackle properly later. */ |
|
|
|
|
|
|
|
CORRADE_VERIFY(!MeshTools::isInterleaved(data)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void InterleaveTest::interleavedDataEmpty() { |
|
|
|
void InterleaveTest::interleavedDataEmpty() { |
|
|
|
Trade::MeshData data{MeshPrimitive::Triangles, 5}; |
|
|
|
Trade::MeshData data{MeshPrimitive::Triangles, 5}; |
|
|
|
CORRADE_VERIFY(MeshTools::isInterleaved(data)); |
|
|
|
CORRADE_VERIFY(MeshTools::isInterleaved(data)); |
|
|
|
@ -657,6 +623,40 @@ void InterleaveTest::interleavedDataAttributeAcrossStride() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void InterleaveTest::interleavedDataZeroStride() { |
|
|
|
|
|
|
|
Containers::Array<char> vertexData{100 + 20}; |
|
|
|
|
|
|
|
Containers::StridedArrayView1D<Vector2> positions{vertexData, |
|
|
|
|
|
|
|
reinterpret_cast<Vector2*>(vertexData.data() + 100), 3, 0}; |
|
|
|
|
|
|
|
Containers::StridedArrayView1D<Vector3> normals{vertexData, |
|
|
|
|
|
|
|
reinterpret_cast<Vector3*>(vertexData.data() + 100 + 8), 3, 0}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { |
|
|
|
|
|
|
|
Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions}, |
|
|
|
|
|
|
|
Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals} |
|
|
|
|
|
|
|
}}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Technically they *are*, but it causes way too many problems especially
|
|
|
|
|
|
|
|
when used within interleavedLayout() etc. May tackle properly later. */ |
|
|
|
|
|
|
|
CORRADE_VERIFY(!MeshTools::isInterleaved(data)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void InterleaveTest::interleavedDataNegativeStride() { |
|
|
|
|
|
|
|
Containers::Array<char> vertexData{100 + 3*20}; |
|
|
|
|
|
|
|
Containers::StridedArrayView1D<Vector2> positions{vertexData, |
|
|
|
|
|
|
|
reinterpret_cast<Vector2*>(vertexData.data() + 100), 3, 20}; |
|
|
|
|
|
|
|
Containers::StridedArrayView1D<Vector3> normals{vertexData, |
|
|
|
|
|
|
|
reinterpret_cast<Vector3*>(vertexData.data() + 100 + 8), 3, 20}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Trade::MeshData data{MeshPrimitive::Triangles, Utility::move(vertexData), { |
|
|
|
|
|
|
|
Trade::MeshAttributeData{Trade::MeshAttribute::Position, positions.flipped<0>()}, |
|
|
|
|
|
|
|
Trade::MeshAttributeData{Trade::MeshAttribute::Normal, normals.flipped<0>()} |
|
|
|
|
|
|
|
}}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Technically they *are*, but it causes way too many problems especially
|
|
|
|
|
|
|
|
when used within interleavedLayout() etc. May tackle properly later. */ |
|
|
|
|
|
|
|
CORRADE_VERIFY(!MeshTools::isInterleaved(data)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void InterleaveTest::interleavedDataVertexDataWholeMemory() { |
|
|
|
void InterleaveTest::interleavedDataVertexDataWholeMemory() { |
|
|
|
struct Vertex { |
|
|
|
struct Vertex { |
|
|
|
int:32; |
|
|
|
int:32; |
|
|
|
|