Jump to content
  • Advertisement
Sign in to follow this  
ChristianFrantz

Max buffer size

This topic is 2017 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement

With 16bit indices you can't have such a large index count.

 

There are 16bit and 32bit indices. XNA Reach only supports 16bit. HiDef supports 32bit. 

Share this post


Link to post
Share on other sites

Check the MaxPrimitiveCount property of the device caps.  It will typically be 1,048,576.

Given your index count, you are likely drawing over this limit.  After checking, you can easily see if this is the problem by manually capping the number of primitives you draw in a single call to less than or equal to that value and see if you get anything.

 

 

L. Spiro

Share this post


Link to post
Share on other sites

Would that explain why my buffer isn't drawing then? I dont get an out of memory error

 

You wouldn't get an out of memory error, but rather when you try to write to the index your index value will get truncated.  This will result in some number of your indices to hold  totally wrong values.  This wouldn't necessarily make your draw call fail, but if your draw call only uses indices in the affected range (i.e. greater than 2^16) then it is quite possible that you wouldn't get anything drawn to the screen.  Do you have D3D debug output turned on?

Share this post


Link to post
Share on other sites

No I'm using XNA. I tried changing CHUNKSIZE to 16 to cut the vertices and indices in half, and still nothing is drawn.

 

Edit:

Forgot to explain. CHUNKSIZE is an int that stores a voxel struct in a 32x32x32 array. Now that CHUNKSIZE is 16, I assumed this would cut the data stored in the buffers in half.

Edited by burnt_casadilla

Share this post


Link to post
Share on other sites


No I'm using XNA.

Even if you are using XNA, the debug output will still give you feedback about what you are doing if there are incorrect uses of the API.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!