# Shader registers for different graphics card

The title is not very explicative, so i'll try to make myself clear. I have two "working"(on which i work on) PCs : a desktop that runs an NVIDIA GT440 an a laptop with a RADEON HD 4650. I have a shader for multipass rendering that uses both POSITION0 and POSITION1 registers for the vertex shader output :

struct VS_OUT
{
float4 Position : POSITION0;
float4 WorldPosition : POSITION1;

// More variables for normal mapping and more
};


This code works just fine on my desktop, but when i run it on my laptop the rendering is screwed. I finally tracked down the problem to the POSITION1 output parameter, if i change it to TEXCOORD0 it works. Now ... i don't like to do things i do not understand, so i'd like to understand WHY it happens.

It's something GPU related for sure, but i'd be glad if you could link me some papers, articles or anything that explains how the registers work, and why not... even something in-deep about the programmable pipeline.

Thank you for your time and happy coding!

• Which Direct3D API are you using? 9, 10, 11? May 22 '13 at 21:57

I think the problem is with the semantics used. As far as I know, pixel shader can only recieve SV_POSITION - if talking about POSITION (which is filled usualy by vertex shader POSITION0 semantics) The only user-defined semantics you can recieve in pixel shader are:

• COLOR[n]
• TEXCOORD[n]

The behavior you're describing is because these are two different implementations of DirectX and reading POSITION0 semantics in pixel shader is not defined by DirectX standard.

http://msdn.microsoft.com/en-us/library/windows/desktop/bb509647%28v=vs.85%29.aspx#PS

• The desktop graphic card supports DX11 while the ATI Radeon only DX10.1. Can this be the reason ? or it's ATI that implements DX in a different way ? May 22 '13 at 12:58
• I don't think, that the support for DX11 or DX10.1 is the reason. More likely it's because one GPU is NVIDIA and the second is ATI - two different hardware & driver designs and DirectX implementations. I'd bet, that even in the case you downgrade your NVIDIA PC to DX10.1 it would still behave the same way. Yes, sometimes it could be confusing, why the app behaves different on various hardware, but (except bugs) it's always because you're performing some undefined (non-standard) action. May 23 '13 at 6:30