~widelands-dev/widelands/better-bufferdata

Viewing all changes in revision 7697.

  • Committer: Nicolai Hähnle
  • Date: 2016-01-09 16:00:31 UTC
  • Revision ID: nhaehnle@gmail.com-20160109160031-wsklt4a44r3nwmsk
Avoid inefficient use of glBufferSubData

Drivers have a hard time keeping track of when the same physical region of
memory is used with different contents. With Mesa's radeonsi driver, for
example, practically every glBufferSubData leads to a flush of the command
stream (not necessarily a stall, but high overhead nevertheless).

By using glBufferData, the driver is explicitly told that old data in the
buffer can be discarded, which leads to the driver automatically using
different memory regions from a memory pool, which allows many more draw
calls to be batched in a single command stream submission.

You can see the effect with Mesa's radeonsi driver by running with the
GALLIUM_HUD=.ddraw-calls+num-cs-flushes variable set.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: