Discussion:
Texture loads inside static branches
(too old to reply)
Andrew McDonald
2007-06-25 11:26:38 UTC
Permalink
Given an HLSL shader with a texture load inside a static branch, we've
noticed that the compiler will sometimes emit the 'texld' outside the 'if'
in the assembly. Still seems to work OK thanks to the maths it uses, but
presumably we'll still pay for the cost of the texture read. Is there a
reason this is a good idea, or is it a compiler bug?

These are branches against boolean constants, using the June 2007 SDK.

Cheers,
Andy
Andrew McDonald
2007-07-17 09:16:20 UTC
Permalink
Post by Andrew McDonald
Given an HLSL shader with a texture load inside a static branch, we've
noticed that the compiler will sometimes emit the 'texld' outside the 'if'
in the assembly. Still seems to work OK thanks to the maths it uses, but
presumably we'll still pay for the cost of the texture read. Is there a
reason this is a good idea, or is it a compiler bug?
These are branches against boolean constants, using the June 2007 SDK.
If anyone else is interested, this has been confirmed as a bug in the
optimiser. It should be fixed in the release after August.

--
Andy

Loading...