Jump to content
  • Advertisement

How to avoid Visual Studio hanging when hovering over a really large array?

Recommended Posts

I have some pre-compiled shaders in header files stored in arrays and sometimes, the cursor will hover over these arrays which means now Visual Studio has to preview the entire array. This causes the whole application to freeze. Is there a way to stop this from happening?

const BYTE d3d_byte_code[] = {........... Very large array };

When the cursor hovers over d3d_byte_code, Visual studio will freeze trying to preview the contents of the array

Share this post

Link to post
Share on other sites

One workaround would be to Watch the variable (as a bounded array):

"d3d_byte_code, 30" displays 30 first bytes. 

TBH I've never seen it hang like this while debugging, so start by adding the array to the watch list and see if it still lags. Hover viewing large arrays seems pointless anyway as you have to click on the lens icon to view the entire contents. Furthermore, a large byte array (especially something akin to what your array name seems to suggest) in general seems like strange thing to debug by hovering over it. So, if VS is freezing when you do, wouldn't easiest solution be to just... not hover over it? :)

Share this post

Link to post
Share on other sites
Posted (edited)

You could also add your shaders directly in your project, they will be compiled to .cso files. Then you can add a post-compiler event that copies the .cso files to your own folder, if they're found to be newer. That's what I do anyways, works great for me :)


Edited by vinterberg

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!