Share bucket indices (#1358)

Co-authored-by: Stefan Karschti <stefan.karschti@gmail.com>
This commit is contained in:
Tim Sylvester
2023-07-13 12:45:54 -07:00
committed by Bart Louwers
parent 996b388601
commit 7f862cd8ff
26 changed files with 159 additions and 94 deletions

View File

@@ -485,7 +485,7 @@ void RenderLineLayer::update(gfx::ShaderRegistry& shaders,
if (const auto& attr = vertexAttrs.add(VertexAttribName)) {
attr->setSharedRawData(bucket.sharedVertices,
offsetof(LineLayoutVertex, a1),
0,
/*vertexOffset=*/0,
sizeof(LineLayoutVertex),
gfx::AttributeDataType::Short2);
}
@@ -493,7 +493,7 @@ void RenderLineLayer::update(gfx::ShaderRegistry& shaders,
if (const auto& attr = vertexAttrs.add(DataAttribName)) {
attr->setSharedRawData(bucket.sharedVertices,
offsetof(LineLayoutVertex, a2),
0,
/*vertexOffset=*/0,
sizeof(LineLayoutVertex),
gfx::AttributeDataType::UByte4);
}
@@ -502,8 +502,7 @@ void RenderLineLayer::update(gfx::ShaderRegistry& shaders,
};
auto setSegments = [&](std::unique_ptr<gfx::DrawableBuilder>& builder, const LineBucket& bucket) {
builder->setSegments(
gfx::Triangles(), bucket.triangles.vector(), bucket.segments.data(), bucket.segments.size());
builder->setSegments(gfx::Triangles(), bucket.sharedTriangles, bucket.segments.data(), bucket.segments.size());
};
for (const RenderTile& tile : *renderTiles) {