Fix index size check to respect 16 bit buffers (flutter/engine#19)

This commit is contained in:
Brandon DeRosier
2022-02-22 11:15:33 -08:00
committed by Dan Field
parent 9d14c1e663
commit f26f4b5f7a

View File

@@ -473,7 +473,8 @@ bool RenderPassMTL::EncodeCommands(Allocator& allocator,
if (!mtl_index_buffer) {
return false;
}
FML_DCHECK(command.index_count * sizeof(uint32_t) ==
FML_DCHECK(command.index_count *
(command.index_type == IndexType::k16bit ? 2 : 4) ==
command.index_buffer.range.length);
// Returns void. All error checking must be done by this point.
[encoder drawIndexedPrimitives:ToMTLPrimitiveType(command.primitive_type)