[PS 1.4] Problem with lrp and cmp instructions

[PS 1.4] Problem with lrp and cmp instructions

Post by Pascal Guéri » Wed, 02 Jul 2003 23:00:54



Hi there !

I encounter some problems with these instructions. GPU is RADEON
8500/8500LE (drv 5.13.1.6118)

1. LRP
Here is the context :
For the test I use a simple VS and PS, as follows :

vs.1.1
// Transform position
m4x4 oPos,v0,c4
mov oD0,c22  ; c22 = 1.0f, 0.0f, 0.0f, 1.0f - RED
mov oD1,c23  ; c23 = 0.0f, 1.0f, 0.0f, 1.0f - GREEN

ps 1.4
lrp r0,c5,v0,v1

where c5 is setup by the app with a value varying between 0 and 1
included (same value for each component of c5).

AlphaBlend = false
AlphaTest = false

Now the results are :
when c5 == 0, the color is RED ! (should be GREEN)
when c5 moves from >0 to <1, the color gradually turns from GREEN to
RED, which is correct;
when c5 == 1, the color is YELLOW ! (should be RED)

Isn't it crazy ? Is there a workaround? Bug in the GPU?

2. CMP
Doc says : Conditionally chooses between src1 and src2, based on the
comparison src0 >= 0
Actually the experiment shows it is a strict comparison (src0 > 0).
Do replace the PS1.4 line by "cmp r0,c5,v0,v1" and when C5==0, the color
is GREEN (should stay RED)

Finally in that case, CMP is the same as CND used with a bias modifier
on src0, which then makes the latter pretty useless ( cnd dest,src0,...
== cmp dest,src0_bias,... )...
So, CMP bugged or doc wrong ?
Do LRP and CMP suffer a common bug (for instance LRP would make implicit
use of CMP somehow) ?

Thx!
/Pascal.

 
 
 

[PS 1.4] Problem with lrp and cmp instructions

Post by Phil Taylo » Thu, 03 Jul 2003 02:05:34


what does the REF device show?

--


Quote:> Hi there !

> I encounter some problems with these instructions. GPU is RADEON
> 8500/8500LE (drv 5.13.1.6118)

> 1. LRP
> Here is the context :
> For the test I use a simple VS and PS, as follows :

> vs.1.1
> // Transform position
> m4x4 oPos,v0,c4
> mov oD0,c22  ; c22 = 1.0f, 0.0f, 0.0f, 1.0f - RED
> mov oD1,c23  ; c23 = 0.0f, 1.0f, 0.0f, 1.0f - GREEN

> ps 1.4
> lrp r0,c5,v0,v1

> where c5 is setup by the app with a value varying between 0 and 1
> included (same value for each component of c5).

> AlphaBlend = false
> AlphaTest = false

> Now the results are :
> when c5 == 0, the color is RED ! (should be GREEN)
> when c5 moves from >0 to <1, the color gradually turns from GREEN to
> RED, which is correct;
> when c5 == 1, the color is YELLOW ! (should be RED)

> Isn't it crazy ? Is there a workaround? Bug in the GPU?

> 2. CMP
> Doc says : Conditionally chooses between src1 and src2, based on the
> comparison src0 >= 0
> Actually the experiment shows it is a strict comparison (src0 > 0).
> Do replace the PS1.4 line by "cmp r0,c5,v0,v1" and when C5==0, the color
> is GREEN (should stay RED)

> Finally in that case, CMP is the same as CND used with a bias modifier
> on src0, which then makes the latter pretty useless ( cnd dest,src0,...
> == cmp dest,src0_bias,... )...
> So, CMP bugged or doc wrong ?
> Do LRP and CMP suffer a common bug (for instance LRP would make implicit
> use of CMP somehow) ?

> Thx!
> /Pascal.


 
 
 

[PS 1.4] Problem with lrp and cmp instructions

Post by Pascal Guéri » Thu, 03 Jul 2003 02:34:02


Phil Taylor a crit :

Quote:> what does the REF device show?

With the REF device, everything works fine.
/Pascal.
 
 
 

[PS 1.4] Problem with lrp and cmp instructions

