D3D speedups

This PR picks 4 commits of galop1n's D3D branch which are simple d3d backend changes.
auto& is one of the best thing in c++11 and not gross at all. In particular
with that exemple.

m_buffers, plurial of buffer, a good name for a collection of buffer. The
range based for loop is another hint for the reader that miss the "s".

We wants to iterate over them, we do not care of the collection type. We do
not even care about the exact buffer type for the moment, the collection
name carry the semantic ( buffer, something holding data ) and the rest of
the code should highlight us on what we will do with that data.

The grab by reference give us information too, the buffer may be costly to
copy (seems logical for something holding data) or not copiable at all.
Here the second as we deal with a unique_ptr.

So no, grab by reference with type deduction is not gross here. That's the
right tool.

In Source/Core/VideoBackends/D3D/VertexManager.cpp:

>
>  void VertexManager::CreateDeviceObjects()
>  {
> -	D3D11_BUFFER_DESC bufdesc = CD3D11_BUFFER_DESC(IBUFFER_SIZE,
> -		D3D11_BIND_INDEX_BUFFER, D3D11_USAGE_DYNAMIC, D3D11_CPU_ACCESS_WRITE);
> -
> -	m_vertex_draw_offset = 0;
> -	m_index_draw_offset = 0;
> -	m_index_buffers = new PID3D11Buffer[MAX_VBUFFER_COUNT];
> -	m_vertex_buffers = new PID3D11Buffer[MAX_VBUFFER_COUNT];
> -	for (m_current_index_buffer = 0; m_current_index_buffer < MAX_VBUFFER_COUNT; m_current_index_buffer++)
> +	CD3D11_BUFFER_DESC bufdesc(VBUFFER_SIZE, D3D11_BIND_VERTEX_BUFFER|D3D11_BIND_INDEX_BUFFER,
> +	                           D3D11_USAGE_DYNAMIC, D3D11_CPU_ACCESS_WRITE);
> +
> +	for (auto &p : m_buffers)

auto& is gross :|

—
Reply to this email directly or view it on GitHub
<https://github.com/dolphin-emu/dolphin/pull/438/files#r14029497>.