Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly drawn sphere (day 12+) due to stride #4

Open
afdreher opened this issue May 17, 2023 · 0 comments
Open

Incorrectly drawn sphere (day 12+) due to stride #4

afdreher opened this issue May 17, 2023 · 0 comments

Comments

@afdreher
Copy link

I really appreciate you putting together a metal tutorial. It's been a nice refresher coming from the OpenGL ES world.

I had an issue with the sphere not drawing correctly (Day 12 and beyond). For me the bottom part of the sphere was missing, and a black wedge appeared instead. I tracked down the issue to the line:

vertexDescriptor.bufferLayouts[0].stride = 24

On my play machine (old iMac with AMD Radeon R9 M295X), the issue is the size of the stride through the buffers. The issue is solved by using the layout size instead.

vertexDescriptor.bufferLayouts[0].stride = MemoryLayout<simd_float3>.size * 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant