Code not working properly on M1 Mac?

Just started reading the book.

As of chapter 1 everything is running well, but as soon as I entered chapter 2.the different calls for:

renderEncoder.drawIndexedPrimitives(type: .point,
                    indexCount: submesh.indexCount,
                    indexType: submesh.indexType,
                    indexBuffer: submesh.indexBuffer.buffer,
                    indexBufferOffset: 0)

and:

renderEncoder.setTriangleFillMode(.lines)

Don’t render the correct mesh on my playground preview, I just get a big red screen

Has anyone seen this behavior before ? I hope it’s not an Issue with these M1 Machines

Using Xcode13

image

Hi @alexisdevelops and welcome to the Metal forum!

The way a point is rendered has changed. Check out this post for the solution:

There shouldn’t be issues with the M1. If you find any, please post here, and I’ll get back to you ASAP :smiley:

:face_with_hand_over_mouth: I see

Yeah, I updated the shared code and it worked no problem, thanks for the support !!!

1 Like