- Viewing Profile: Reputation: Ghosrath
Community Stats
- Group Members
- Active Posts 12
- Profile Views 1,121
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
User Tools
Contacts
Ghosrath hasn't added any contacts yet.
#4920713 Recursive Methods
Posted by Ghosrath
on 09 March 2012 - 11:10 AM
#4920681 Recursive Methods
Posted by Ghosrath
on 09 March 2012 - 09:03 AM
What error message do you get?
#4920367 Why can't i use tex2D in loop with HLSL?
Posted by Ghosrath
on 08 March 2012 - 02:57 AM
X3553:
OK, this is a bit difficult to explain. First, the reason why the second one works, is because it is automatically unrolled. You loop a constant amount of iteration, so the compiler can silently unroll without side effects.
Now, the reason the first doesn't work as expected, is due to the fact that derivatives (as used by a gradient instruction, such as tex2D) are undefined within a conditional statement (such as the one implicitly used by the loop).
You can solve this by either not using derivatives at all (ie. supplying a constant LOD through tex2DLod rather than the tex2D) or by manually computing the derivatives outside of the loop, and supplying them explicitly. If you only want to blur a screen aligned rectangle, then the best method is the former one.
resource:
http://www.gamedev.net/topic/526047-bizzare-shader-error/X3511:
resource: http://www.ureader.com/msg/146533.aspxThe compiler needs to prove that the loop will terminate within 1024
iterations to target the ps_2_0 profile. Since your index value comes from
a global, no range information can be infered beyond the 32-bit int type.
You can force this by doing something like:
int x = gNum % 1023;
for( int i = 0; i < x; i++ ) ...
hope this helps
- Home
- » Viewing Profile: Reputation: Ghosrath

Find content