Skip to main content
gamedev.net
🔒 Locked

Vertex Declarations

Started by Greg K Jan 3, 2003 at 11:24 PM 2 replies 1k views
Original Post
Greg K
Greg K
I have been trying to create the vertex shader declaration for a simple vertex shader that uses this data: 3 floats in v0 3 floats in v1 2 floats in v2 etc... This is what I have:
  
D3DVERTEXELEMENT9 vertexShaderDecl[] = 
{
	{ 0, 0,  D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, 0, 0 },
	{ 0, 0,  D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, 1, 0 },
	{ 0, 0,  D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, 2, 0 },
	{ 0, 0,  D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, 3, 0 },
	D3DDECL_END()
};
  
and it gives me this error when I try to compile it: (2): error X5326: Read of uninitialized components(*) in v0: *x/0 *y/1 *z/2 *w/3 (3): error X5326: Read of uninitialized components(*) in v0: *x/0 *y/1 *z/2 *w/3 (4): error X5326: Read of uninitialized components(*) in v0: *x/0 *y/1 *z/2 *w/3 (5): error X5326: Read of uninitialized components(*) in v0: *x/0 *y/1 *z/2 *w/3 (12): error X5326: Read of uninitialized components(*) in v2: *x/0 *y/1 z/2 w/3 (24): error X5326: Read of uninitialized component(*) in v1: *x/0 y/1 z/2 w/3 (25): error X5326: Read of uninitialized component(*) in v1: x/0 *y/1 z/2 w/3 (26): error X5326: Read of uninitialized component(*) in v1: x/0 y/1 *z/2 w/3 Does anybody know what I am doing wrong? -Greg
Greg K
Greg K
thank you so very much. Guh, that is stupid. Is there any way to just set it to a number without using those defines?
-Greg
EvilDecl81
EvilDecl81
You need to specify the offset more then anything. The new declaration type severs vertex streams from vertex shaders - a big problem for DX81 (Hence my handle).



quote:
Original post by Greg K
I have been trying to create the vertex shader declaration for a simple vertex shader that uses this data:

3 floats in v0
3 floats in v1
2 floats in v2
etc...

This is what I have:


    
D3DVERTEXELEMENT9 vertexShaderDecl[] =
{
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, 0, 0 },
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, 1, 0 },
{ 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, 2, 0 },
{ 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, 3, 0 },
D3DDECL_END()
};


and it gives me this error when I try to compile it:
(2): error X5326: Read of uninitialized components(*) in v0: *x/0 *y/1 *z/2 *w/3
(3): error X5326: Read of uninitialized components(*) in v0: *x/0 *y/1 *z/2 *w/3
(4): error X5326: Read of uninitialized components(*) in v0: *x/0 *y/1 *z/2 *w/3
(5): error X5326: Read of uninitialized components(*) in v0: *x/0 *y/1 *z/2 *w/3
(12): error X5326: Read of uninitialized components(*) in v2: *x/0 *y/1 z/2 w/3
(24): error X5326: Read of uninitialized component(*) in v1: *x/0 y/1 z/2 w/3
(25): error X5326: Read of uninitialized component(*) in v1: x/0 *y/1 z/2 w/3
(26): error X5326: Read of uninitialized component(*) in v1: x/0 y/1 *z/2 w/3

Does anybody know what I am doing wrong?
-Greg

EvilDecl81

Topic Locked

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

Sign in to reply to this topic.