Skip to content

Commit

Permalink
Fix index size check to respect 16 bit buffers (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdero authored and dnfield committed Apr 27, 2022
1 parent ba1ecb6 commit 542b8c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion impeller/renderer/backend/metal/render_pass_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,8 @@ static bool Bind(PassBindingsCache& pass,
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)
Expand Down

0 comments on commit 542b8c4

Please sign in to comment.