Post by Phil Taylor [ATI » Thu, 03 Jul 2003 07:48:44


have you tried on other drivers on this hw, and on other hw? this is
starting to sound like a driver bug...


Quote:

> Phil Taylor a crit :

> > what does the REF device show?

> With the REF device, everything works fine.
> /Pascal.

 
 
 

[PS 1.4] Problem with lrp and cmp instructions

Post by Eyal Tele » Thu, 03 Jul 2003 19:23:05


As Phil Taylor says, this sounds like a driver bug. I suggest you mail

        Eyal

 
 
 

[PS 1.4] Problem with lrp and cmp instructions

Post by Dan Baker [MS » Fri, 04 Jul 2003 06:21:31


There are some known hardware issues with the 8500 class part. The basic one
is that LRP will have undefined behavoir for lrps performed on values not
between 0 and 1. It turns out that using a constant register isn't entirly
safe due to the way that are stored, the only for SURE way for lrp to work
is with _sat'd value, so use

mov r0_sat, c5
lrp r0, r0, v0, v1

BTW, the dx9 runtime will issue a warning for these cases.

Dan Baker
Microsoft, Direct3D


Quote:> Hi there !

> I encounter some problems with these instructions. GPU is RADEON
> 8500/8500LE (drv 5.13.1.6118)

> 1. LRP
> Here is the context :
> For the test I use a simple VS and PS, as follows :

> vs.1.1
> // Transform position
> m4x4 oPos,v0,c4
> mov oD0,c22  ; c22 = 1.0f, 0.0f, 0.0f, 1.0f - RED
> mov oD1,c23  ; c23 = 0.0f, 1.0f, 0.0f, 1.0f - GREEN

> ps 1.4
> lrp r0,c5,v0,v1

> where c5 is setup by the app with a value varying between 0 and 1
> included (same value for each component of c5).

> AlphaBlend = false
> AlphaTest = false

> Now the results are :
> when c5 == 0, the color is RED ! (should be GREEN)
> when c5 moves from >0 to <1, the color gradually turns from GREEN to
> RED, which is correct;
> when c5 == 1, the color is YELLOW ! (should be RED)

> Isn't it crazy ? Is there a workaround? Bug in the GPU?

> 2. CMP
> Doc says : Conditionally chooses between src1 and src2, based on the
> comparison src0 >= 0
> Actually the experiment shows it is a strict comparison (src0 > 0).
> Do replace the PS1.4 line by "cmp r0,c5,v0,v1" and when C5==0, the color
> is GREEN (should stay RED)

> Finally in that case, CMP is the same as CND used with a bias modifier
> on src0, which then makes the latter pretty useless ( cnd dest,src0,...
> == cmp dest,src0_bias,... )...
> So, CMP bugged or doc wrong ?
> Do LRP and CMP suffer a common bug (for instance LRP would make implicit
> use of CMP somehow) ?

> Thx!
> /Pascal.

 
 
 

1. Problem opening Grid files in Fractal! 1.4

     I've been playing around with a nice little freeware program for
generating fractal landscapes called Fractal!.  According to the
documentation, one can create a grid file that specifies the shape of the
terrain to be generated, instead of it being random, and I have created
one using the format described, but I can't seem to open it.  When I use
the "Open Grid File..." command, the open dialog fails to recognize my
file.  I've tried setting the creator code to the one for Fractal! and
tried every type code used in the BNDL for Fractal!, but it still won't
see my file.  Has anyone ever gotten this to work?  If so, I would
appreciate any help you can give me.  Thanks in advance.

*********************************************************************

*********************************************************************
"But soft, what light through yonder window breaks?  It is the East,
and Juliet is AAAHHH THE SUN!!!"  *PHOOM!* -- Romeo the Vampire

2. Infini-D 3.5

3. Problem with LScript 1.4

4. weapons

5. problem with Lscript 1.4

6. Nibbles, Snake, Worm

7. Best PS Newbie Instruction?

8. GK2000, DI3000 inst. problems

9. Recommendations for a good instruction book for a PS CS Newbie

10. PS 3.0 Video Instruction

11. Object-oriented VR-ML, Release 1.4

12. ANNOUNCE: Leveller 1.4 demo available

13. Leveller 1.4 available