Re: [PATCH 1/2] wined3d: Try to detect the polygon offset scale value.
On 30 July 2015 at 12:00, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
+ if (depth->format_flags & WINED3DFMT_FLAG_FLOAT) + scale = gl_info->float_polyoffset_scale; + else + scale = gl_info->fixed_polyoffset_scale; Ideally this would be a format property. In practice it probably works because we only use 24 and 32 bit depth formats, and the hardware probably either only distinguishes between 16 and 24/32, or just doesn't support 32.
+ while(1) I would have preferred that as "for (;;)"
+ return powf(2, cur); It seems the compiler is smart enough to work it out, but strictly speaking powf() takes floating point arguments.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2015-07-30 um 13:56 schrieb Henri Verbeet:
Ideally this would be a format property. In practice it probably works because we only use 24 and 32 bit depth formats, and the hardware probably either only distinguishes between 16 and 24/32, or just doesn't support 32. I'm actually quite happy that we don't have to run this test for every format, mostly due to startup performance concerns...
Some Mesa drivers (r300g if I remember right) have some 16 vs 24 bit code in glPolygonOffset, but in practise it didn't matter. I haven't really debugged the driver to find out what's going wrong. (r200 has a suspiciously commented out offset *= 2, which is probably why it ends up wanting 2^24 instead of 2^23 like all the other drivers) One suspicion I checked is that the driver looks at the GLX format instead of the FBO format, but changing the GLX format we request didn't influence the outcome. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVuhcoAAoJEN0/YqbEcdMw7mQP/27c51FofjV4aAZNlw7m7FTR ARpHwZL+unz4OeGqFPCcBVJOfDHI+ZIgnKcqq2uJvW++G02Ejvo66kyJpQBSfstP E63wfRn9wEzAtmgmXYwsRjo93/qUurCFvapNdxFRwlGDijtzhAmMhVSM8SjE9JLW MgrqtCJJjmQgR+0KaYV4210u/8PQrlrUxs/dH4g35TGDjvU6oP/gpgs3Ym3jE9/v 1E2ndiMOKswZxPvkJADGJGEo6hfEK1SwMOoqueWnubsZSAKEWCVZOKZzVMEGCmMv g/Ia7NnSVv5RzQjWbxfUa1avFmmq20Rsw/v17wEPHnEZJGgzGfwgSIreaHfCVzsW C7mWtSXnm9lGnIP0DZGq3Nv5gKuk/W831UGnipB1yfhazJsoHi1rldmKIQZMh+hR M9ggHF4MIXFznV+75WG/WH2zl0mvDpd3W3In1YWbmJhpdzo7s4sM6xd9D5RX8lVr ekY5EAfKPlvavMhyiLY6Y73cGp13kaCOJ/YZF2oAbpCTS2BZnfyw5iOspPn1CbFJ Z+RZ1XNff1QI+NdMCFjloFdCDHfgF5etTcdQ5e+wjWylixZGwVpOGvQz5YLH9P0l HJGPy89/pq4AClij0OsiH+nkqg6mPgi9L0B4xJ64Mdja3CpXmstedQ7TH8k1c4V3 jcN9wmCmY5tMzznwlrLg =o+0U -----END PGP SIGNATURE-----
participants (2)
-
Henri Verbeet -
Stefan Dösinger