Hi guys,
I have just noticed my project is using quite a bit of memory and I have narrowed it down to draw calls.
I am drawing quads with 32px by 32px images with R8B8G8A8 formatting. Back buffer is formatted the same also.
So in theory the sprite is using 4K of RAM.
I notice though, that each individual draw call I make is using 13MB of RAM. Draw 10 quads and it blows up to 130MB of RAM (Release mode).
I checked using the VS graphical debugger and the render sequence is extremely lean at only a couple of calls.
My draw routine is pretty compact also;
// Draw sprite
float attributes = 4.0f; // X, Y, U, V
unsigned int stride = (unsigned int)(sizeof(float) * attributes);
unsigned int offset = 0;
d3dContext->IASetInputLayout(d3dInputLayoutDefault);
d3dContext->IASetVertexBuffers(0, 1, &d3dVertexBufferDynamic, &stride, &offset);
d3dContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
d3dContext->Draw(6, 0);
The RAM usage is the same if I use single or double buffering on the back buffer and I am not using any surfaces.
Any ideas why each draw call costs 13 MB? Or is this normal behaviour that I just haven't picked up on before?
Thanks in advance