Jump to content

  • Log In with Google      Sign In   
  • Create Account

usage of hlsl function


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 tcige   Members   -  Reputation: 206

Like
0Likes
Like

Posted 03 June 2013 - 02:05 AM

rcp

msdn says 'Minimum shader model' is 5, but why vs_1_1 could use it



Sponsor:

#2 Hodgman   Moderators   -  Reputation: 30384

Like
1Likes
Like

Posted 03 June 2013 - 02:29 AM

Earlier versions can't use it, because it wasn't added to the spec until SM5.
You have to just use "1/x" for earlier versions.

#3 tcige   Members   -  Reputation: 206

Like
1Likes
Like

Posted 03 June 2013 - 02:38 AM

Earlier versions can't use it, because it wasn't added to the spec until SM5.
You have to just use "1/x" for earlier versions.

 

i test it works for 'vs_1_1', and D3DXCompileShaderFromFile returns no error



#4 Yourself   Crossbones+   -  Reputation: 1133

Like
0Likes
Like

Posted 03 June 2013 - 03:04 AM

it is definitely supported in vertex shaders since vs_1_1, and (if I remember correct) in pixel shaders since ps_2_0

I think what msdn means is that it is supported in all shader types (so also in hull, domain and geometry shaders) starting from SM5.



#5 tcige   Members   -  Reputation: 206

Like
0Likes
Like

Posted 03 June 2013 - 03:15 AM

it is definitely supported in vertex shaders since vs_1_1, and (if I remember correct) in pixel shaders since ps_2_0

I think what msdn means is that it is supported in all shader types (so also in hull, domain and geometry shaders) starting from SM5.

 

yes, i am writing hlsl

 

'vs_1_1' is the paramter passed to D3DXCompileShaderFromFile



#6 Hodgman   Moderators   -  Reputation: 30384

Like
1Likes
Like

Posted 03 June 2013 - 03:21 AM

Huh... the rcp intrinsic function did not used to exist, it is new (at least, it doesn't show up in my old offline documentation).

 

However, there is an rcp assembly instruction in VS 1.1 and PS 2.0, maybe the HLSL compiler was modified to accept this new intrinsic and compile it as the rcp instruction, but the MSDN docs were never updated to reflect this? It's obviously easy to support on any hardware, as long as that hardware can do division wink.pngrcp(x) just has to be an approximate form of 1/x, so the real thing is a suitable implementation.

 

Curiously, SM3 has the same rcp instruction as SM1/SM2, SM5's is specified slightly differently, and SM4's assembly language does not contain an rcp instruction at all!


Edited by Hodgman, 03 June 2013 - 07:37 AM.


#7 eppo   Crossbones+   -  Reputation: 2459

Like
0Likes
Like

Posted 03 June 2013 - 07:10 AM

the rcp intrinsic function did not used to exist, it is new.

 

I haven't seen it before either. I've tried it out for vs_4_1 and ps_4_1 and it compiles.



#8 Zaoshi Kaba   Crossbones+   -  Reputation: 4346

Like
0Likes
Like

Posted 03 June 2013 - 08:28 AM

Does shader get created successfully? Maybe it only compiles with won't create shader.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS