PixelShader won't compile in dx9

Started by
2 comments, last by JHL 20 years, 9 months ago
I''m upgrading my engine to dx9 from dx8.1 and a pixel shader that compiled fine before but won''t compile under dx9 this is it: ps_1_3 tex t0 texdp3tex t1,t0_bx2 texbem t2,t0_bx2 texbem t3,t0_bx2 lrp r0.rgba,t3.a,v0,t3 lrp r0.rgba,t1,t2,r0 Its used to render water the t0 is a normal map, and texdp3tex is a look up to a fresnel table, and the first texbem is the reflected scene and the second is the underwater scene (for refractions) Any one see how I can fix this
Advertisement
...What are the error messages? They should be spit out to the debugger, or you can run it through fxc to see.

Do you have dcl statements?

I like pie.
[sub]My spoon is too big.[/sub]
it complains about the _bx2 suffix on the texbem intructions but it didn't in dx8.1 and it doesn't work right with out them. There are no dcl statements in a pixel shader?

Also the docs say that its only invalid in versions 1.0 and 1.1

[edited by - JHL on July 25, 2003 7:18:39 PM]
It appears DX9 simply fixes a bug that was in previous versions. The following is from a DirectXDev thread from last year:

quote:The _bx2 source modifier may produce undefined result on
texbem/texbeml/texreg2ar/texreg2gb. The validator should catch such
usage and fails CreatePixelShader. If you see otherwise, then it is
validator missing that case.

Pai-Hung Chen
Direct3D, Microsoft

-----Original Message-----
Subject: Re: Geforce 4TI / 29.42: texdp3tex
Sent: Wednesday, July 10, 2002 5:26 AM

We''ve been getting really flakey results when you use the _bx2 extension
with any of the dependent reads (in our case, texbem). Sometimes it
seems to ignore the modifier, and sometimes it seems to take the values
from random RGB channels, not the ones it''s meant to. For example,
texbem blah, blah_bx2 seems to take signed values from the G and A
channels (but only sometimes - sometimes it works fine - we don''t know
why).




--
Simon O''Connor
ex -Creative Asylum
Programmer &
Microsoft MVP

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement