PDA

View Full Version : Possible bug in ATI drivers?



Sansus
08-18-2007, 08:15 AM
I have an ATI X600 using the latest Omega drivers on a laptop machine running Windows XP.

My problem appears when trying to implement skinning on the GPU. I use the program.env parameters to pass the bone matrices to the vertex shader. However, there are some nearprogram.env[51] that doesn't appear to work well: the shader seems to be reading rubbish from it. I can work around this problem by skipping the first 50 program.envs (my card has 256 available).

I didn't test it on nVidia hardware, so I can not assure it is an ATI bug.

Does any one of you have any idea of what is happenning?

Thanks in advance.

Komat
08-18-2007, 09:47 AM
Can you post the shader?

Sansus
08-20-2007, 02:11 AM
I found out that it also happens on Nvidia hardware! It's very strange.

Here is the shader:


!!ARBvp1.0
PARAM mvp[4] = { state.matrix.mvp };
PARAM model[4] = { state.matrix.program[0] };
TEMP temp, modelpos, resultpos;
ADDRESS iBoneMat;
TEMP vertexBonePosition, pos1, pos2;
PARAM boneMat[54] = { program.env[0..53] };
ATTRIB boneIdx = vertex.attrib[11]; # (idx0,weight0,idx1,weight1)
ATTRIB boneRelPos0 = vertex.attrib[12];
ATTRIB boneRelPos1 = vertex.attrib[14];
#First bone weight
ARL iBoneMat.x, boneIdx.x;
DP4 pos1.x, boneMat[iBoneMat.x], boneRelPos0;
DP4 pos1.y, boneMat[iBoneMat.x+1], boneRelPos0;
DP4 pos1.z, boneMat[iBoneMat.x+2], boneRelPos0;
MUL pos1.xyz, pos1, boneIdx.y; # apply first weight
#Second bone weight
ARL iBoneMat.x, boneIdx.z;
DP4 pos2.x, boneMat[iBoneMat.x], boneRelPos1;
DP4 pos2.y, boneMat[iBoneMat.x+1], boneRelPos1;
DP4 pos2.z, boneMat[iBoneMat.x+2], boneRelPos1;
MAD vertexBonePosition.xyz, pos2, boneIdx.w, pos1; # apply second weight and add to first weight
MOV vertexBonePosition.w, 1.0;
# calculate vertex final position
DP4 resultpos.x, mvp[0], vertexBonePosition;
DP4 resultpos.y, mvp[1], vertexBonePosition;
DP4 resultpos.z, mvp[2], vertexBonePosition;
DP4 resultpos.w, mvp[3], vertexBonePosition;

MOV result.fogcoord.x, resultpos.z;
MOV result.position, resultpos;
ENDAny ideas?

Komat
08-21-2007, 12:32 AM
If the behavior is the same on both ATI and Nvidia it is likely that the problem is somewhere in your program.

Do you upload the matrices correctly? In what format do you specify the attribute with indices and weights?