Sign in to follow this  
Mastaba

Question about PS_3_0 assembly

Recommended Posts

I just compiled a HLSL pixel shader, using the 3.0 profile, and according to the DirectX SDK, the shader compiler has output what appears to me to be invalid code. For the cmp instruction, the SDK says that the destination register can not be the same as any of the source registers. So why did the shader compiler output the following line:
cmp r1.xyz, r1, c2.x, c2.y
Does r1.xyz not qualify the same as r1?

Share this post


Link to post
Share on other sites
You're saying that when you load up the shader, the D3D debug runtime complains that it's invalid?

If so you may have found a bug in the HLSL compiler. Which version of the DirectX SDK are you using?

Share this post


Link to post
Share on other sites
Quote:
Original post by Demirug
The compiler output is valid. Only PS 1.2 and 1.3 have this limitation.


So it is. I just reread the relevant page in the SDK and there was a sentence immediately before that limitation saying so, but somehow I didn't see it before.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this