[Impeller] Make the default vertex buffer builder index size 16bit. (flutter/engine#36571)

This commit is contained in:
Jonah Williams
2022-10-03 12:44:09 -07:00
committed by GitHub
parent 03d23f0cf3
commit 6700e59d8a
2 changed files with 10 additions and 1 deletions

View File

@@ -878,6 +878,15 @@ TEST_P(RendererTest, CanCreateCPUBackedTexture) {
} while (dimension <= 8192);
}
TEST_P(RendererTest, DefaultIndexSize) {
using VS = BoxFadeVertexShader;
// Default to 16bit index buffer size, as this is a reasonable default and
// supported on all backends without extensions.
VertexBufferBuilder<VS::PerVertexData> vertex_builder;
ASSERT_EQ(vertex_builder.GetIndexType(), IndexType::k16bit);
}
TEST_P(RendererTest, VertexBufferBuilder) {
// Does not create index buffer if one is provided.
using VS = BoxFadeVertexShader;

View File

@@ -19,7 +19,7 @@
namespace impeller {
template <class VertexType_, class IndexType_ = uint32_t>
template <class VertexType_, class IndexType_ = uint16_t>
class VertexBufferBuilder {
public:
using VertexType = VertexType_;