What does it mean when there are two rows of shaders in Metal performance graph?

Hi, does someone know what it means when there are two rows of fragments shaders in the performance graph of the Metal debugger?

This capture was taken on an iPhone 13 Pro. In the section highlighted in red, it looks like there are two command queues rendering stuff in parallel. But I am positive I only create one.

When I unfold the fragment shader row, i can see the details of shaders invokations and they seem sequentials.

So I am confused. Are the shaders running sequentially or concurrently?

Thank you!

Answered by Alecazam in 747440022

There are multiple CUs processing both Vertex and Fragment work. So that's what you are seeing the capture.

You really shouldn't have one draw per command buffer. You should have one (or a small number of command buffers) that are enqued in the order you want the queue to process them in, and then use a series of render passes on the command buffer to submit draws that pertain to a particular set of render targets. The encoders of the render passes will run in sequence within a command buffer, but command buffers are allowed to execute out of order if there are no dependencies.

CommandBuffers aren't cheap.

I must add that, in this example, I have 1 draw call per command buffer. Since there is only one command queue, i am expecting each draw to execute one after another.

Accepted Answer

There are multiple CUs processing both Vertex and Fragment work. So that's what you are seeing the capture.

You really shouldn't have one draw per command buffer. You should have one (or a small number of command buffers) that are enqued in the order you want the queue to process them in, and then use a series of render passes on the command buffer to submit draws that pertain to a particular set of render targets. The encoders of the render passes will run in sequence within a command buffer, but command buffers are allowed to execute out of order if there are no dependencies.

CommandBuffers aren't cheap.

What does it mean when there are two rows of shaders in Metal performance graph?
 
 
Q