Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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!

share|improve this question
    
Which Direct3D API are you using? 9, 10, 11? –  Nathan Reed May 22 '13 at 21:57
add comment

1 Answer

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.

See this page for semantics details:

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

share|improve this answer
    
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 ? –  Edoardo Tyger Dominici 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. –  GPUquant May 23 '13 at 6:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.