• Advertisement
Sign in to follow this  

Mental block on simple FVF stride problem

This topic is 4371 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

Hello, Here's a noob question! Direct3D9: (WARN) :Stream 0 stride and vertex size, computed from the current vertex declaration or FVF, are different, which might not work with pre-DX8 drivers This error is being output by my lens flare rendering code. Heres the relevant parts:
struct sFlareVertex
{
	D3DXVECTOR2 Position;
	float tU, tV;

	const static DWORD FVF = D3DFVF_XYZ | D3DFVF_TEX1;
};



	hr = g_device->CreateVertexBuffer(	4 * sizeof(sFlareVertex), 
										D3DUSAGE_WRITEONLY, 
										sFlareVertex::FVF, 
										D3DPOOL_DEFAULT, 
										&m_VB, 
										0);



		g_device->SetFVF( sFlareVertex::FVF );
		g_device->SetStreamSource(0, m_VB, 0, sizeof(sFlareVertex));
		g_device->SetIndices( m_IB );

                /// shader constant code here....

                hr = g_device->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, 4, 0, 2 );

I can't for the life of me see why this generates the abouve errors. The stride seems okay to me :( I am right in thinking the effect file used can't generate this error? Thanks Simon

Share this post


Link to post
Share on other sites
Advertisement
D3DFVF_XYZ is a 3 component vector. You have a 2 component vector in your structure. 2*4 = 8. D3D is expecting a stride of 4 (4 for size of a float) more then what you give it

Share this post


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

  • Advertisement