Say I have 5 identical sprites placed
exactly on top of each other, is
SpriteBatch able to determine that it
only needs to draw one?
Is it able to? Sure -- it has all the information that would allow it to make that determination. However, it won't do so, because such a computation is non-trivial in general and would actually drastically degrade the performance of the
If enabled, the depth test will kill off fragments that shouldn't be seen or overdraw will hide them, but in both cases the sprite vertices will have been transformed completely through the pipeline already.
Also, say I have a large map that I've
tiled off the screen in every
direction. Does SpriteBatch handle
that it does not need to draw these
sprites that are off the screen.
It won't attempt to cull enqueued sprites against the view at all, either. They'll be clipped out entirely during the transformation stage like any other geometry, but it's vastly less expensive to simply never enqueue a sprite you know will not be drawn because it is out of view.
SpriteBatch is really just a wrapper around a dynamic vertex buffer that may or may not do some sorting for you to minimize texture stage changes and such. If your curious you can use Reflector to poke around at the internals and see that it does very little besides manage the buffer for you.