Sign in to follow this  

fxc option /Gfp, prefer flow control doesn't work for ps_2_b

Recommended Posts

Hi all I am rewriting a shader of ps_3_0 to ps_2_b. The main diffculty is that it uses too many float constant registers. I found that the compiler uses only cmp instruction for branch for ps_2_b, so that a bool constant is compiled into a float constant. I need to force the compiler to use if instruction so that the bool constant can be bool constant. I tried to use /Gfp for ps_3_0 and it works fine, but for ps_2_b the compiler just won't change cmp to if. It's so annoying. Another solution would be to compile the shader using ps_3_0 profile and set /Gfp, then change the outputed assembly code to fit into ps_2_b. But this seems to be a dirty way. Any suggestion?

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