🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

d3d11: draw several rectangles with a single drawIndexed*() call for performance ?

Started by
12 comments, last by Aerodactyl55 1 year, 11 months ago

Aerodactyl55 said:

vtorri said:

I get a “page not found” when I click on that link.

Call DrawIndex with the IndexCount parameter set to the number of required indices (for 2 rectangles it should be 12), the rest can be set to zero.

then try to copy the address `https://git.enlightenment.org/vtorri/Direct3D/src/branch/master/src/d3d_5.c​`​ and paste it in the browser. It works for me

Still doesn't work. Maybe you should post the relevant code.

https://pastebin.com/C3Fv0Qfr

Advertisement

@vtorri

3DGraphics,Direct3D12,Vulkan,OpenCL,Algorithms

@vtorri You are creating one vertex/index buffer for each rectangle. You should create one vertex buffer large enough for all rectangles you want to draw, generate the vertices for each rectangle and copy to the vertex buffer, then you can draw all the rectangles with a single draw call. The index buffer can be static (with pre-generated indices), since you want to draw rectangles only.

This topic is closed to new replies.

Advertisement