[Bug 43948] d3dx9 effects - pixel shader 2.0 does not render well

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Jan 12 15:41:22 CST 2018


https://bugs.winehq.org/show_bug.cgi?id=43948

Matteo Bruni <matteo.mystral at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|directx-d3dx9               |directx-d3d

--- Comment #3 from Matteo Bruni <matteo.mystral at gmail.com> ---
It's not clear to me what you tested exactly, with the attached shaders you're
always forcing vertex position to 0 so, if you're drawing triangles, nothing in
the rest of the shader should matter.

With reasonable vertex positions or e.g. point sprites you should be able to
see something on the screen. At that point I guess you get to meet our nice old
friend NaN come up from normalize(IN.lightVec). That will probably cause you to
draw black on Wine regardless of what you try to do to the result of
normalize().
d3d9 drivers on Windows program the GPU to avoid NaNs in ps_2_0 shaders, so you
get that NaN converted to 0. nine probably hacks the rsq in the pixel shader to
return a large number instead of +inf so that it becomes 0 after the
multiplication by 0 instead of NaN. Or maybe it's able to set the GPU similarly
to the Windows drivers, I don't recall right now. Either way, you get 0 + 0.5 =
gray.

On Wine there is no such trickery and NaNs are preserved (like they should be
in d3d10+, but also in shader model 3 to some degree) so you get NaN + 0.5 =
NaN = black. Unfortunately there is no sensible way in OpenGL to "emulate" the
d3d9 behavior correctly so we could only do hacks like the rsq thing above (as
we actually did years ago). The problem is that, as with most of the hacks,
other applications are going to break because of that.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list