Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (ozgur, Quad), 880 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
HLSL compiler bug #360788
02/27/11 00:03
02/27/11 00:03
Joined: Mar 2006
Posts: 2,252
Hummel Offline OP
Expert
Hummel  Offline OP
Expert

Joined: Mar 2006
Posts: 2,252
Hi,

found a strange bug which doesnt occur when I precompile my shader using the fxc.exe from the DX SDK. The following expression should never become true but it actually does:
(x>=1) != (x>1 || x==1)

Just make simple pp effect using COL as output with these lines:
Code:
float bla2=frac(Tex.x*32);
COL=floor(bla2*32)/31.f;

COL=((COL.r>=1) != (COL.r>1 || COL.r==1));



YouŽll get white vertical stripes over the screen.
Compiled with fxc the screen stays black as expected.

V8.10.1

Regards

PS: Besides, when compiling complex shaders with big loops the fxc compiler is much faster. Why?

Re: HLSL compiler bug [Re: Hummel] #360963
02/28/11 08:42
02/28/11 08:42
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Better never compare nonzero floating point variables with "==". As you see, some compilers just don't like this. And we're not going to fix the compiler.

But it's interesting. Which DirectX SDK version were you using for the external compiler?

Re: HLSL compiler bug [Re: jcl] #361413
03/02/11 20:55
03/02/11 20:55
Joined: Mar 2006
Posts: 2,252
Hummel Offline OP
Expert
Hummel  Offline OP
Expert

Joined: Mar 2006
Posts: 2,252
Must have been a quite old one but actually I dont know the exact SDK version the exe is coming from. The fxc.exe file version is 9.26.952.2844.

Re: HLSL compiler bug [Re: Hummel] #361493
03/03/11 11:06
03/03/11 11:06
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
This could explain the different behavior. The engine uses the August 2009 SDK. I don't know if shader compiling with a different version causes a problem, but better use the August 2009 fxc.exe to get consistent behavior. Or compile fxo files with the engine - fxc.exe won't work for library shaders anyway.


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1