• Create Account

### #ActualTape_Worm

Posted 17 January 2012 - 09:00 PM

I'm using SharpDX and Direct3D 11.I 've got 8192 textured (single texture) quads (32768 vertices), each vertex has a Vector4 for position, a Vector2 for texture coordinates, and a Vector4 for color. Every frame I discard my dynamic vertex buffer and refill it (this is just an unrefined stress test) with the vertex data.

It is REALLY slow. Something like 150+ msec for frame delta (~5-6 FPS).

All I'm doing is this:
Draw()
{
for (int i = 0; i < 8192; i++)
{
Matrix proj_view_world = proj_view * world;
UpdateVertices(proj_view_world);
WriteData();
}
unlock_vertex_buffer();

ImmediateContext.DrawIndexed(8192 * 6, 0, 0);
}


And for the record, I'm initializing an index buffer, but I never touch it again.

Now, if I comment out the DrawIndexed, I get ~200FPS (which is comparable to my old DirectX 9 code and that's not much different than this), so that seems to indicate that the bottleneck is in the DrawIndexed method.

I'm really new to the whole Direct3D 11 thing, so can anyone shed any light/advice on this?

Thanks

### #1Tape_Worm

Posted 17 January 2012 - 08:59 PM

I'm using SharpDX and Direct3D 11.I 've got 8192 textured (single texture) quads (32768 vertices), each vertex has a Vector4 for position, a Vector2 for texture coordinates, and a Vector4 for color. Every frame I discard my dynamic vertex buffer and refill it (this is just an unrefined stress test) with the vertex data.

It is REALLY slow. Something like 150+ msec for frame delta (~5-6 FPS).

All I'm doing is this:
Draw()
{
for (int i = 0; i < 8192; i++)
{
Matrix proj_view_world = proj_view * world;
UpdateVertices(proj_view_world);
WriteData();
}
unlock_vertex_buffer();

ImmediateContext.DrawIndexed(8192 * 6, 0, 0);
}


And for the record, I'm initializing an index buffer, but I never touch it again.

Now, if I comment out the DrawIndexed, I get ~200FPS (which is comparable to my old DirectX 9 code and that's not much different than this), so that seems to indicate that the bottleneck is in the DrawIndexed method.

So, I'm really new to the whole Direct3D 11 thing, so can anyone shed any light/advice on this?

Thanks

PARTNERS