Sign in to follow this  
TheKrust

anybody have a clue what this means?

Recommended Posts

teamCol.ps(92): error X6077: texld/texldb/texldp/dsx/dsy instructions with r# as source cannot be used inside dynamic conditional 'if' blocks, dynamic conditional subroutine calls, or loop/rep with break*. it comes up when I put parts of my pixel shader in a loop. I checked to see if I might have been defining multiple times, but that's not the case ~_~

Share this post


Link to post
Share on other sites
The error is actually very descriptive. You should try reading your error message sometime. The compiler designers put them in for a reason.

Basically, the error is saying the texld, texldb, texldp, dsx, and dsy instructions cannot be used inside of dynamic if blocks, dynamic subroutine calls, or loops, which is why putting them in a loop causes the error.

Share this post


Link to post
Share on other sites
Yes, I posted this question because I knew EXACTLY what that meant. Not like I would have tried to figure it out before hand.

Oh, and not even to mention that none of those words ever appear inside my code. Ever.

Share this post


Link to post
Share on other sites
While posting the loop that won't compile would have been nice, I'm pretty sure I know what's up even without it. You're trying to sample a texture inside an if, or inside a loop with a break, which isn't supported.

Share this post


Link to post
Share on other sites
There we go, yes, thank you very much. That fixed it. Now I just need to find another method, but that shouldn't be a huge problem.

Share this post


Link to post
Share on other sites
It's referring to the assembly instructions rather than HLSL. Admittedly that might not be so useful, but a search in the SDK doc for any of those instructions does in fact yield a doc page [wink]

FWIW, you're restricted on texture instructions inside conditional shader code because there is dependence on neighbouring pixels (derivatives feed into mip level selection) and by definition those neighbouring pixels may not have executed the same branch as the current one.

Computing ddx() and ddy() outside the branch and then using tex2Dgrad() is the usual solution.

hth
Jack

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