My program is a windows store DirectX app.

Just like the topic title, my code work well with win32.But when I debug my demo with my Surface RT.Some vertex position wrong.Just like the photo below.

I have do some test about my program.

This is my VertexShaderInput:

struct VertexShaderInput { float3 pos : POSITION; float3 norm : NORMAL; float2 tex : TEXCOORD0; float4 Tangent : TANGENT; float4 Weights : WEIGHTS; uint4 BoneIndices : BONEINDICES; };

**When I use only pos, norm, tex data(mesh with no skinned animation data).My mesh displayed correctly.**

So I thought the problem may be the BoneIndices,it's uint4 type in my HLSL code.

For more detail info, I paste my full hlsl code:

cbuffer SimpleConstantBuffer : register(b0) { matrix model; matrix view; matrix projection; matrix gBoneTransforms[59]; }; struct VertexShaderInput { float3 pos : POSITION; float3 norm : NORMAL; float2 tex : TEXCOORD0; float4 Tangent : TANGENT; float4 Weights : WEIGHTS; uint4 BoneIndices : BONEINDICES; }; struct PixelShaderInput { float4 pos : SV_POSITION; float3 norm : NORMAL; float2 tex : TEXCOORD0; }; PixelShaderInput SimpleVertexShader(VertexShaderInput input) { PixelShaderInput vertexShaderOutput; float weights[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; weights[0] = input.Weights.x; weights[1] = input.Weights.y; weights[2] = input.Weights.z; weights[3] = input.Weights.w; float4 pos = float4(input.pos, 1.0f); float4 skinnedPos = float4(0.0f, 0.0f, 0.0f, 0.0f); float4 norm = float4(normalize(input.norm), 0.0f); float4 normFinal = float4(0.0f, 0.0f, 0.0f, 1.0f); for (int i = 0; i < 4; ++i) { skinnedPos += weights[i] * mul(pos, gBoneTransforms[input.BoneIndices[i]]); normFinal += weights[i] * mul(norm, gBoneTransforms[input.BoneIndices[i]]); } skinnedPos.w = 1.0f; pos = mul(skinnedPos, model); pos = mul(pos, view); pos = mul(pos, projection); norm = mul(normFinal, model); vertexShaderOutput.pos = pos; vertexShaderOutput.tex = input.tex; vertexShaderOutput.norm = normalize(normFinal.xyz); return vertexShaderOutput; }

And the vertex structure in my code is:

struct VertexPNTTBI { XMFLOAT3 pos; XMFLOAT3 norm; XMFLOAT2 tex; XMFLOAT4 tan; XMFLOAT4 blendWeight; BYTE blendIndice[4]; };

And my D3D11_INPUT_ELEMENT_DESC is:

const D3D11_INPUT_ELEMENT_DESC VertexLayoutDesc[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 24, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "TANGENT", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 32, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "WEIGHTS", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 48, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "BONEINDICES", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, 64, D3D11_INPUT_PER_VERTEX_DATA, 0 }, };

**These code work well with my local machine(win32).**But I don't known if there are somethine I must change between WIN32 and ARM.

I have been working on this problem for 4 days.

Any help would be appreciated!Thanks.

**Edited by kgs, 27 November 2013 - 09:17 PM.**