Qt-interest Archive, June 2007
RE: (Solved: DirectX) Re: Wrong item heights in QTreeWidget, QListWidget, QComboBox, ...
Message 1 in thread
Stefan Schulze wrote:
> I was finally able to reproduce the problem: Using DirectX9 to render
> the contents of a QWidget causes this strange behaviour.
>
> This is caused by IDirect3D9::CreateDevice() which changes the
> floating-point unit control word to single-precision, round-to-nearest
> mode.
>
> Solution: Supplying the flag D3DCREATE_FPU_PRESERVE to
> IDirect3D9::CreateDevice() forces DirectX to use the FPU mode of the
> calling thread, which solves the problem.
>
> Do NOT ask me how much time it took me to find THAT out. :)
>
> Maybe I can now get back to work, finally.
>
> Thanks and Bye, Stefan.
Stefan, thanks a lot for this, we were already debugging for a day
around this issue, you saved us a lot of time digging for a solution.
It seems crazy that when you *don't* supply an option to Direct3D that
it will wreak havoc on your FPU mode.
IMHO it should be the other way round: that you can supply an option to
Direct3D to make it quicker - for the cost of having it mess around with
the FPU. But i guess it's very Microsoft-like to do it like this :(
Anyways, i think i'm going to submit this to the trolls anyways, since
it would be good if Qt would continue working even with the FPU is in
single precision mode. (hmm, maybe the problem is when the FPU mode
switches after Qt has already set some values?)
Cheers and thanks again,
Peter
--
[ signature omitted ]
Message 2 in thread
Stefan Schulze wrote:
> Solution: Supplying the flag D3DCREATE_FPU_PRESERVE to
> IDirect3D9::CreateDevice() forces DirectX to use the FPU mode of the
> calling thread, which solves the problem.
>
> Do NOT ask me how much time it took me to find THAT out. :)
>
> Maybe I can now get back to work, finally.
>
> Thanks and Bye, Stefan.
For the archive: this is no longer necessary. Qt 4.3.0 (final) behaves
correctly, even with single precision FPU mode.
Cheers,
Peter
--
[ signature omitted ]