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

Minimum stream stride

Started by DonnieDarko Aug 26, 2006 at 1:35 PM 3 replies 1.3k views
Original Post
DonnieDarko
DonnieDarko
Can anybody tell me if there is a minimum allowed stream stride? I tried creating a vertex buffer with just 1 float per vertex element and when setting this on stream 1 the runtime says "(ERROR) :Stream 1 size is too small". I haven't found anything in the docs about this and there doesn't seem to be a device cap either.
bakery2k1
bakery2k1
What did you set the stride to?
DonnieDarko
DonnieDarko
This is my vertex declaration:

D3DVERTEXELEMENT9 vertexElements[] ={	{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },	{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 },	{ 0, 24, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1 },	{ 1, 0, D3DDECLTYPE_FLOAT1, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 2 },	D3DDECL_END()};


And for rendering:
dev->SetStreamSource(0, vb0, 0, mesh->GetNumBytesPerVertex());dev->SetStreamSource(1, vb1, 0, sizeof(float));


In this case I want to render a mesh and then per frame upload one float per vertex.
DonnieDarko
DonnieDarko
Nevermind....it was an error related to the use of SetStreamSourceFreq which I found out is not supported on my X800 XT :(

Bye bye instancing...
ET3D
ET3D
Instancing is supported on all Radeon SM2 cards. But since the D3D standard supports instancing only on SM3, it's disabled by default, and enabled via a hack. The Radeon SDK (available on ATI's site) has a sample of instancing. It also has some cool render to VB demos which are worth seeing. Another source for instancing code on ATI is Humus' instancing sample.

Note, however, that because instancing is only officially supported on SM3, you will not be able to run ATI SM2 instancing code with the debug runtime, since it validates the call. It will run fine with the retail runtime, however.

Topic Locked

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

Sign in to reply to this topic.