Skip to content

Commit 542b8c4

Browse files
bderodnfield
authored andcommitted
Fix index size check to respect 16 bit buffers (#19)
1 parent ba1ecb6 commit 542b8c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

impeller/renderer/backend/metal/render_pass_mtl.mm

+2-1
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,8 @@ static bool Bind(PassBindingsCache& pass,
473473
if (!mtl_index_buffer) {
474474
return false;
475475
}
476-
FML_DCHECK(command.index_count * sizeof(uint32_t) ==
476+
FML_DCHECK(command.index_count *
477+
(command.index_type == IndexType::k16bit ? 2 : 4) ==
477478
command.index_buffer.range.length);
478479
// Returns void. All error checking must be done by this point.
479480
[encoder drawIndexedPrimitives:ToMTLPrimitiveType(command.primitive_type)

0 commit comments

Comments
 (0)