Skip to main content
GameDev.net gamedev.net
🔒 Locked

Max buffer size

Started by ChristianFrantz Apr 9, 2014 at 1:43 AM 5 replies 1.9k views
Original Post
ChristianFrantz
ChristianFrantz

Is there a max buffer size in XNA? or am i just doing something really wrong here?

AEPUK9J.pngIjO3lKH.png

If you see a post from me, you can safely assume its C# and XNA :)
DwarvesH
DwarvesH

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.

ChristianFrantz
ChristianFrantz

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

If you see a post from me, you can safely assume its C# and XNA :)
L. Spiro
L. Spiro

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

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid
Jason Z
Jason Z

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?

Jason Zink :: DirectX MVP   Direct3D 11 engine on CodePlex: Hieroglyph 3 Direct3D Books: 
ChristianFrantz
ChristianFrantz

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.

If you see a post from me, you can safely assume its C# and XNA :)
Jason Z
Jason Z




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.

Jason Zink :: DirectX MVP   Direct3D 11 engine on CodePlex: Hieroglyph 3 Direct3D Books: 

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.