

That internal table is passed directly as input to the vertex shader, specified in another buffer. An internal table in yet another buffer points each of these vertex buffers. The bring-up process for the project’s triangle provides a bird’s eye view of how all these disparate pieces in memory fit together.Īs an example, the application-provided vertex data are in their own buffers. In particular, the structures contain pointers to one another, sometimes nested multiple layers deep. So far, I have focused less on the content and more on the connections between them. Any state accessible from Metal corresponds to bits in these buffers, so understanding them will be the next major task. The bulk of the new code is responsible for constructing the various command buffers and descriptors resident in shared memory, used to control the GPU’s behaviour. A triangle rendered on the M1 with open-source code

The vertex and fragment shaders are handwritten in machine code, and I interface with the hardware via the IOKit kernel driver in an identical fashion to the system’s Metal userspace driver.

This week, I’ve reached a second milestone: drawing a triangle with my own open-source code. Less than a month ago, I began investigating the Apple M1 GPU in hopes of developing a free and open-source driver. Rosenzweig – Dissecting the Apple M1 GPU, part II Dissecting the Apple M1 GPU, part II
