[RESOLVED kinda] edgeDetectP.hlsl warning X3550
by Steve Acaster · in Torque 3D Professional · 08/12/2009 (11:08 am) · 10 replies
From stock New Project.
Not sure about this warnign, AA seems to work fine. Shaders ain't my strong point ...
game/shaders/common/postFx/edgeaa/edgeDetectP.hlsl(30,13): warning X3550: array reference cannot be used as an l-value; not natively addressable, forcing loop to unroll
Not sure about this warnign, AA seems to work fine. Shaders ain't my strong point ...
About the author
One Bloke ... In His Bedroom ... Making Indie Games ...
#2
So, this means that, instead of something like this:
Turns into...
And the compiler is just warning you about why this is happening.
08/12/2009 (11:14 am)
This warning is telling you that shader code, which would otherwise be a dynamic loop, is being unrolled.So, this means that, instead of something like this:
for(int i = 0; i < 4; i++) foo[i] += bar;
Turns into...
foo[0] += bar; foo[1] += bar; foo[2] += bar; foo[3] += bar;
And the compiler is just warning you about why this is happening.
#3
08/12/2009 (11:24 am)
@Joshua - actually I did have a peek, and it seems to be exactly the same file as in Beta4, which didn't flag a warning, so I reckoned it was because of something else.
#4
08/12/2009 (12:01 pm)
Oh.. yeah I haven't seen that file. Loop unrolling is usually an optimization but I guess it's saying it can't address the memory at run-time. I'll be interested to look at this file to see how that array is being passed to the shader.
#5
08/12/2009 (2:00 pm)
Yea... whenever you use array indexing via [] in a loop it spits out that warning. Its sort of annoying... not sure if there is a way to code it better or disable that one warning in that case.
#6
I recall seeing this warning before - might have been a Beta other than 4 though - can't remember.
@Tom:
I wonder if there is a difference about how the two blocks would count against the maximum command count for the actual shader model. If there's no difference, then I think the warning should be suppressed.
08/12/2009 (6:03 pm)
@Steve: I recall seeing this warning before - might have been a Beta other than 4 though - can't remember.
@Tom:
I wonder if there is a difference about how the two blocks would count against the maximum command count for the actual shader model. If there's no difference, then I think the warning should be suppressed.
#7
08/12/2009 (6:06 pm)
There is a difference. Unrolling the loop means it will duplicate the instructions.
#9
@Pat: Thank you for the info! That's very useful to know!
08/13/2009 (4:24 am)
@Steve: You're right, that's why it was familiar. :)@Pat: Thank you for the info! That's very useful to know!
#10
Not resolved in Release, but not really a bug - see post 5 - so moved to resolved.
09/30/2009 (10:57 pm)
Just on a clean up.Not resolved in Release, but not really a bug - see post 5 - so moved to resolved.
Torque 3D Owner Joshua Horns
If you are feeling intrepid you could open the shader file in notepad++ and see what's on line 30.