Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7820201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:12:14+00:00 2026-06-02T07:12:14+00:00

So from looking around at examples and tutorials, it seems the most common method

  • 0

So from looking around at examples and tutorials, it seems the most common method of placing buffers in the pipeline is, every model object gets it’s own vertex buffer, and then after the buffers are filled, they lock, set the buffers, unlock, set shaders, draw, and rinse/repeat for every models individual buffer. seems to me that all that locking and unlocking would slow things down a bit.

So i’m wondering if maybe the model objects could instead aggregate all their vertices into 1 big array, all the indices in a big array, create 1 large buffer, lock once, set buffers once, unlock, and then switch out shaders and draw as many polygons as required with those shaders, and just work your way along the buffer drawing and switching shaders like before, instead of having to lock and drop more vertices in the pipeline every time before you draw.

Would this be any more efficient, or do you think the overhead from all the bookkeeping involved,(for example, from index a to index b, use this shader), would just make this more work than it’s worth?

also, if i have missed a concept of d3d here, please inform me. ( i’m new)

EDIT

due to massive misunderstanding, anywhere where i refered to locking and unlocking, was actually supposed to just be calling IASetVertexBuffer/IASetIndexBuffer. The “revised” question is more or less:

Does stuffing the vertices for all the models in the scene into one single buffer, and simply calling IASetVertexBuffer once improve perforamance at all?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:12:16+00:00Added an answer on June 2, 2026 at 7:12 am

    So from looking around at examples and tutorials

    Stop. Most “examples and tutorials” for anything are not intended to show best performance practices. Unless they are specifically about best performance practices. They’re trying to show in the clearest and cleanest way how to perform task X. Optimization is an entirely other issue. Optimized code is a lit less clear and clean than unoptimal code; thus, many optimizations would get in the way of the tutorial’s stated purpose.

    So never assume that just because a tutorial does it some way, that’s the fastest way to do something. It is simply one way to do it.

    then after the buffers are filled, they lock, set the buffers, unlock, set shaders, draw, and rinse/repeat for every models individual buffer.

    Locking and unlocking is for modifying the buffer. If you’re not modifying it… why are you locking it? And if you are modifying it, then you’re doing some form of buffer streaming, which requires special handling in order to make it efficient.

    If you’re doing streaming, then that’s a different question you should ask (ie: how to do high-performance vertex streaming).

    That isn’t to say that putting the data for multiple objects in one buffer isn’t a good idea. But if it is, the reason for it has less to do with locking and unlocking and more to do with the possibility of drawing multiple objects with a single draw call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking through the knockout tutorials, and all the examples create the view model
I've been looking for a few days around the internet for tutorials or examples
Looking to move data from a table A to history table B every X
When looking to get data from a web page whats the recommended method if
I have been looking around the internet for examples of an AJAX function which
I have been looking around for examples related to converting JSON strings to Java
My question is slightly different from Looking for a recommendation for a lightweight mobile
I'm coming to Postgres from Oracle and looking for a way to find the
I'm after a tool to generate decent-looking documents from templates, that needs to: be
I'm getting about the same bad looking resizing from all the 4 algorithms of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.