1

I have read Batch,Batch,Batch.

In the Batching process, there are two main things:

1 Submit n number of triangles

2 SetState

So which one is more cpu time consuming?

Or the SetState itself actually does not matter at all. It matters only because once the state has been changed, we have to submit triangles again?

AlexWei
  • 1,093
  • 2
  • 8
  • 32
  • So, you're reading a 10-year-old PDF file that's primarily focused on a different API (D3D. It had one slide on OpenGL, and that slide proved that GL doesn't have the problem it's talking about. Or at least not as much). Why do you think this is valuable information that you could internalize and follow? – Nicol Bolas May 27 '16 at 12:39
  • @NicolBolas Currently I am using Unity. The Unity 4 version said reducing drawcall. Then Unity 5 version said draw call does not matter. Batch matters. After I have done few days research, it seems all refer to this old document. So that's why. – AlexWei May 27 '16 at 13:02
  • @NicolBolas Thanks. That's what I am looking for. – AlexWei May 27 '16 at 13:08

1 Answers1

0

All in all, it doesn't really matter (like you say at the end of your question)

  • If you do a SetState without submitting data to draw with that state, that's just dumb. Don't do the SetState.
  • If you draw several batch with the same state, you should probably have submitted them as one single batch.

What the "set state" does is going to be very driver dependent, and which state you change. Some changes might need a lot of validation, and that could be done when you set the state, or when it's actually going to be sent to the GPU, no way to know for sure.

In general, I would count that "submitting a draw" counts as 1 batch, no matter whether the state was changed before doing it or not.

246tNt
  • 2,122
  • 1
  • 16
  • 20